Using extend option with PL/SQL table of tables

Hi,
I have a PL/SQL table of tables sructure on which I want to use extend option available with PL/SQL tables.
But I am not able to do so. Could anyone help?
Below is sample code given.
Type RA_TABLE is table of CALL_DETAIL_EXCEPTION.IC_CIRCT_GR_CD%TYPE;
TYPE tab_of_RA_TABLE IS TABLE OF RA_TABLE;
for idx in 1..cnt_interval Loop
query1:='select Trunk_info from dbl.vw_cgi v where not exists (select 1 from dbl.varun f
where f.ic_circt_gr_cd= v.TRUNK_INFO and f.call_gmt_dnect_dt_time between
to_date('''||stime||''',''yyyymmddhh24miss'') and to_date('''||etime||''',''yyyymmddhh24miss''))';
execute immediate query1 bulk collect into Outer_table(idx);
ra_cnt_1:= Outer_table(idx).count;
diff:= max_cnt-RA_CNT_1;
dbms_output.put_line('idx: '||idx);
dbms_output.put_line('diff: '||diff);
if diff>=1 then
Outer_table(idx).extend( Diff);
end if;
end loop;
The extend doesnt work.
Please help!!

Hi,
I have a PL/SQL table of tables sructure on which I want to use extend option available with PL/SQL tables.
But I am not able to do so. Could anyone help?
Below is sample code given.
Type RA_TABLE is table of CALL_DETAIL_EXCEPTION.IC_CIRCT_GR_CD%TYPE;
TYPE tab_of_RA_TABLE IS TABLE OF RA_TABLE;
for idx in 1..cnt_interval Loop
query1:='select Trunk_info from dbl.vw_cgi v where not exists (select 1 from dbl.varun f
where f.ic_circt_gr_cd= v.TRUNK_INFO and f.call_gmt_dnect_dt_time between
to_date('''||stime||''',''yyyymmddhh24miss'') and to_date('''||etime||''',''yyyymmddhh24miss''))';
execute immediate query1 bulk collect into Outer_table(idx);
ra_cnt_1:= Outer_table(idx).count;
diff:= max_cnt-RA_CNT_1;
dbms_output.put_line('idx: '||idx);
dbms_output.put_line('diff: '||diff);
if diff>=1 then
Outer_table(idx).extend( Diff);
end if;
end loop;
The extend doesnt work.
Please help!!

Similar Messages

  • How to Unpivot, Crosstab, or Pivot using Oracle 9i with PL/SQL?

    How to Unpivot, Crosstab, or Pivot using Oracle 9i with PL/SQL?
    Here is a fictional sample layout of the data I have from My_Source_Query:
    Customer | VIN | Year | Make | Odometer | ... followed by 350 more columns/fields
    123 | 321XYZ | 2012 | Honda | 1900 |
    123 | 432ABC | 2012 | Toyota | 2300 |
    456 | 999PDQ | 2000 | Ford | 45586 |
    876 | 888QWE | 2010 | Mercedes | 38332 |
    ... followed by up to 25 more rows of data from this query.
    The exact number of records returned by My_Source_Query is unknown ahead of time, but should be less than 25 even under extreme situations.
    Here is how I would like the data to be:
    Column1 |Column2 |Column3 |Column4 |Column5 |
    Customer | 123 | 123 | 456 | 876 |
    VIN | 321XYZ | 432ABC | 999PDQ | 888QWE |
    Year | 2012 | 2012 | 2000 | 2010 |
    Make | Honda | Toyota | Ford | Mercedes|
    Odometer | 1900 | 2300 | 45586 | 38332 |
    ... followed by 350 more rows with the names of the columns/fields from the My_Source_Query.
    From reading and trying many, many, many of the posting on this topic I understand that the unknown number or rows in My_Source_Query can be a problem and have considered working with one row at a time until each row has been converted to a column.
    If possible I'd like to find a way of doing this conversion from rows to columns using a query instead of scripts if that is possible. I am a novice at this so any help is welcome.
    This is a repost. I originally posted this question to the wrong forum. Sorry about that.

    The permission level that I have in the Oracle environment is 'read only'. This is also be the permission level of the users of the query I am trying to build.
    As requested, here is the 'create' SQL to build a simple table that has the type of data I am working with.
    My real select query will have more than 350 columns and the rows returned will be 25 rows of less, but for now I am prototyping with just seven columns that have the different data types noted in my sample data.
    NOTE: This SQL has been written and tested in MS Access since I do not have permission to create and populate a table in the Oracle environment and ODBC connections are not allowed.
    CREATE TABLE tbl_MyDataSource
    (Customer char(50),
    VIN char(50),
    Year char(50),
    Make char(50),
    Odometer long,
    InvDate date,
    Amount currency)
    Here is the 'insert into' to populate the tbl_MyDataSource table with four sample records.
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    SELECT "123", "321XYZ", "2012", "Honda", "1900", "2/15/2012", "987";
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    VALUES ("123", "432ABC", "2012", "Toyota", "2300", "1/10/2012", "6546");
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    VALUES ("456", "999PDQ", "2000", "Ford", "45586", "4/25/2002", "456");
    INSERT INTO tbl_MyDataSource ( Customer, VIN, [Year], Make, Odometer, InvDate, Amount )
    VALUES ("876", "888QWE", "2010", "Mercedes", "38332", "10/13/2010", "15973");
    Which should produce a table containing these columns with these values:
    tbl_MyDataSource:
    Customer     VIN     Year     Make     Odometer     InvDate          Amount
    123 | 321XYZ | 2012 | Honda      | 1900          | 2/15/2012     | 987.00
    123 | 432ABC | 2012 | Toyota | 2300 | 1/10/2012     | 6,546.00
    456 | 999PDQ | 2000 | Ford     | 45586          | 4/25/2002     | 456.00
    876 | 888QWE | 2010 | Mercedes | 38332          | 10/13/2010     | 15,973.00
    The desired result is to use Oracle 9i to convert the columns into rows using sql without using any scripts if possible.
    qsel_MyResults:
    Column1          Column2          Column3          Column4          Column5
    Customer | 123 | 123 | 456 | 876
    VIN | 321XYZ | 432ABC | 999PDQ | 888QWE
    Year | 2012 | 2012 | 2000 | 2010
    Make | Honda | Toyota | Ford | Mercedes
    Odometer | 1900 | 2300 | 45586 | 38332
    InvDate | 2/15/2012 | 1/10/2012 | 4/25/2002 | 10/13/2010
    Amount | 987.00 | 6,546.00 | 456.00 | 15,973.00
    The syntax in SQL is something I am not yet sure of.
    You said:
    >
    "Don't use the same name or alias for two different things. if you have a table called t, then don't use t as an alais for an in-line view. Pick a different name, like ordered_t, instead.">
    but I'm not clear on which part of the SQL you are suggesting I change. The code I posted is something I pieced together from some of the other postings and is not something I full understand the syntax of.
    Here is my latest (failed) attempt at this.
    select *
      from (select * from tbl_MyDataSource) t;
    with data as
    (select rownum rnum, t.* from (select * from t order by c1) ordered_t), -- changed 't' to 'ordered_t'
    rows_to_have as
    (select level rr from dual connect by level <= 7 -- number of columns in T
    select rnum,
           max(decode(rr, 1, c1)),
           max(decode(rr, 2, c2)),
           max(decode(rr, 3, c3)),
           max(decode(rr, 4, c3)),      
           max(decode(rr, 5, c3)),      
           max(decode(rr, 6, c3)),      
           max(decode(rr, 7, c3)),       
      from data, rows_to_have
    group by rnumIn the above code the "select * from tbl_MyDataSource" is a place holder for my select query which runs without error and has these exact number of fields and data types as order shown in the tbl_MyDataSource above.
    This code produces the error 'ORA-00936: missing expression'. The error appears to be starting with the 'with data as' line if I am reading my PL/Sql window correctly. Everything above that row runs without error.
    Thank you for your great patients and for sharing your considerable depth of knowledge. Any help is gratefully welcomed.

  • Using where condition with dynamic internal table

    Hi Friends.
    How to use where condition with dynamic internal table ?
    Regards,
    Amit Raut

    Hai Amit
    REPORT  ZDYNAMIC_SELECT                         .
    TABLES: VBAK.
    DATA: CONDITION TYPE STRING.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF ITAB.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    CONCATENATE 'VBELN' 'IN' 'S_VBELN.'
    INTO CONDITION SEPARATED BY SPACE.
    SELECT VBELN POSNR FROM VBAP INTO TABLE ITAB
    WHERE (CONDITION).
    LOOP AT ITAB.
    WRITE 'hello'.
    ENDLOOP.
    Thanks & Regards
    Sreenivasulu P

  • Procedures with PL/SQL tables.

    Hi,
    I want to write the procedures with pl/sql tables. Can we write
    if yes can you provide the example or hint. If a person helps me
    i will be great thank ful.
    thanks.
    null

    reddy (guest) wrote:
    : Hi,
    : I want to write the procedures with pl/sql tables. Can we write
    : if yes can you provide the example or hint. If a person helps
    me
    : i will be great thank ful.
    : thanks.
    check the following faq link -- it says not supported yet ...
    http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm
    null

  • HT1343 how to use the options with F10, F11, F11 for turning the sound up or down or mute?

    Hi, I'm Hannah. I'm using a Mac. Can you show me how to use the options with F10, F11, F12 for turning the sound up, or down or mute? Thank you very much

    Normally simply pressing them should do what you want, F10 to mute; F11 to decrease volume; F12 to increase volume. However, it's possible that you have a box ticked in Keyboard preferences which modifies the behaviour of the keys, requiring you to also hold down the Fn key (bottom left key on the keyboard) to enable the function.
    Check System Preferences>Keyboard to makes sure the box indicated in the image isn't ticked.

  • Can I use Reports Server Queue PL/SQL Table API to retrieve past jobs ?

    Hi all,
    Can I use Reports Server Queue PL/SQL Table API to retrieve past jobs using WEB.SHOW_DOCUMENT from Forms ?
    I have reviewed note 72531.1 about using this feature and wonder if i can use this metadata to retrieve past jobs submitted by a user.
    The idea would be to have a form module that can filter data from the rw_server_queue table, say, base on user running the form, and be able to retrieve past jobs from Report Server Queue. For this, one would query this table and use WEB.SHOW_DOCUMENT.
    Is this possible ...?
    Regards, Luis ...!

    Based on that metalink note and the code in the script rw_server.sql, I am pretty sure that by querying the table you would be able accomplish what you want... I have not tested it myself... but it looks that it will work... you have the jobid available from the queue, so you can use web.show_document to retrieve the output previously generated...
    ref:
    -- Constants for p_status_code and status_code in rw_server_queue table (same as zrcct_jstype)
    UNKNOWN CONSTANT NUMBER(2) := 0; -- no such job
    ENQUEUED CONSTANT NUMBER(2) := 1; -- job is waiting in queue
    OPENING CONSTANT NUMBER(2) := 2; -- opening report
    RUNNING CONSTANT NUMBER(2) := 3; -- running report
    FINISHED          CONSTANT NUMBER(2) := 4; -- job has finished
    TERMINATED_W_ERR CONSTANT NUMBER(2) := 5; -- job has terminated with

  • HI everybody i want to ask if you come me in help, i want to draw paths but when i use stroke options with pen or brush settings i loose quality when i zoom in , can someone help me with pen settings???

    HI everybody i want to ask if you come me in help, i want to draw paths but when i use stroke options with pen or brush settings i loose quality when i zoom in , can someone help me with pen settings???

    The work path is a vector object, and infinitely scalable, but when you stroke it, Photoshop lays pixels on a layer that follow the path.  These pixels are raster based and can not be scaled without loosing quality.  You do have options.  If you want to make the raster layer bigger, transform the work path and stroke it again.  Or work at a higher resolution in the first place.
    Incidentally, you can't stroke a Path with the Pen, because it is a Vector based tool, and stroking is a raster based function.

  • Extend function in pl/sql table

    declare
    type aar_test is table of varchar2(100)
    index by binary_integer;
    aar_main aar_test;
    begin
    aar_main.extend;
    aar_main(aar_main.last) :='Extend Cell';
    end;
    it's return a error....it is possible??? if yes how...plzzzzzzzz help me...

    Hi..
    Please go through this...!!
    EXTEND
    This procedure has three forms. EXTEND appends one null element to a collection.
    EXTEND(n) appends n null elements to a collection.
    EXTEND(n,i) appends n copies of the ith element to a collection.
    EXTEND operates on the internal size of a collection.
    If EXTEND encounters deleted elements, it includes them in its tally.
    You cannot use EXTEND with associative arrays.Regards
    KPR
    *If this response is correct then mark it as correct answer.
    *If this response is helpful then mark it as helpful answer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can anyone help me in a problem with PL/SQL Tables & the Java getArray()

    The problem is the following:
    I would tike to get a PL/SQL Table (a table of varchar2) into a Java String Array.
    It works very well except that instead of getting the characters in the PL/SQL Table
    I receive the character codes in each string.
    In the following example i should get:
    spring
    summer
    outumn
    winter
    Instead I get:
    0x737072696E67
    0x73756D6D6572
    0x6F7574756D6E
    0x77696E746572
    Steps to try the sample
    1)Creating the following type
    create or replace TYPE CHAR_ARRAY IS TABLE OF VARCHAR(32767);
    2)Creating the following stored procedure
    create or replace PROCEDURE MQ_MSG_PROCESSOR
       MessageText in VARCHAR2,
       QueueName out VARCHAR2,
       RplyMessage out CHAR_ARRAY,
       HastoCommit out NUMBER
    AS
       RMessage CHAR_ARRAY;
    BEGIN
       QueueName:='DEV_OUT';
       RMessage:=CHAR_ARRAY();
       RMessage.Extend(4);
       RMessage(1):='spring';
       RMessage(2):='summer';
       RMessage(3):='outumn';
       RMessage(4):='winter';
       HastoCommit:=1;
       RplyMessage:=RMessage;
    END;
    3)Copiling and running the following java class
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.driver.*;
    import java.util.Dictionary;
    public class ArrayExample
       public static void main (String args[]) throws Exception
          MSG Msg=null;
          oracle.sql.ARRAY RMsg=null;
          DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
          Connection conn = DriverManager.getConnection ("jdbc:oracle:oci8:@test","test", "test");
          conn.setAutoCommit (false);
          try
             String []array={};
             ArrayDescriptor desc=ArrayDescriptor.createDescriptor("CHAR_ARRAY",conn);
             ARRAY CHAR_ARRAY=new ARRAY(desc,conn,array);
             OracleCallableStatement sproc = (OracleCallableStatement)conn.prepareCall("{call GSM.MQ_TST.MQ_MSG_PROCESSOR(?, ?, ?, ?)}");
             sproc.setString(1, "hello"); //MessageText
             sproc.registerOutParameter(2, OracleTypes.VARCHAR);   //QueueName
             sproc.registerOutParameter(3, OracleTypes.ARRAY,"CHAR_ARRAY");   //RplyMessage
             sproc.registerOutParameter(4, OracleTypes.NUMBER);      //HastoCommit
             sproc.execute();
             CHAR_ARRAY=(oracle.sql.ARRAY)sproc.getARRAY(3);
             array = (String [])CHAR_ARRAY.getArray();
             for(int i=0;i<array.length;i++)
                System.out.println(array);
          catch(SQLException e)
             System.out.println("Error while trying to execute MQ_MSG_PROCESSOR");
             System.out.println(e);
          conn.close();

    Hi,
    I tried the code with same procedure.
    That works out fine for me..
    and it prints out exactly the same words as you mentioned..:))
    may be you must have changed something later on.. which started printing character codes..
    but for me it works perfectly fine..
    All The Best..
    Regards
    Gurudatt
    The problem is the following:
    I would tike to get a PL/SQL Table (a table of
    varchar2) into a Java String Array.
    It works very well except that instead of getting the
    characters in the PL/SQL Table
    I receive the character codes in each string.
    In the following example i should get:
    spring
    summer
    outumn
    winter
    Instead I get:
    0x737072696E67
    0x73756D6D6572
    0x6F7574756D6E
    0x77696E746572
    Steps to try the sample
    1)Creating the following type
    create or replace TYPE CHAR_ARRAY IS TABLE OF
    VARCHAR(32767);
    2)Creating the following stored procedure
    create or replace PROCEDURE MQ_MSG_PROCESSOR
    ���MessageText in VARCHAR2,
    ���QueueName out VARCHAR2,
    ���RplyMessage out CHAR_ARRAY,
    ���HastoCommit out NUMBER
    AS
    ���RMessage CHAR_ARRAY;
    BEGIN
    ���QueueName:='DEV_OUT';
    ���RMessage:=CHAR_ARRAY();
    ���RMessage.Extend(4);
    ���RMessage(1):='spring';
    ���RMessage(2):='summer';
    ���RMessage(3):='outumn';
    ���RMessage(4):='winter';
    ���HastoCommit:=1;
    ���RplyMessage:=RMessage;
    END;
    3)Copiling and running the following java class
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.driver.*;
    import java.util.Dictionary;
    public class ArrayExample
    ���public static void main (String
    args[]) throws Exception
    ���{
    ������MSG Msg=null;
    ������oracle.sql.ARRAY
    RMsg=null;
    ������DriverManager.regis
    erDriver(new oracle.jdbc.driver.OracleDriver());
    ������Connection conn =
    DriverManager.getConnection
    ("jdbc:oracle:oci8:@test","test", "test");
    ������conn.setAutoCommit
    (false);
    ������try
    ������{
    ���������S
    ring []array={};
    ���������A
    rayDescriptor
    desc=ArrayDescriptor.createDescriptor("CHAR_ARRAY",conn
    ���������A
    RAY CHAR_ARRAY=new ARRAY(desc,conn,array);
    ���������O
    acleCallableStatement sproc =
    (OracleCallableStatement)conn.prepareCall("{call
    GSM.MQ_TST.MQ_MSG_PROCESSOR(?, ?, ?, ?)}");
    ���������s
    roc.setString(1, "hello"); //MessageText
    ���������s
    roc.registerOutParameter(2,
    OracleTypes.VARCHAR);���//QueueName
    ���������s
    roc.registerOutParameter(3,
    OracleTypes.ARRAY,"CHAR_ARRAY");���//Rpl
    Message
    ���������s
    roc.registerOutParameter(4,
    OracleTypes.NUMBER);������
    //HastoCommit
    ���������s
    roc.execute();
    ���������C
    AR_ARRAY=(oracle.sql.ARRAY)sproc.getARRAY(3);
    ���������a
    ray = (String [])CHAR_ARRAY.getArray();
    ���������f
    r(int i=0;i<array.length;i++)
    ���������{
    System.out.println(array);
    ���������}
    ������}
    ������catch(SQLException
    e)
    ������{
    ���������S
    stem.out.println("Error while trying to execute
    MQ_MSG_PROCESSOR");
    ���������S
    stem.out.println(e);
    ������}
    ������conn.close();
    ���}

  • Using Select option in Native SQL

    Hi,
    Can any one tell me, how to use select option value in native SQL.
    ie.,
    I want to use select option in where condition. Need to select all the records from table(non-SAP) where date in given range.
    Please suggest.
    Thanks,
    Amal

    Hi
    No!
    U need to find a way to convert a range of select-option to a range for Native SQL, probably it should be better doesn't use a select-option for the date but two parameters: one for date from and one for date to.
    Max

  • Can I create ASP user validated website using existing MD5 passwords from SQL table?

    I'm attempting to build a user authenticated site in Dreamweaver CS5 using an existing USERS table from another site.  The password field in the existing SQL table appears to be MD5 encoded.  How can I MD5 encode the form field (or the SQL query) so that it verifies MD5 to MD5?
    Currently, it's comparing the form's plain text field to the MD5 encrypted password field in SQL.
    I've built a simple login form using the following:
    <form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
        <input name="username" type="text" id="username" accesskey="u" tabindex="1" /><input name="password" type="password" id="password" accesskey="p" tabindex="2" /><input name="submit" type="submit" value="submit" />
        </form>
    With the stock Dreamweaver Log In User Server Behavior as follows:
    <%
    ' *** Validate request to log in to this site.
    MM_LoginAction = Request.ServerVariables("URL")
    If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
    MM_valUsername = CStr(Request.Form("username"))
    If MM_valUsername <> "" Then
      Dim MM_fldUserAuthorization
      Dim MM_redirectLoginSuccess
      Dim MM_redirectLoginFailed
      Dim MM_loginSQL
      Dim MM_rsUser
      Dim MM_rsUser_cmd
      MM_fldUserAuthorization = ""
      MM_redirectLoginSuccess = "results.asp"
      MM_redirectLoginFailed = "error.html"
      MM_loginSQL = "SELECT user_name, password"
      If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
      MM_loginSQL = MM_loginSQL & " FROM dbo.users WHERE user_name = ? AND password = ?"
      Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
      MM_rsUser_cmd.ActiveConnection = MM_ADSX_STRING
      MM_rsUser_cmd.CommandText = MM_loginSQL
      MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 32, MM_valUsername) ' adVarChar
      MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 32, Request.Form("password")) ' adVarChar
      MM_rsUser_cmd.Prepared = true
      Set MM_rsUser = MM_rsUser_cmd.Execute
      If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
        ' username and password match - this is a valid user
        Session("MM_Username") = MM_valUsername
        If (MM_fldUserAuthorization <> "") Then
          Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
        Else
          Session("MM_UserAuthorization") = ""
        End If
        if CStr(Request.QueryString("accessdenied")) <> "" And false Then
          MM_redirectLoginSuccess = Request.QueryString("accessdenied")
        End If
        MM_rsUser.Close
        Response.Redirect(MM_redirectLoginSuccess)
      End If
      MM_rsUser.Close
      Response.Redirect(MM_redirectLoginFailed)
    End If
    %>
    Please help!

    unfortunately classic asp does not have a built in function for md5. what we used for our legacy sites is a javascript that hashes a string to MD5. here's the code we've used in the past http://pajhome.org.uk/crypt/md5/md5.html
    your asp should have something like this...
    <script language="jscript" src="path_to_js_file/md5.js" runat="server"></script>
    <%
    'hash the password
    Dim md5password       ' md5password variable will hold the hashed text from form variable txtPassword
    md5password = hex_md5(""&Request("txtPassword")&"")
    ' based on the code you posted...
    MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 32, md5password) ' adVarChar
    %>

  • Problem with pl/sql table data type

    hai friends,
    i have one procedure it has some in parameters and one out parameter which fetches values to front end.
    But the out parameter will be pl/sql table data type.
    if it is ref cursor
    then i declared as
    var x refcursor;
    exec procedure_name(1,:x);
    it is ok.
    but for pl/sql table data type is out parameter then what i will do in the prompt .
    give me syntax and clarify my doubt.
    advanced thanks...
    madhava

    The SQL*Plus VARIABLE statement does not support user-defined types, hence it cannot support nested tables. It can support cursors because they can be weakly typed (so we can use the one SQL*Plus VAR to hold any shape of resultset). Nested tables are strongly typed; SQL*Plus is a relatively stupid interface and cannot be expected to understand UDT.
    So, it you want to use nested tables as output you'll need to code a wrapping procedure that can understand your nested table type and handle it accordingly.
    Sorry.
    Cheers, APC

  • Need help with pl/sql tables

    i am trying but iam not understanding this....
    Evaluate this program fragment:
    DECLARE
    TYPE user_tab_rec IS RECORD (
    db_user dba_users.username%TYPE,
    DBA_TAB dba_tables%ROWTYPE);
    TYPE user_rec_tab IS TABLE OF test_rec
    INDEX BY BINARY_INTEGER;
    Tab_rec dba_tables%ROWTYPE;
    Obj_owner dba_objects.owner%TYPE;
    begin
    (processing)
    end;
    What line will generate an error?
    1.
    TYPE user_tab_rec IS RECORD (
    2.
    db_user dba_users.username%TYPE,
    3.
    DBA_TAB dba_tables%ROWTYPE);
    4.
    TYPE user_rec_tab IS TABLE OF test_rec
    5.
    INDEX BY BINARY_INTEGER;
    6.
    Tab_rec dba_tables%ROWTYPE;
    7.
    Obj_owner dba_objects.owner%TYPE;
    The correct answer is b. The line in b attempts to define a PL/SQL TABLE TYPE using a record that contains a composite datatype, which is not allowed. Answers a, c, and d are incorrect because they will not generate any errors when compiled.
    how can line b attempt to define a pl/sql table type..........
    thank u ramsy

    The correct answer is bB? I see no B.
    Do you mean three?
    But then again
    maybe line ten.
    Because (processing) isn't
    valid syntax you see.
    I know, I know
    Let's see what'll go.
    And then we'll see
    Is it A B or C?
    SQL> r
      1  DECLARE
      2  TYPE user_tab_rec IS RECORD (
      3  db_user dba_users.username%TYPE,
      4  DBA_TAB dba_tables%ROWTYPE);
      5  TYPE user_rec_tab IS TABLE OF test_rec
      6  INDEX BY BINARY_INTEGER;
      7  Tab_rec dba_tables%ROWTYPE;
      8  Obj_owner dba_objects.owner%TYPE;
      9  begin
    10  null;
    11* end;
    TYPE user_rec_tab IS TABLE OF test_rec
    ERROR at line 5:
    ORA-06550: line 5, column 31:
    PLS-00201: identifier 'TEST_REC' must be declared
    ORA-06550: line 5, column 1:
    PL/SQL: Item ignored
    SQL> create type TEST_REC as object(a number);
      2  /
    Type created.
    SQL> DECLARE
      2  TYPE user_tab_rec IS RECORD (
      3  db_user dba_users.username%TYPE,
      4  DBA_TAB dba_tables%ROWTYPE);
      5  TYPE user_rec_tab IS TABLE OF test_rec
      6  INDEX BY BINARY_INTEGER;
      7  Tab_rec dba_tables%ROWTYPE;
      8  Obj_owner dba_objects.owner%TYPE;
      9  begin
    10  null;
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL> Hmmm........................
    Cheers, APC

  • Using Applicationo Express with MY SQL or SQL Server ?

    Hello,
    I am new to APEX. Please guide me can I use it with My SQL or SQL Server in any possible way. As shared hosting for both of these databases is easily available.
    Secondly I heard APEX support web services. Can I use dotnet webservices with it ?
    thanks
    haansi

    Shared hosting is ALSO available for APEX. The product RUNS inside an Oracle database, so unless you use the connectivity software to link an Oracle database to SQL Server or mysql, you can NOT use it with these products?
    Why exactly are you looking to do this? Is i the cost of hosting an APEX application? There are places charging $10-20 a month to host APEX applications, comparable to mysql/SQL Server sites..
    Thank you,
    Tony Miller
    Webster, TX

  • I want to Know how to use JDBC connection with postgress sql on Linux

    Hello friends R u Listen to me?
    Pls help me for making JDBC connectivity with postgress Sql On Linux by using Type 4 Driver .
    Is there is any envoirnment setting rqr then pls send me the same on my mail
    My mail is [email protected]
    varsha

    dcminter wrote:
    http://java.sun.com/docs/books/tutorial/jdbc/index.html
    and
    http://www.postgresql.org/docs/
    ;-)

Maybe you are looking for

  • Unable to install iTunes 10.5 on Win 7 laptop - "Problem with Windows Installer program"

    I get the following when trying to install version 10.5 I have uninstalled everything Apple, emptied temp files, restarted the computer and I'm still unable to install the lasted iTunes. Any thoughts?

  • New line character in OTL Fast Formula

    Hi, We have written custom OTL Formula to perform some legislative logic. We are generating message dynamically and to have line break we are using chr(13). When we check in fnd newmessages table, it shows proper break, but on timecard page error com

  • Original iphone/2.0 software/bmw 328i/bluetooth problems

    I have the original iphone; updated to 2.0. The bluetooth used to work great with the bmw - now with the 2.0, the phone locks up & major problems connecting, staying connected. Address book no longer syncs either. I re-paired the phone, but no dice.

  • Conversion from ABC to 123 format causes data loss

    Hi, I have imported Excel data onto Lumira. The data set contains a "Net Price" column which is detected as ABC. Whenever I convert it to numerical format, I lose some data. Please see the snapshots. What can be the issue? Any background information

  • Web movies for TV viewing

    I have some videos I downloaded from the web I would like to import into iMovie and then create a DVD to watch on TV. Just a standard 32" TV, not a high definition TV or anything like that. What resolution do the web videos need to be in order to loo