Oracle and stored function problem
Posted: 21.03.2008, 10:29
Hi all,
There is my first experience with Oracle stored functions, and therefore i need a little help.
I did some examples on MySQL and it works, but for Oracle i have a big problem .
From Oracle developers I have got information about function prepared for my part of the project:
function GetLimit(CustCode in varchar2,
PlaceCode in out varchar2,
MoneyLimit out number,
MoneyTime out number,
rErr out varchar2 )return boolean;
Part of my Code:
Description:
Environment: ZeosDBO: 6.6.2, D7 Ent, Oracle 10g, Windows Vista Premium Basic and/or XP PRO, both legal and upgraded - the same effects.
Oracle Instant Client 11.1
zspKred is a type of TZStoredProc and connected to OraConn on OraTestMainForm.
Connection with Oracle works fine, I can read all other views without problems.
zspKred.Close;
zspKred.Params.Clear;
zspKred.Params.Add;
zspKred.Params[0].Name:='CustCode';
zspKred.Params[0].DataType:=ftString;
zspKred.Params[0].ParamType:=ptInput;
zspKred.Params.Add;
zspKred.Params[1].Name:='PlaceCode';
zspKred.Params[1].DataType:=ftString;
zspKred.Params[1].ParamType:=ptInputOutput;
zspKred.Params.Add;
zspKred.Params[2].Name:='MoneyLimit';
zspKred.Params[2].DataType:=ftInteger;
zspKred.Params[2].ParamType:=ptOutput;
zspKred.Params.Add;
zspKred.Params[3].Name:='MoneyTime';
zspKred.Params[3].DataType:=ftInteger;
zspKred.Params[3].ParamType:=ptOutput;
zspKred.Params.Add;
zspKred.Params[4].Name:='rErr';
zspKred.Params[4].DataType:=ftString;
zspKred.Params[4].ParamType:=ptOutput;
zspKred.StoredProcName:='GetLimit';
zspKred.Connection:=OraTestMainForm.OraConn;
zspKred.ParamByName('CustCode').AsString:='013137';
zspKred.ParamByName('PlaceCode').AsString:='WA';
zspKred.ParamCheck:=true;
Here comes execution and independent of the call there is the same error:
'Unsupported operation'
zspKred.ExecProc;
zspKred.Open;
SQL log (TZSQLMonitor) is in this moment empty but it's clear.
I am sure that I am doing something wrong, but what?
Thak you in advance for help.
Regards
Mariusz
There is my first experience with Oracle stored functions, and therefore i need a little help.
I did some examples on MySQL and it works, but for Oracle i have a big problem .
From Oracle developers I have got information about function prepared for my part of the project:
function GetLimit(CustCode in varchar2,
PlaceCode in out varchar2,
MoneyLimit out number,
MoneyTime out number,
rErr out varchar2 )return boolean;
Part of my Code:
Description:
Environment: ZeosDBO: 6.6.2, D7 Ent, Oracle 10g, Windows Vista Premium Basic and/or XP PRO, both legal and upgraded - the same effects.
Oracle Instant Client 11.1
zspKred is a type of TZStoredProc and connected to OraConn on OraTestMainForm.
Connection with Oracle works fine, I can read all other views without problems.
zspKred.Close;
zspKred.Params.Clear;
zspKred.Params.Add;
zspKred.Params[0].Name:='CustCode';
zspKred.Params[0].DataType:=ftString;
zspKred.Params[0].ParamType:=ptInput;
zspKred.Params.Add;
zspKred.Params[1].Name:='PlaceCode';
zspKred.Params[1].DataType:=ftString;
zspKred.Params[1].ParamType:=ptInputOutput;
zspKred.Params.Add;
zspKred.Params[2].Name:='MoneyLimit';
zspKred.Params[2].DataType:=ftInteger;
zspKred.Params[2].ParamType:=ptOutput;
zspKred.Params.Add;
zspKred.Params[3].Name:='MoneyTime';
zspKred.Params[3].DataType:=ftInteger;
zspKred.Params[3].ParamType:=ptOutput;
zspKred.Params.Add;
zspKred.Params[4].Name:='rErr';
zspKred.Params[4].DataType:=ftString;
zspKred.Params[4].ParamType:=ptOutput;
zspKred.StoredProcName:='GetLimit';
zspKred.Connection:=OraTestMainForm.OraConn;
zspKred.ParamByName('CustCode').AsString:='013137';
zspKred.ParamByName('PlaceCode').AsString:='WA';
zspKred.ParamCheck:=true;
Here comes execution and independent of the call there is the same error:
'Unsupported operation'
zspKred.ExecProc;
zspKred.Open;
SQL log (TZSQLMonitor) is in this moment empty but it's clear.
I am sure that I am doing something wrong, but what?
Thak you in advance for help.
Regards
Mariusz