Print Thread
FAQ: Calling stored procedures with record type parameters
#6 09/04/99 07:27 PM
Joined: Sep 1999
Posts: 21
F
faq Offline OP
Member
OP Offline
Member
F
Joined: Sep 1999
Posts: 21
I have a function with a record type parameter, but I can't figure out how to call it. Is this possible?

Re: FAQ: Calling stored procedures with record type parameters
#7 09/04/99 07:28 PM
Joined: Sep 1999
Posts: 22
S
Administrator
Offline
Administrator
S
Joined: Sep 1999
Posts: 22
This is not directly possible. Direct Oracle Access does not have record type variables, because Oracle does not publish information about this feature. One work around is to create a small PL/SQL block that has only input and/or output variables of a scalar data type, that are converted to/from a locally define record variable that is passed to the procedure:

[quote]
Code
declare
  dr dept%rowtype;
begin
  -- Copy from scalar variables if the record is an input parameter
  dr.deptno := :deptno;
  dr.dname := :dname;
  dr.loc := :loc;
  -- Call the procedure with the local record
  myproc(dr);
  -- Copy to scalar variables if the record is an output parameter
  :deptno := dr.deptno;
  :dname := dr.dname;
  :loc := dr.loc;
end;
[/quote]


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.027s Queries: 14 (0.006s) Memory: 2.4945 MB (Peak: 3.0376 MB) Data Comp: Off Server Time: 2024-03-29 11:37:08 UTC
Valid HTML 5 and Valid CSS