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

Replacing PREPARE

From: Paul E Stephens <phitau(at)home(dot)com>
To: mailto:
Subject: Replacing PREPARE
Date: 1999-04-22 23:39:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
Hello all,

I have been given some C code that contained some of Oracle's SQL 
calls.  One of the types of call is a fetch that uses the PREPARE 
command.  I am having trouble coming up with a work around and would 
appreciate any suggestions.

Code snip:

sprintf( query, "SELECT first, second FROM table_name where %s = %s", 
value1, value2 );

EXEC SQL PREPARE :select_str USING :query;

EXEC SQL DECLARE my_cursor CURSOR FROM :select_str;

EXEC SQL OPEN my_cursor;

EXEC SQL FETCH FORWARD 1 IN my_cursor INTO :value1, :value2;

Thanks in advance,
Paul E Stephens

pgsql-sql by date

Next:From: Chris BitmeadDate: 1999-04-22 23:57:32
Subject: Re: [SQL] Finding the "most recent" rows
Previous:From: G. Anthony ReinaDate: 1999-04-22 22:13:20
Subject: Re: [SQL] Changing the editor for the \e option

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