Problem with TSQLStoredProc in Delphi xe

Problem with TSQLStoredProc in Delphi xe

Postby einarst » Fri 10 Dec 2010 10:01

Hi.
I have a problem with TSQLStoredProc .
I am using Oracle 10g, windows 7, Delphi XE and dbExpress 4.7.23
if I execute procedure in oracle database with Boolean parameter then Delphi throw an error
“dbExpress driver does not support TDBXType.BOOL Data type. Vendor error message: ORA-01403: no data found”
If I execute procedure with Boolean out parameter then I get this errors
“ORA-01403: no Data found”
If use number as parameter in procedure then I get this error
“Ora-06502: PL/SQL: numeric or value error: Character to number conversion error Ora-0612: at line 1.”
It is ok to use number as out parameter in procedure.

Thank you Einar
einarst
 
Posts: 7
Joined: Tue 01 Feb 2005 10:28

Problem solve

Postby einarst » Fri 10 Dec 2010 11:50

Wrong driver

Thanks Einar
einarst
 
Posts: 7
Joined: Tue 01 Feb 2005 10:28

Postby bork » Wed 15 Dec 2010 12:50

Hello

Please select the "DevartOracle" driver in your SQLConnection and check the following code:
Code: Select all
begin
  SQLConnection1.Execute('CREATE OR REPLACE PROCEDURE proc_test_bool (in_param IN BOOLEAN, out_param OUT BOOLEAN) ' + #13 +
                         'AS ' + #13 +
                         'BEGIN ' + #13 +
                         '  out_param := in_param; ' + #13 +
                         'END;', nil);

  SQLStoredProc1.SQLConnection := SQLConnection1;
  SQLStoredProc1.StoredProcName := 'proc_test_bool';

  SQLStoredProc1.ParamByName('IN_PARAM').Value := true;
  SQLStoredProc1.ExecProc;
  ShowMessage(VarToStr(SQLStoredProc1.ParamByName('OUT_PARAM').Value));

  SQLStoredProc1.ParamByName('IN_PARAM').Value := false;
  SQLStoredProc1.ExecProc;
  ShowMessage(VarToStr(SQLStoredProc1.ParamByName('OUT_PARAM').Value));
end;

It works correctly with the BOOLEN Oracle data type.
bork
Devart Team
 
Posts: 643
Joined: Fri 12 Mar 2010 07:55


Return to dbExpress driver for Oracle