Page 1 of 1

ZStoredProc and FB2.1

Posted: 16.10.2009, 14:20
by mj.terblanche
Hi,
I've recently installed ZeosLIB 6.6 stable and converted an application from IBX components to Z. The queries etc. generally works ok, but the ZStoredProc give me headaches. First, it's important to note the stored procedures and the field names are case sencitive. I found that if I don't include the procedure names in quotes while entering them in the StoredProcName propperty, ZeosLIB does not quote the entry and it gets converted to uppercase in the SQL, resulting in procedure not found.
This is different from IBX, but not neceserraly wrong. but the problem is that my parameters is not automatically populated at runtime, resulting in a statement like:
sp->ParamByName("ParamName")->....
giving the runtime error "parameter ParamName not found".
I know that recoding the SP's into read-only queries will fix the problem, but I perceive that this is probably some kind of a bug, not sure if it's only with quoted procedure names / parameters.
Are anyone else experiencing this?
Thanks,
MJ

Posted: 19.10.2009, 21:14
by seawolf
I use FB for several project and using different SP, but I haven't had this kind of error. Just 2 question ..

1. first parameter is an out parameter or have you mixed in and out params?
2. I suppose the name of that parameter is not ParamName. Do you confirm it?

Posted: 20.10.2009, 11:59
by mj.terblanche
seawolf wrote:I use FB for several project and using different SP, but I haven't had this kind of error. Just 2 question ..

1. first parameter is an out parameter or have you mixed in and out params?
2. I suppose the name of that parameter is not ParamName. Do you confirm it?
Hi, I tried it with both in-only and in and out parameters.
Just to clarify, procedure definition looks something like this:
create procedure "Example)
(
"Field1" char(10),
"Field2" char(10)
)
returns
(
"Result" char(20)
)....
Now in the object inspector of BCB5 I must type "Example" as the procedure name, with other words I must explicitly include the quotes.
This is still ok, but the moment I open the connection and have something like:
sp->ParamByName("Field1")->AsString = "abcdefghij";

the error:
Parameter Field1 not found.
appears.
Hope it's more clear. I'm sure it has to do with the quotes. It's unfortunatly too late to change our DB design to use case insencitive names, so I'm stuck. I'm converting these procedures to read-only queries just to get the project done.
Thanks,
MJ