Re: cursors

From: Michael Krolewski <mkrolews_at_upw.com>
Date: 1996/07/11
Message-ID: <31E540AD.2AFF_at_upw.com>#1/1


Sergio Tiezzi wrote:
>
> Anyone knows how is possible to prepare the cursors select statment
> into a variable like "prepare" in informix.
>
> we have to solve the following problem:
>
> we must include where clauses according to the values of one variable
> For example:
>
> v_select := "select * from my_table where my_field = my_value"
> if my_par_1 is not null then
> v_select := v_select, " and my_2nd_field = ", my_par_1
> end if
> if my_par_2 is not null then
> v_select := v_select, " and my_3rd_filed = ", my_par_2
> end if
> ...
>
> --- and i'd want to use v_select instead of select statement in
> --- my cursor declaration
>
> open :v_cursorvar for v_select --- ??? is it possible ???
>
> Thank you
>
> sergio_at_datatrade.sm

Yes there is.

In PRO*C there is a EXEC SQL PREPARE cursor1..

                EXEC SQL OPEN cursor1 USING xxx;

Get a manual to confirm....

Mike Krolewski Received on Thu Jul 11 1996 - 00:00:00 CEST

Original text of this message