Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: TOCIStoredProc and Table%RowType record param
TOCIStoredProc and Table%RowType record param
Posted: 2000/09/04 08:42
 
Hi Dmitry !

I am trying to use TOCIStoredProc for stored proc that returns Table%RowType
(table is ZUPA):

create or replace procedure Proba(XID_ZUPA in NUMBER, ZUPA_RED out ZUPA%ROWTYPE) is
begin
SELECT * INTO ZUPA_RED FROM ZUPA WHERE ID_ZUPA=XID_ZUPA;
end Proba;

Prepare makes all params in form ZUPA_RED$NAZIV_ZUPA ,
param types are ok, but on execute I get the error :
ORA-06550: line 2, column 4:
PLS-00103: Encoutered the symbol "." when expecting one of ...
NCOCI creates block
declare v0 .; --<--ERROR
begin
PROBA(ID_ZUPA, v0);
:ZUPA_RED$ID_ZUPA := v0.ID_ZUPA;
:ZUPA_RED$ID_DRZAVA := v0.ID_DRZAVA;
:ZUPA_RED$SIF_ZUPA := v0.SIF_ZUPA;
...
end;
RE: TOCIStoredProc and Table%RowType record param
Posted: 2000/09/04 12:08
 
Hi Goran !

TOCIStoredProc generates wrong PL/SQL block, when parameter have unnamed RECORD type, like MyTable%ROWTYPE. That is because OCI limitation. So, in next version NCOCI8 will detect such parameters and raise exception about that. There are workarounds:

- most right way. Use named types, like:
create or replace package MyPack is
type TMyRec is record (
F1 NUMBER,
F2 DATE,
....
);
end;

- as allways you can use TOCIQuery.

Probably later i will find solution for this issue.