Pro*C - confusion about Dynamic SQL

From: Clint Eastwood <cjeastwd_at_powerup.com.au>
Date: Mon, 20 Dec 1999 06:46:40 GMT
Message-ID: <83kjev$1km22_at_inetbws1.citec.com.au>



HiYa

[Quoted] I was wanting to declare a cursor differently depending on passed input, and so I thought that I would prepare and declare. I was reading the manual to confrim my syntax, and I found this statment, which I don't understand, although I don't doubt.

If you declare two cursors using the same statement name, the precompiler considers the two cursor names synonymous.

For example, if you execute the statements

EXEC SQL PREPARE sql_stmt FROM :select_stmt; EXEC SQL DECLARE emp_cursor FOR sql_stmt;

EXEC SQL PREPARE sql_stmt FROM :delete_stmt; EXEC SQL DECLARE dept_cursor FOR sql_stmt;

I would have thought that this would be fine, and keep the 2 seperate strings, as 2 seperate cursor defintions.

My questions are

1 is this because the precompiler happens (as the name suggests) pre run time, that it sets up the same sqlca pointers for each, we can't consider that these are done dynamicaly?

2 does this have reprocussions for other prepare/declare statements within different functions??

thanks :-)

--

See Ya
(when the bandwidth gets better ;-)
Chris Eastwood                            Please remove undies for reply
Photographer, Stunt Programmer
Motorcyclist and dingbat
Received on Mon Dec 20 1999 - 07:46:40 CET

Original text of this message