BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting output parameter from stored proc - parameter mismat

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
mike
Guest





PostPosted: Thu Sep 18, 2003 3:10 am    Post subject: Getting output parameter from stored proc - parameter mismat Reply with quote



I have a table in Interbase 7 and a D7 program which tries to call a stored
procedure. Whenever I ExecProc for that stored proc, I get the error
"Dynamic SQL Error, Parameter mismatch for procedure RET_TWO". I've tried
TADOCommand and TADODataset...all with the same results. Please help!

Here is my interbase stored proc:

CREATE PROCEDURE RET_TWO
RETURNS (
NEWID INTEGER)
AS
BEGIN
NEWID=2;
END

Here is my D7 code (the connection is open) for accessing the TADOCommand:

ProcedureName := 'RET_TWO';
Parameters.Refresh;
X := Parameters.Count;
// X is 0 here - shouldn't this show 1 ???
Parameters.Clear;
Parameters.CreateParameter('NEWID',ftInteger,pdOutput,4,0);
X := Parameters.Count;
// X is 1 here
ExecProc;

The fact that Parameters.Count is 0 after a refresh suggest delphi does not
think ANY parameters exist. Please help.

Thanks, Mike


Back to top
mike
Guest





PostPosted: Sat Sep 20, 2003 2:21 pm    Post subject: Re: Getting output parameter from stored proc - parameter mi Reply with quote



Ok, I figured this one out!!!

I was using the MS OLEDB->ODBC then ODBC->Interbase drivers. I guess ODBC
will not respond with the name of parameters - only a real OLEDB driver
(provider) will....

-Mike-

"mike" <mike (AT) n-o-s-p-a-m (DOT) ocg.ca> wrote

Quote:
I have a table in Interbase 7 and a D7 program which tries to call a
stored
procedure. Whenever I ExecProc for that stored proc, I get the error
"Dynamic SQL Error, Parameter mismatch for procedure RET_TWO". I've tried
TADOCommand and TADODataset...all with the same results. Please help!

Here is my interbase stored proc:

CREATE PROCEDURE RET_TWO
RETURNS (
NEWID INTEGER)
AS
BEGIN
NEWID=2;
END

Here is my D7 code (the connection is open) for accessing the TADOCommand:

ProcedureName := 'RET_TWO';
Parameters.Refresh;
X := Parameters.Count;
// X is 0 here - shouldn't this show 1 ???
Parameters.Clear;
Parameters.CreateParameter('NEWID',ftInteger,pdOutput,4,0);
X := Parameters.Count;
// X is 1 here
ExecProc;

The fact that Parameters.Count is 0 after a refresh suggest delphi does
not
think ANY parameters exist. Please help.

Thanks, Mike






Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.