Subject | named parameter always replaced by '?' |
---|---|
Author | robertosmith8 |
Post date | 2004-11-25T17:25:04Z |
Hi All,
The environment D7, Embedded Firebird 1.5.1, UIB dbExpress driver.
I tried to use a TSQLQuery component (ParamCheck = False) to run the
following code:
-----
CREATE PROCEDURE TEST (
FIELD1 INTEGER)
RETURNS (
FIELD2 INTEGER)
AS
Begin
FOR SELECT FIELD2 FROM TABLE1
WHERE FIELD1 = :FIELD1
INTO "FIELD2"
DO
BEGIN
SUSPEND;
END
End
-----------
When I check the stored procedure in the database, it appears that
named parameter has been replaced by '?' as follows:
---------
CREATE PROCEDURE TEST (
.........
WHERE FIELD1 = ?
INTO "FIELD2"
........
End
-----------
Besides that, I am not able to use :FIELD2 as the output parameter, so
I use "FIELD2" instead, if the ':FIELD2' is used there is a 'Invalid
token error, error code 249' at the ':' position.
But the real problem is the '?' replacement, I can't run the stored
procedure whatever value I pass into the input parameter, a null
result set is returned.
I have tried modify the VCL source in SqlExpr.pas source by commenting
a line of function FixParams as follows:
//++++ SQL := stringReplace(SQL, Param, ' ? ', []);
Yet, the '?' replacement persists. If I use the IBExpert program to
create or modify the stored procedure, the ':' named parameter was
never replaced by the '?'. I use the same fbClient.dll and dbexpress
driver, so the replacement must be done by the delphi VCL codes, How
can I stop the Replacement of named parameter by '?' ?
regards,
roberto
The environment D7, Embedded Firebird 1.5.1, UIB dbExpress driver.
I tried to use a TSQLQuery component (ParamCheck = False) to run the
following code:
-----
CREATE PROCEDURE TEST (
FIELD1 INTEGER)
RETURNS (
FIELD2 INTEGER)
AS
Begin
FOR SELECT FIELD2 FROM TABLE1
WHERE FIELD1 = :FIELD1
INTO "FIELD2"
DO
BEGIN
SUSPEND;
END
End
-----------
When I check the stored procedure in the database, it appears that
named parameter has been replaced by '?' as follows:
---------
CREATE PROCEDURE TEST (
.........
WHERE FIELD1 = ?
INTO "FIELD2"
........
End
-----------
Besides that, I am not able to use :FIELD2 as the output parameter, so
I use "FIELD2" instead, if the ':FIELD2' is used there is a 'Invalid
token error, error code 249' at the ':' position.
But the real problem is the '?' replacement, I can't run the stored
procedure whatever value I pass into the input parameter, a null
result set is returned.
I have tried modify the VCL source in SqlExpr.pas source by commenting
a line of function FixParams as follows:
//++++ SQL := stringReplace(SQL, Param, ' ? ', []);
Yet, the '?' replacement persists. If I use the IBExpert program to
create or modify the stored procedure, the ':' named parameter was
never replaced by the '?'. I use the same fbClient.dll and dbexpress
driver, so the replacement must be done by the delphi VCL codes, How
can I stop the Replacement of named parameter by '?' ?
regards,
roberto