Skip site navigation (1) Skip section navigation (2)

dynamic #include's?

From: "Mark McArthey" <mcarthey(at)execpc(dot)com>
To: "PgSQL Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: dynamic #include's?
Date: 2001-10-23 17:36:28
Message-ID: CGEFKOCNLBFDGLJODOGIKEJCCDAA.mcarthey@execpc.com (view raw or flat)
Thread:
Lists: pgsql-novice
I have an idea for creating a Perl script, but I just wanted to make sure
that no one has already created something similar.
When doing a full row select, it's necessary to create all the bind
variables, and then do a column by column select statement.  Ugly if there's
a lot of columns.  I want to automagically create an include that I would be
able to place in the DECLARE SECTION and also use in the SELECT statements.
For example:
EXEC SQL BEGIN DECLARE SECTION;
#include "player_def.h"
EXEC SQL END DECLARE SECTION;

The #include'd file would contain the bind variables that were gathered from
the database.

Additionally, we should be able to do something like this:

EXEC SQL SELECT
#include "player_sel.h"
INTO
#include "player_bind.h"
WHERE
name = 'blah';

All of these methods are based upon my prior experience with embedded sql,
so if Postgres has a better method, or something new has come up, please let
me know.
Thanks!
Mark



pgsql-novice by date

Next:From: Travis HoytDate: 2001-10-23 19:11:51
Subject: [Fwd: views, with check option]
Previous:From: Josh BerkusDate: 2001-10-23 16:51:17
Subject: Re: Concatenating strings

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group