PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

call stored procedure db2 problem

 
 
Hugo Gonzo
Guest
Posts: n/a
 
      24th Jul 2003
Hi all,

i have a problem execute a sql-script on DB2 database from a dotnet c#
program. The sql-script terminates after a CALL statement. The
following code should ilustrate this.

the sql-script:


OleDbConnection con = new OleDbConnection("Provider=IBMDADB2; User
ID=User1; Password=user1; Data Source=MyDB; Timeout=3600");
con.Open();

// the simple sql-script
string script = "SELECT * FROM Table1; CALL TestProc; SELECT * FROM
Table2;"

OleDbCommand cmd = new OleDbCommand(script, con);
OleDbDataAdapter adapt = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
int k = ds.Tables.Count;

// here the DataSet contains one Table, if I remove the CALL TestProc;
from the sql-script i get two Tables


The script comes to the call TestProc (which is called correctly) and
then exit without an error. The script execute correctly.

my enviroment:
DB2 Database 8.1.2
..Net 2003

Another question is:
How can i change the statement termination character from OleDB ?

any solutions

Hugo
 
Reply With Quote
 
 
 
 
CT
Guest
Posts: n/a
 
      29th Jul 2003
Hugo,

I don't have that much experience with DB2, but is there a statement
termination character in the stored procedure, and if so, what is it?

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Hugo Gonzo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> i have a problem execute a sql-script on DB2 database from a dotnet c#
> program. The sql-script terminates after a CALL statement. The
> following code should ilustrate this.
>
> the sql-script:
>
>
> OleDbConnection con = new OleDbConnection("Provider=IBMDADB2; User
> ID=User1; Password=user1; Data Source=MyDB; Timeout=3600");
> con.Open();
>
> // the simple sql-script
> string script = "SELECT * FROM Table1; CALL TestProc; SELECT * FROM
> Table2;"
>
> OleDbCommand cmd = new OleDbCommand(script, con);
> OleDbDataAdapter adapt = new OleDbDataAdapter(cmd);
> DataSet ds = new DataSet();
> int k = ds.Tables.Count;
>
> // here the DataSet contains one Table, if I remove the CALL TestProc;
> from the sql-script i get two Tables
>
>
> The script comes to the call TestProc (which is called correctly) and
> then exit without an error. The script execute correctly.
>
> my enviroment:
> DB2 Database 8.1.2
> .Net 2003
>
> Another question is:
> How can i change the statement termination character from OleDB ?
>
> any solutions
>
> Hugo



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call stored procedure in ASP.NET 2.0 syoung Microsoft ADO .NET 2 24th Sep 2005 06:59 PM
Call Stored Procedure via ASP.Net (VB) Sam Microsoft ASP .NET 6 11th May 2005 05:06 PM
Best way to call a stored procedure mike Microsoft C# .NET 2 22nd Jun 2004 03:56 PM
Stored Procedure call Steven K Microsoft ASP .NET 2 3rd Mar 2004 07:26 PM
how can i call stored procedure? khaled adam Microsoft Access ADP SQL Server 1 21st Oct 2003 07:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:09 PM.