Using a utl_file.file_type as a procedure argument

Hi,
I'm trying to pass a utl_file.file_type variable defined in Proc A to ProcB as fllows:
Proc A:
output_file utl_file.file_type;
output_file := utl_file.fopen('E:\tmp\', 'traspas_merma.log', 'W');
call ProcB(output_file);
Proc B:
Procedure ProcB(filestr IN utl_file.file_type) IS
BEGIN
utl_file.put_line(filestr, str);
END;
When I compile I obtain the following error:
PLS-00363 Expression 'FILE' can be used as a destination assignment
So, whoy should I define the ProcB spec?
Thanks

Here is a code snippet that works:
declare
   procedure procb (filestr in utl_file.file_type)
   is
   begin
      utl_file.put_line (filestr, 'Some Text');
   end procb;
   procedure a
   as
      output_file   utl_file.file_type;
   begin
      output_file := utl_file.fopen ('TEMP', 'traspas_merma.log', 'W');
      procb (output_file);
   end a;
begin
   a ();
end;
/Note the usage of a (valid) directory object instead of a directory path!

Similar Messages

  • Write error while using the UTL_FILE.FILE_TYPE

    i get an exception 'ORA-06125 - write error' when trying to write to a flat file using utl_file.put_line function. The hint which i got out of trial and error was this 'write error' exception came out when the total character size exceeded 725-730 characters. I don't know if that is the real problem.. but when the character count is less than this.. it writes without any problem..
    Thanks in advance!!
    PK

    Try setting max_linesize in FOPEN function, for example
    p_file := utl_file.fopen( p_dir, p_filename, 'w', 4000 );
    maximum value is 32767. The default is approximately 1000 bytes.

  • Use of UTL_FILE

    Hi,
    What is an advantage of UTL_FILE. I practiced following code but it didn't compiled. Could you please guide me use UTL_FILE. please check the following code.
    warm Regards,
    Venkat.
    Practice code:
    declare
    v_filehandle UTL_FILE.File_type;
    begin
    v_filehandle:=UTL_FILE.fOPEN('/tmp/','utl_file.txt','w');
    UTL_FILE.PUT_LINE(v_filehandle,'This is line 1');
    for v_counter in 2..11 loop
    UTL_FILE.PUTF(v_filehandle,'This is line %s!\n',v_counter);
    end loop;
    UTL_FILE.fCLOSE(v_filehandle);
    end;
    /

    SQL> create directory dir1 as 'c:\temp';
    Directory created.       
    SQL> declare
      2   fp utl_file.file_type;
      3   str varchar2(100);
      4  begin
      5   fp := utl_file.fopen('DIR1','a.txt','r');
      6   loop
      7    utl_file.get_line(fp,str);
      8    dbms_output.put_line(str);
      9   end loop;
    10  exception
    11   when no_data_found then
    12   dbms_output.put_line('--------'||chr(10)||'Reading Completed');
    13   utl_file.fclose(fp);
    14  end;
    15  /
    Hai Venkata..
    Bye..
    Reading Completed
    PL/SQL procedure successfully completed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use OUT variables in my stored procedure

    I'm wondering if I can get some help using OUT variables in my stored procedure. Here's my code...
    CREATE OR REPLACE PROCEDURE testProj.testProcedure (
         v_segment_id IN VARCHAR2,
         v_student_id OUT VARCHAR2,
         v_current_code OUT NUMBER,
         v_new_code OUT NUMBER
    ) AS
    BEGIN
         SELECT
              s.student_id,
              s.quad_code_id,
              nc.quad_code_id
         INTO
              v_student_id,
              v_current_quad_code,
              v_new_quad_code
         FROM testProj.students s
         INNER JOIN testProj.new_codes nc ON s.student_id = nc.student_id
         WHERE s.segment_id = v_segment_id ;
    END testProcedure ;
    EXECUTE testProj.testProcedure ('44') ;
    When I execute that stored procedure with the above execute statement, I get this error:
    Error report:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'testProcedure'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    +06550. 00000 - "line %s, column %s:\n%s"+
    *Cause:    Usually a PL/SQL compilation error.+
    *Action:+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Using Refcursor is one way you can do that ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.21
    satyaki>
    satyaki>
    satyaki>create or replace procedure r_arg(
      2                                      choice in number,
      3                                      b in out sys_refcursor
      4                                   )
      5  is  
      6    str   varchar2(500);
      7  begin   
      8     str := 'select * from emp';   
      9     open b for str;
    10  exception  
    11    when others then     
    12      dbms_output.put_line(sqlerrm);
    13  end;
    14  /
    Procedure created.
    Elapsed: 00:00:01.84
    satyaki>
    satyaki>
    satyaki>declare   
      2    rec_x emp%rowtype;   
      3    w sys_refcursor;
      4  begin  
      5    dbms_output.enable(1000000);  
      6    r_arg(1,w);  
      7    loop    
      8      fetch w into rec_x;     
      9        exit when w%notfound;             
    10        dbms_output.put_line('Employee No: '||rec_x.empno||' - '||                          
    11                             'Name: '||rec_x.ename||' - '||                          
    12                             'Job: '||rec_x.job||' - '||                          
    13                             'Manager: '||rec_x.mgr||' - '||                          
    14                             'Joining Date: '||rec_x.hiredate||' - '||                          
    15                             'Salary: '||rec_x.sal||' - '||                          
    16                             'Commission: '||rec_x.comm||' - '||                          
    17                             'Department No: '||rec_x.deptno);  
    18     end loop;  
    19     close w;    
    20  exception  
    21    when others then    
    22       dbms_output.put_line(sqlerrm);
    23  end;
    24  /
    Employee No: 9999 - Name: SATYAKI - Job: SLS - Manager: 7698 - Joining Date: 02-NOV-08 - Salary: 55000 - Commission: 3455 - Department No: 10
    Employee No: 7777 - Name: SOURAV - Job: SLS - Manager:  - Joining Date: 14-SEP-08 - Salary: 45000 - Commission: 3400 - Department No: 10
    Employee No: 7521 - Name: WARD - Job: SALESMAN - Manager: 7698 - Joining Date: 22-FEB-81 - Salary: 1250 - Commission: 500 - Department No: 30
    Employee No: 7566 - Name: JONES - Job: MANAGER - Manager: 7839 - Joining Date: 02-APR-81 - Salary: 2975 - Commission:  - Department No: 20
    Employee No: 7654 - Name: MARTIN - Job: SALESMAN - Manager: 7698 - Joining Date: 28-SEP-81 - Salary: 1250 - Commission: 1400 - Department No: 30
    Employee No: 7698 - Name: BLAKE - Job: MANAGER - Manager: 7839 - Joining Date: 01-MAY-81 - Salary: 2850 - Commission:  - Department No: 30
    Employee No: 7782 - Name: CLARK - Job: MANAGER - Manager: 7839 - Joining Date: 09-JUN-81 - Salary: 4450 - Commission:  - Department No: 10
    Employee No: 7788 - Name: SCOTT - Job: ANALYST - Manager: 7566 - Joining Date: 19-APR-87 - Salary: 3000 - Commission:  - Department No: 20
    Employee No: 7839 - Name: KING - Job: PRESIDENT - Manager:  - Joining Date: 17-NOV-81 - Salary: 7000 - Commission:  - Department No: 10
    Employee No: 7844 - Name: TURNER - Job: SALESMAN - Manager: 7698 - Joining Date: 08-SEP-81 - Salary: 1500 - Commission: 0 - Department No: 30
    Employee No: 7876 - Name: ADAMS - Job: CLERK - Manager: 7788 - Joining Date: 23-MAY-87 - Salary: 1100 - Commission:  - Department No: 20
    Employee No: 7900 - Name: JAMES - Job: CLERK - Manager: 7698 - Joining Date: 03-DEC-81 - Salary: 950 - Commission:  - Department No: 30
    Employee No: 7902 - Name: FORD - Job: ANALYST - Manager: 7566 - Joining Date: 03-DEC-81 - Salary: 3000 - Commission:  - Department No: 20
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.48
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • Use of UTL_FILE package

    Hi,
    I am trying to use the following command:
    UTL_FILE.FOPEN('/HOME/SCMS/DUNNING/OUTPUT/','DUNNING_ACCT_YYYYMMDD.PSC','W');
    however i get an error invalid directory name.
    can anyone please advise how to assign the location as the name of a local directory eg....D:\xyz

    You need to use CREATE DIRECTORY statement to create a directory and use that name in fopen.
    SQL> CREATE DIRECTORY mydir AS '/appl/gl/log';
    SQL> GRANT READ ON DIRECTORY mydir TO DBA;
    DECLARE
      V1 VARCHAR2(32767);
      F1 UTL_FILE.FILE_TYPE;
    BEGIN
      -- In this example MAX_LINESIZE is less than GET_LINE's length request
      -- so the number of bytes returned will be 256 or less if a line terminator is seen.
      F1 := UTL_FILE.FOPEN('MYDIR','MYFILE','R',256);
      UTL_FILE.GET_LINE(F1,V1,32767);
      UTL_FILE.FCLOSE(F1);
      -- In this example, FOPEN's MAX_LINESIZE is NULL and defaults to 1024,
      -- so the number of bytes returned will be 1024 or less if a line terminator is seen.
      F1 := UTL_FILE.FOPEN('MYDIR','MYFILE','R');
      UTL_FILE.GET_LINE(F1,V1,32767);
      UTL_FILE.FCLOSE(F1);
      -- In this example, GET_LINE doesn't specify a number of bytes, so it defaults to
      -- the same value as FOPEN's MAX_LINESIZE which is NULL in this case and defaults to 1024.
      -- So the number of bytes returned will be 1024 or less if a line terminator is seen.
      F1 := UTL_FILE.FOPEN('MYDIR','MYFILE','R');
      UTL_FILE.GET_LINE(F1,V1);
      UTL_FILE.FCLOSE(F1);
    END; This is an example from Oracle docs. You better go through that first.
    Cheers
    Sarma.

  • Package variables vs procedure arguments

    Is it better to use package-level variables inside package or to use procedure arguments?
    I'm just asking because I have a bunch of parameters for each procedure (all of them are private, and are only called from within the package).
    Is better this:
    package a
    is
    --package variable
    v_something my_table%rowtype;
    procedure a
    is
    --do something with v_something
    end;
    procedure b
    is
    select * into v_something
    from my_table
    where rownum=1;
    --call it without parameters
    a;
    end;
    end;
    or this:
    package a
    is
    procedure a(inSomething my_table%rowtype)
    is
    --do something with v_something
    end;
    procedure b
    v_something my_table%rowtype;
    is
    select * into v_something
    from my_table
    where rownum=1;
    --call it with parameters
    a(v_something);
    end;
    end;

    Please post between the tags
    ..... and {code }
    If you have multiple procedures updating and reusing the package variable you loose track of what value you have in the package variable.
    And it depends what you are trying to do.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Use of global temporary tables in Procedures

    Hi
    I am using global temporary tables in the procedures. Loading data in the same table through many procedures. I am fetching the data from the global temporary table in PRO-C by a cursor. Will this degrade performance?
    Please help me..
    Thanks in Advance...

    Will this degrade performance?That depends... in comparison to what?
    Loading data into temporary tables will generally be more efficient than loading data into permanent tables because Oracle needs to do less to protect this data since it is inherently transient. On the other hand, loading the data into a table in the first place tends to be more expensive than alternatives like using a single SQL statement, a pipelined table function, or an in memory collection.
    Justin

  • Using code of odisqlunload in a procedure...

    hi...
    I m using code for ODISQLUNLOAD in a procedure....
    code is :
    Command on target:
    OdiSqlUnload "-FILE=" "-DRIVER=<%=odiRef.getInfo("SRC_JAVA_DRIVER")%>" "-URL=<%=odiRef.getInfo("SRC_JAVA_URL")%>" "-USER=<%=odiRef.getInfo("SRC_USER_NAME")%>" "-PASS=<%=odiRef.getInfo("SRC_ENCODED_PASS")%>" "-FILE_FORMAT=FIXED" "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1"
    "-FETCH_SIZE=5000"
    "select 1 from dual "
    but when i execute it ..it gives me error saying : invalid SQL statement
    I tried
    select 1 from dual...etc but error remains the same....
    my target technology is file......
    where i m going wrong??

    Hi,
    You cant select FILE as target technology when u are using ODI Tools. You need to select ODI Tools ( in 11g) or Sunopsis API (in 10g) as such.
    So i assume ur requirement is to export data from RDBMS table "dynamically" using Odi tools.
    If my understanding is right. Do the below steps to achieve the same.
    1. In the procedure, create an OPTION, lets say, UNLOAD_DIR, Type- Value, Description- Unload Directory, Default Value- D:\SampleData (here u need to mention ur directory, in case if you changed ur directory in future u can only need to change the code here).
    2. Create a new step in Procedure and add the below code in Command on Target, selecting ODI TOOLS or SUOPSIS API as technology,
    OdiSqlUnload "-FILE=<%=snpRef.getOption("UNLOAD_DIR")%>\<%=snpRef.getSession("SESS_NO")%>.txt" "-DRIVER=<%=odiRef.getInfo("SRC_JAVA_DRIVER")%>" "-URL=<%=odiRef.getInfo("SRC_JAVA_URL")%>" "-USER=<%=odiRef.getInfo("SRC_USER_NAME")%>" "-PASS=<%=odiRef.getInfo("SRC_ENCODED_PASS")%>" "-FILE_FORMAT=VARIABLE" "-ROW_SEP=\r\n" "-DATE_FORMAT=yyyy/MM/dd HH:mm:ss" "-CHARSET_ENCODING=ISO8859_1" "-XML_CHARSET_ENCODING=ISO-8859-1"
    select sysdate from dual
    Command on source:
    Technology- Oracle
    Logical Schema- Whichever points to Oracle
    Context- Global/Whichever points to the above logical schema.
    Output:
    In D:\SampleData, u may find a file name with the session number and value as sysdate.
    Makes sense?
    Thanks,
    Guru

  • How to use directory alias in Java stored procedure ?

    hi everyone !
    I want use Directory alias in Java strored procedure
    I 'hv created dir alias as
    Create Directory BFILE_DIR AS 'C:\MyImages'
    my java statements -
    myfile="C:\MyImages\myPH01.jpg"
    File binaryFile = new File(myFile);
    instead of giving absolute path I want give directory alias BFILE_DIR
    myfile= BFILE_DIR + "myPH01.jpg"
    File binaryFile = new File(myFile);
    can anyone pl suugest how should I write this in Java procedure
    thanks
    SPD

    hi everyone !
    I want use Directory alias in Java strored procedure
    I 'hv created dir alias as
    Create Directory BFILE_DIR AS 'C:\MyImages'
    my java statements -
    myfile="C:\MyImages\myPH01.jpg"
    File binaryFile = new File(myFile);
    instead of giving absolute path I want give directory alias BFILE_DIR
    myfile= BFILE_DIR + "myPH01.jpg"
    File binaryFile = new File(myFile);
    can anyone pl suugest how should I write this in Java procedure
    thanks
    SPD

  • Using ALTER SESSION inside a stored procedure.... not a good idea?

    Hi,
    I have two stored procedures, both of which are used to query a database to find a particular book, based on ISBN. One sproc searches our main product catalogue and the other searches our suppliers feed catalogues. The stored procedures are called from a C# application via a search tool and the user is able to search on either our catalogue or our suppliers. The appropriate procedure is called based on the users choices.
    However, the following behaviour is observed
    I search for an ISBN (is a varchar2 field, as isbn's may contain an X if the checksum digit equates to 10) on a feed, so uses the FEED SPROC. The book is found and returned to the app in about 0.5 seconds. I can repeat this as often as i like on different books etc. always works fine.
    I then do the same search but against our own catalogue, so uses our CATALOGUE SPROC. Again the book is found quickly, and the search can be repeated with the same results.
    If i then go back and run our FEED SPROC then the search time increases to about 3 minutes !
    Both the feed and our catalogue is in the same database, although different schema's the connections will be pooled through our app server.
    I can repliacte this every single time. I think i have narrowed doen the cause of this behaviour to a few lines of code in our CATALOGUE SPROC:
    -- store values
    select value into v_vch_NLS_COMP from nls_session_parameters nsp where nsp.parameter = 'NLS_COMP';
    select value into v_vch_NLS_SORT from nls_session_parameters nsp where nsp.parameter = 'NLS_SORT';
    -- Ensure case insensitivity throughout
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = LINGUISTIC';
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = BINARY_CI';
    do other stuff
    -- restore session variables
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_COMP = ' || v_vch_NLS_COMP;
    EXECUTE IMMEDIATE 'ALTER SESSION SET NLS_SORT = ' || v_vch_NLS_SORT;
    If i remove this code then all is well, so i am assuming that using ALTER SESSION inside a stored procedure is the cause of the problem as it would be changing the execution plan of the FEEDS SPROC in some manner? Any ideas? I know i can just rewrite the sproc to avoid using this coding, but wanted to understand if i am doing something wrong by using ALTER SESSION in this manner?
    Any pointers would be appreciated.
    John Thompson
    Software Architect,
    play.com
    Edited by: user7186902 on 27-May-2009 03:51

    Hello (and welcome),
    It may be a case of having to create a linguistic index to facilitate the queries once you set these session level parameters, i.e..,
    CREATE INDEX idx_01 ON tab ((NLSSORT(col1, 'NLS_SORT=BINARY_CI'))It would appear that the setting of those parameters is invalidating index searching on the current indexes.

  • Use of subtotal field in pricing procedure?

    Hi Gurus,
    what is the use of subtotal field in pricing procedure?
    thanks..

    Hi,
    Please see the note 1022966   FAQ for the 'Subto' column (KZWIW) in the pricing procedure.           
    Subtotals (net price, effective price) are created in the case of time-independent conditions.
    SAP recommends working with time-dependent conditions for quotations and scheduling agreements.
    For time-dependent conditions (for example, price maintained in contract    
    and scheduling agreement), supplementary pricing schema is used. Reason     
    is that when condition maintenance is called for contracts and schedule     
    agreements, system refers to supplementary pricing procedure for            
    calculating subtotals.
    Regards,
    Edit

  • Using 2 refcursors within the same procedure

    Hi,
    Can we use 2 refcursors within the same procedure. This might sound strange. But I have a scenario of doing so- one for dynamically checking for some validations and another for returning a result set.

    Yes, go thru the below example.
    CREATE OR REPLACE PACKAGE CURSPKG AS
    TYPE T_CURSOR IS REF CURSOR;
    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
    DEPTCURSOR OUT T_CURSOR);
    END CURSPKG;
    CREATE OR REPLACE PACKAGE BODY CURSPKG AS
    PROCEDURE OPEN_TWO_CURSORS (EMPCURSOR OUT T_CURSOR,
    DEPTCURSOR OUT T_CURSOR)
    IS
    V_CURSOR1 T_CURSOR;
    V_CURSOR2 T_CURSOR;
    BEGIN
    OPEN V_CURSOR1 FOR SELECT * FROM EMP;
    OPEN V_CURSOR2 FOR SELECT * FROM DEPT;
    EMPCURSOR := V_CURSOR1;
    DEPTCURSOR := V_CURSOR2;
    END OPEN_TWO_CURSORS;
    END CURSPKG;
    I hope it would be helpful.

  • I have an iphone 4 with videos on it that I'd like to transfer to an IMac so that I can email them.  (the iphone isn't in use anymore.)  What's the procedure for transfering videos from an iphone to an iMac?

    I have an iphone 4 with videos on it that I'd like to transfer to an IMac so that I can email them.  (the iphone isn't in use anymore.)  What's the procedure for transfering videos from an iphone to an iMac?

    Connect the iPhone to your Mac with its USB cable and launch iPhoto.  In iPhoto you can select which files to upload into the library.  Once in the library export them out of iPhoto to a folder on the Desktop via File ➙ Export ➙ File Export  with Kind=Original. That will give you copies of the videos in the folder for use outside of iPhoto.
    If you want to bypass importing into iPhoto try launching Image Capture and manually upload the selected video files to the folder of your choice.
    OT

  • Using Directory alias in Java stored procedure

    hi !!
    I want use Directory alias in Java strored procedure
    I 'hv created dir alias as
    Create Directory BFILE_DIR AS 'C:\MyImages'
    my java statements -
    myfile="C:\MyImages\myPH01.jpg"
    File binaryFile = new File(myFile);
    instead of giving absolute path I want give directory alias BFILE_DIR
    myfile= BFILE_DIR + "myPH01.jpg"
    can anyone pl suugest how should I write this in Java procedure
    thanks
    SPD

    Hi there i am currently trying to develope a java
    stored procedure and place it in oracle and will try
    to use that procedure to send a message to a server
    but then it doesnt seems to work. is it possible?And what do you do with exceptions in your java proc?
    I haven't ever done it myself, but I would be very surprised if it wasn't possible. I also wouldn't be surprised to find out that you have to configure various things to allow it in Oracle itself.

  • How to use Execute Immediate to execute a procedure and return a cursor?

    The procedure name is unknown until run time so I have to use Execute immediate to execute the procedure, the procedure return a cursor, but I can't figure out the right syntax to pass the cursor out.
    To simplify the issue here, I create two procedures as examples.Assume I have a procedure called XDTest:
         p_cur OUT SYS_REFCURSOR
    IS
    BEGIN
    OPEN p_cur FOR
    Select * from dummy_table;
    END XDTest;
    In another procedure, I want to use Execute Immediate to execute XDTest and obtain the result that return from the cursor into a local cursor so I can process the records:
         p_cur OUT SYS_REFCURSOR
    IS
    l_cur SYS_REFCURSOR;
    BEGIN
    execute immediate 'BEGIN XDTest (:1); END;' using OUT l_cur;
    END XDTest2;
    However, this is not working, I get ORA-03113: end-of-file on communication channel error.
    What syntax should I use here?
    Cheers

    well...
    I update the XDTest2 procedure as below but when execute it get exceptions.I think the v_sqlstmt syntax is wrong, but I don't know what meant to be correct, please give some suggestions .
    Cheers
    -------------------- XDTest procedure --------------------------------------------------
         p_cur OUT SYS_REFCURSOR
    --AUTHID CURRENT_USER
    IS
    BEGIN
    OPEN p_cur FOR
    Select Table_Name from USER_Tables;
    END XDTest;
    -------------------- XDTest2 procedure --------------------------------------------------
         p_cur OUT SYS_REFCURSOR
    IS
    TYPE T1 IS TABLE OF VARCHAR2(4000) INDEX BY BINARY_INTEGER ;
    v_sqlstmt varchar2(1000):=null;
    v_cursor number;
    x_num number;
    LN$Lig number := 0 ;
    LN$MaxCol number := 0 ;
    t T1 ;
    v VARCHAR2(4000) ;
    userTb User_Tables%ROWTYPE;
    l_cur number;
    BEGIN
    LN$Lig := 0 ;
    LN$MaxCol := 1 ;
    --OPEN p_cur FOR
    --execute immediate 'BEGIN XDTest (:1); END;' using OUT l_cur;
    v_cursor:=dbms_sql.open_cursor;
    v_sqlstmt:='begin :p_cur:="XDTest"(); END; ';
    dbms_sql.parse(v_cursor,v_sqlstmt,DBMS_SQL.NATIVE);
    dbms_sql.bind_variable(v_cursor,':p_cur',l_cur);
    dbms_output.put_line('1');
    -- Define the columns --
    dbms_sql.DEFINE_COLUMN(v_cursor, 1, userTb.Table_Name, 30);
    x_num:=dbms_sql.execute(v_cursor);
    dbms_output.put_line('2');
    -- Fetch the rows from the source query --
    LOOP
    IF dbms_sql.FETCH_ROWS(v_cursor)>0 THEN
    -- get column values of the row --
    dbms_sql.COLUMN_VALUE(v_cursor, 1,userTb.Table_Name);
    dbms_output.put_line(userTb.Table_Name);
    ELSE
    -- No more rows --
    EXIT;
    END IF;
    END LOOP;
    dbms_sql.close_cursor(v_cursor);
    END XDTest2;
    ---------------------- Error when execute ------------------------------------------------
    1
    BEGIN DevD0DB.XDTest2(:l_cur); END;
    ERROR at line 1:
    ORA-01007: variable not in select list
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1010
    ORA-06512: at "SYS.DBMS_SQL", line 212
    ORA-06512: at "DEVD0DB.XDTEST2", line 35
    ORA-06512: at line 1
    ----------------------------------------------------------------------------------------------------

Maybe you are looking for

  • CREATE TABLE AS using WITH

    I am converting a PostreSQL query to T-SQL but am running into a syntax error that I cannot understand. My main query below works fine. WITH itowner AS (         SELECT itowner_1.comp1id AS businessserviceid,             person.name AS itowner_name,

  • Looking for Function module through which I can get Logged comments

    Hi, I am new to CRM. On an activity task we have 'Logged comments' section. I am looking for FM that I could use to import 'Logged comments' for an activity task. I guess that I can use CRM_ORDER_READ. I was trying to find some documentation but did

  • Ipad synchronisation error

    When I synchronise my Ipad (frimware 4.3.1) using Itunes (version 10) I got the following error message "Itunes cannot do the backup of the Ipad; an error occurs" Nerverless the synchronisation is going well; What can I do? Many thanks Dominique DAUL

  • Sync to 2 desktops

    I have a user with a desktop at home, and a desktop at the office, Imap mail, using Outlook 2003. At home they use Outlook to change tasks, etc, then sync to blackberry. One the way make changes on the BB. At work they sync, then spend the day making

  • My Apple TV will not mirror my iMac screen after upgrading to Yosemite?

    Ok, I can stream music and movies from my iTunes library. However, My apple tv will not mirror my iMac screen. When I turn on the Airplay Display, my television screen goes blank. I bought the apple TV maybe 5 months ago, so it's a relatively new ver