Replacing PREPARE - Mailing list pgsql-sql

From Paul E Stephens
Subject Replacing PREPARE
Date
Msg-id 4.2.0.32.19990422193209.00a42e60@mail.hwrd1.md.home.com
Whole thread Raw
List 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:

Previous
From: Paul E Stephens
Date:
Subject: Replacing PREPARE
Next
From: Chris Bitmead
Date:
Subject: Re: [SQL] SELECT TOP X -- part 2 -- parse error?