Q
Evaluate Weigh the pros and cons of technologies, products and projects you are considering.

Extending to DB2/400

We have a VB6 application that uses SQL Server and Oracle and we are extending to DB2/400. In Oracle, we can post multiple statements as follows:

Begin
update table1 where col1 = 1;
update table2 where col3 = 6;
.
.
End;

By passing the whole script as a SQL string through ODBC rather than make discrete, separate passes. When attempting this same code to AS/400 (v4r5) it errors. Can this process be accomplished in AS/400 SQL? If so, how?


This can be accomplished by moving the code to an SQL Stored procedure and executed on ODBC Call statement instead. This provide the same performance benefits.

 
Create Procedure Proc1()
Language SQL
Begin
 update table1 where col1 = 1;
 update table2 where col3 = 6;
 .
 .
End; 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

Search400.com's targeted search engine: Get relevant information on DB2/400.

The Best Web Links: tips, tutorials and more.

Check out this online event, Getting the Most out of SQL & DB2 UDB for the iSeries.


This was last published in January 2003

Dig Deeper on DB2 UDB (universal databases)

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close