| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem with DBMS_SQL.PARSE when called from Repots2.5
Adam Tadj <vahidt_at_vahidtpc.vitek.com> wrote in article
<5eg7uc$7hj$1_at_newsin-1.starnet.net>...
> I am trying to run the following PL/SQL code from the Reports2.5 :
> 
> ===================================================
> function BeforeReport return boolean is
> ...
> ...
>   cursor_handle INTEGER;
>   exec_var INTEGER;
> ...
> begin
> ..
>  cursor_handle := DBMS_SQL.OPEN_CURSOR;
>   DBMS_SQL.PARSE
>     (cursor_handle, 'SELECT 2+2 from DUAL' , DBMS_SQL.V7); 
>                            
>   exec_var := DBMS_SQL.EXECUTE (cursor_handle); 
>   DBMS_SQL.CLOSE_CURSOR(cursor_handle);
> ..
>   return (TRUE);
> end;
> ==================================================
> and I am getting the following error message:
> "component V7 must be declare".
> (cursor stops at DBMS_SQL.V7 as marked "^^^") and fails to compile.  
>                                             ^^^
> But when I compile/run a very similar code from Procedure Builder or
> SQL>  prompt it works just fine.  Any remedies or hints?
> 
> Thanks,
> Adam Tadj.
> 
> 
This problems you can see in all apllication Developer/2000
PL/Sql version 1.x can't see package variables.
You can make this procedure on server part and call from report or using
litteral
 function BeforeReport return boolean is
 ...
 ...
   cursor_handle INTEGER;
   exec_var INTEGER;
 ...
 begin
 ..
  cursor_handle := DBMS_SQL.OPEN_CURSOR;
   DBMS_SQL.PARSE
     (cursor_handle, 'SELECT 2+2 from DUAL' ,2/* DBMS_SQL.V7*/); 
                            
   exec_var := DBMS_SQL.EXECUTE (cursor_handle); 
   DBMS_SQL.CLOSE_CURSOR(cursor_handle);
 ..
   return (TRUE);
 end;
Received on Thu Feb 20 1997 - 00:00:00 CST
|  |  |