Using PL/SQL Table in DBMS_SQL.PARSE - Immediate
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Using PL/SQL Table in DBMS_SQL.PARSE - Immediate

  1. #1
    Join Date
    Apr 2001
    Posts
    19
    TYPE la IS TABLE OF VARCHAR2(128)
    INDEX BY BINARY_INTEGER;
    lvar_cre la;

    arr := 10

    DBMS_SQL.PARSE(cur2,lvar_cre,1,arr,FALSE,DBMS_SQL.NATIVE);

    Error:
    79/4 PLS-00306: wrong number or types of arguments in call to 'PARSE'
    79/4 PL/SQL: Statement ignored

    Note:
    lvar_cre contains a CREATE TABLE DDL

    thanks

  2. #2
    Join Date
    Apr 2001
    Location
    UK
    Posts
    137
    I have no idea what you're trying to do here. Why are you passing a PL/SQL table to dbms_sql.parse ? A PL/SQL table is not a table that you create in the database - it's more like an array. It has no meaning to PARSE at all.

    The syntax for parse is:

    DBMS_SQL.PARSE (
    c IN INTEGER,
    statement IN VARCHAR2,
    language_flag IN INTEGER);

    You have 6 parameters rather than 3 so it's not surprising that it complains.

    If you want to create a table all you would do is:

    declare
    stmt varchar2(500) := 'create table xxx (x varchar2(5))';
    c number;
    begin
    c := dbms_sql.open_cursor;
    dbms_sql.parse(c, stmt, dbms_sql.native);
    end;

    or even easier:

    execute immediate 'create table xxx (x varchar2(5))';

  3. #3
    Join Date
    Sep 2001
    Posts
    15
    Hi steenie!

    You should use DBMS_SQL.varchar2s type:
    lvar_cre DBMS_SQL.varchar2s;


    DBMS_SQL.PARSE (
    c IN INTEGER,
    statement IN VARCHAR2S,
    lb IN INTEGER,
    ub IN INTEGER,
    lfflg IN BOOLEAN,
    language_flag IN INTEGER);

    Victor
    www.dynamicpsp.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width