Replacing PREPARE

Поиск
Список
Период
Сортировка
От Paul E Stephens
Тема Replacing PREPARE
Дата
Msg-id 4.2.0.32.19990422193209.00a42e60@mail.hwrd1.md.home.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Paul E Stephens
Дата:
Сообщение: Replacing PREPARE
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: [SQL] SELECT TOP X -- part 2 -- parse error?