 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
mike Guest
|
Posted: Thu Sep 18, 2003 3:10 am Post subject: Getting output parameter from stored proc - parameter mismat |
|
|
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
|
Posted: Sat Sep 20, 2003 2:21 pm Post subject: Re: Getting output parameter from stored proc - parameter mi |
|
|
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 |
|
 |
|
|
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
|
|