Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should say something more specific than "does not seem to work". But the first thing I see wrong with your sample is that you are confusing SQLPlus and PL/SQL.</p> <p>I'm assuming your typing the commands, or running them as a script, in SQLPlus.</p> <p>"DECLARE" begins a PL/SQL block, which won't be executed until a forward slash is entered on a new line. So if you are typing these commands in interactively, it is probably just prompting you for more input:</p> <pre><code>SQL&gt; declare VARIABLE csr1 REFCURSOR; 2 declare VARIABLE csr2 REFCURSOR; 3 declare VARIABLE csr3 REFCURSOR; 4 declare VARIABLE csr4 REFCURSOR; 5 declare VARIABLE csr5 REFCURSOR; 6 EXEC getReportData('PUB',:csr1,:csr2,:csr3,:csr4,:csr5); 7 PRINT csr1; 8 / SP2-0552: Bind variable "CSR5" not declared. SQL&gt; </code></pre> <p>The other commands you are trying to use are SQLPlus commands. The VARIABLE command declares a bind variable in SQLPlus -- it doesn't involve a DECLARE keyword at all. So you should try this:</p> <pre><code>VARIABLE csr1 REFCURSOR; VARIABLE csr2 REFCURSOR; VARIABLE csr3 REFCURSOR; VARIABLE csr4 REFCURSOR; VARIABLE csr5 REFCURSOR; EXEC getReportData('PUB',:csr1,:csr2,:csr3,:csr4,:csr5); PRINT csr1; </code></pre> <p>I don't really understand the point of the rest of your question. A %ROWTYPE declaration doesn't mean that the record must be populated directly from the given table, just that its fields and their types matches those of a row from the table. These fields can be referenced and assigned just like any other variables.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload