Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New transaction object

Status
Not open for further replies.

helgen

Programmer
Dec 10, 2002
6
NO
Hi

I've replaced my apps default transaction object SQLCA with "my_trans". In my applications open-event I set:
transaction my_trans
my_trans = create transaction

It connects OK to the database.

The problem is that dynamic SQL (format 3) doesn't work anymore. I recieve error message "Database command has not been successfully prepared". I have tried to replace SQLSA with a new variable my_sqlsa (of type DynamicStagingArea).

Can anyone help?

regards,
Helge
 
Hi,

When you issue your
Code:
PREPARE DynamicStagingAreaVariable FROM SQLStatement
are you using the
Code:
 USING transactionobject
clause?

i.e. assuming your transaction object my_trans:
Code:
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA ;

sqlstatement = "some sort of SQL"

PREPARE SQLSA FROM :sqlstatement USING my_trans;
                                 ^^^^^^^^^^^^^^
OPEN DYNAMIC my_cursor;

FETCH my_cursor INTO :A_Variable ;

CLOSE my_cursor ;

SQLSA is a system-provided staging area - there is nothing special about it.

Cheers.
 
How could I miss that...
Thanks.
Helge
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top