How to return a OCI Table * (nested table) from OCI application to sqlplus

Hi,
How to return a OCI Table * (nested table) from OCI application to sqlplus prompt : OCITAble * shows up as empty on the SQLPLUS prompt.
The ODCIAggregateTerminate member function's OUT parameter is OCITable * returnValue. After completion of this member function it displays data on the sqlplus prompt.
My problem is that eventhough my OCITable(returnvalue) has elements appended or added to it. But when I return the OCITAble after completion
of this member function the OCITable shows up as empty collection on the SQLPLUS prompt. But in the OCI code if I iterate through the collection
I can print out the elements and see their values or data.
Can any one let me know how I can make the elements or data in the collection available at SQLPLUS prompt after the completion of this member function.
If my return value or OUT parameter of this member function is OCINumber * returnValue : then I can see the corresponding value assigned in the OCI Code
and the same value is returned and visible on the SQLPLUS prompt. But when I use the OUT parameter as OCITAble * : then it shows up as empty collection.
I don't really know why is it happening so.
member function ODCIAggregateTerminate(
self IN OUT MinDistanceImpl, returnValue OUT table_out1,
flags IN number)
return number
as language C
library custagg name "ODCIAggregateTerminate"
with context
parameters (
context,
self,
self INDICATOR STRUCT,
returnValue ,
returnValue INDICATOR,
flags,
flags INDICATOR ,
RETURN ),
typedef OCITable table_out1;
struct ntab_type
OCINumber empno;
OCINumber salary;
OCIString * tst;
OCIString * te;
typedef struct ntab_type ntab_type;
struct ntab_type_ind
OCIInd _atomic;
OCIInd empno;
OCIInd salary;
OCIInd tst;
OCIInd te;
typedef struct ntab_type_ind ntab_type_ind;
extern "C" OCINumber * ODCIAggregateTerminate(
OCIExtProcContext *context,
MinDistanceImpl * self,
MinDistanceImpl_ind * self_ind,
table_out1 * returnValue,
short * returnValue_ind,
OCINumber * flags,
short flags_ind)
ocitypename for collection..
ocitypename for element
ociobjectnew for collection
ociobjectNew's for elements
ocicollappend of elements to collection
then iterate thru collection
and at them collection as those elements and we return that collection
But is empty : on SQLPLUS prompt :
Select Mindis(TT) from table1;
TT(empno, salary, tstart, te)
Table_Out1()

> Can anyone pls let me know if there is some way to return an entire table from a function which
is called from a stored procedure?
For what purpose?
Do you realise that this means pulling Megabytes (or even many Gugabytes) of data from disk, into the buffer cache, and then copying that data into PL/SQL memory (using a function) in order to give a stored proc that data?
This is just plain crazy.. resource wise, performance wise, scalability wise.. this is exactly how NOT to use Oracle.
Why don't you instead tell us what problem you want to solve. Forget for the moment what you think the solution should be. (and asking us how to get a potentially flawed solution, to work)
Let's get an accurate problem definition so that we can provide you with suggestions and recommendation on what Oracle features can be used to address that problem.

Similar Messages

  • How to start Flash Media Encoder 3.2 from Flex application with run time parameters?

    Hello ,
    I'm developing the application to stream High Quality video.While streming by default camera/microphone settings the qulaity of streaming is not upto my expected level.I want to stream through Flash Media Encoder.My aim is the user login to the application.Video/audio qulaity details are retrived from shared object stored in the client machine.The login user name only gathered at run time & it will be the streaming profile name to Encoder.Once the the Encoder started the outgoing video will be come into screen to client.Please guide me How to start Flash Media Encoder 3.2 from Flex application with run time parameters(User name as  streaming name) without manually start the FME?
    Thanks in advance.
    Regards
    Sasharyuva

    Hi MarcSaphiron,
    Could you please send the samples?It will be much helpful to complete my
    job within the deadline.
    Thanks in advance.
    Regards,
    Sasharyuva

  • Help how to create full set of nested table with given xml schema?

    Hi everyone, I am new to oracle and programming language. Recently I was asked to create nested table with given a complex xml schema. I knew that after the registration of xsd file, oracle will generate few tables( including nested table) and types for the users. But it seems to be not complete set of tables. Can anyone please help me with the problem. Really thanks a lot on the help given. I would like to give extra explanation if what I have given above is not clear enough. Thanks

    How about posting the XML Schema, the code you used to register it, the database version you are using and the list of nested tables that were generated...

  • Decide between Temoporary tables, Nested tables and Arrays

    Hello everyone.
    I need to convert T-SQL function to PL-SQL.
    I have this line in T-SQL:
    DECLARE @FTAP TABLE ([Value] [int] PRIMARY KEY NONCLUSTERED NOT NULL, UNIQUE ([Value]ASC )); As I see that, there are several equivalents in PL-SQL:
    1. Global temporary table.
    2. Nested table.
    3. Array.
    The table is declared in the function for reusing in the same function.
    When the function finished the table should delete.
    Also, the table should have index (or primary key...).
    What is the best choice?

    be careful in directly translating SQL server code to Oracle. they are fundamentally different in terminology and in the way they work.
    you can use associated arrays with record types:
    SQL> declare
      2     type rec_demo is record (id number, txt varchar2(100));
      3     type tab_demo is table of rec_demo index by binary_integer;
      4     v_tab_demo tab_demo;
      5  begin
      6
      7    v_tab_demo(1).id := 23;
      8    v_tab_demo(1).txt := 'demo';
      9    v_tab_demo(2).id := 54;
    10    v_tab_demo(2).txt := 'demo2';
    11
    12    for i in 1..v_tab_demo.count loop
    13       dbms_output.put_line(v_tab_demo(i).txt);
    14    end loop;
    15
    16
    17  end;
    18  /
    demo
    demo2you can also use collections in other ways. Most people would advise against using global temporary tables unless there's no other way and even then they'd recommend materialised views etc.
    can you elaborate a bit more about how you're using it? if we know what purpose it's being used for we may be able to assist a bit more efficiently.

  • How to return column name in some table?

    Hi All,
    I know :system.cursor_value which returns the value of the current text item in the form.
    But Is there a way to return the column name and its value in some table?
    Note: I'm using Oracle DB 10g
    Thank you

    Did you read the original post? [...] You don't understand what I want and you don't say antthing useful for my goal!
    This is the SQL and PL/SQL forum. You need the Mind-Readers' forum down the hall.
    First you asked "Is there a way to return the column name and its value in some table?", and were told you can get the former from the data dictionary (you can get the latter from the table itself).
    Then you say you "want to create a trigger on a table", which tells us nothing about your problem.
    Finally you say "but suppose the table contains 50 columns then I have to write 50 columns names three times", which is essentially true - but the process can be automated. What you (probably) need to do is write queries based on the data dictionary tables that generates the PL/SQL that you ultimately put in your triggger - you then use that output to build the trigger(s).
    I don't think there's any way, at run time, to generically fish out all the columns of a table with their :new and :old values - you have to write (or auto-generate) specific code for each table.

  • How to return to first record in table after a while statement?

    Hi,
    I'm trying to multiply data from two different tables to get a distance between two points - I only want to return the result if the distance is less than 0.15 metres. It loops ok the first time but dies once I get into the second while for the second time. I'm sure I have the logic wrong, I just can't figure out the right way. I haven't used Java or programmed in four years so apologises if the answer is ridiculously simple!
    public static void main(String args[])
              try
                   FileOutputStream out = new FileOutputStream("c://output.txt", true);
                   PrintStream p;
    // Connect print stream to the output stream
    p = new PrintStream( out );
                   Connection conn = getConnection();
              System.out.println("1");
              Statement st1 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
              Statement st2 = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
              ResultSet inact = st1.executeQuery("select Radio, aLocationLatLong, Lat, Lon from Inactive_EK");
              ResultSet act = st2.executeQuery("select Radio, aLocationLatLong, Lat, Lon from Active_EK");
              while(inact.next())
                   R_ID = inact.getString("Radio");     
                   inLt = inact.getDouble("Lat");          
                   inLn = inact.getDouble("Lon");
                   p.println("Inactive: " + R_ID + " " + inLt + " " + inLn);
                   while(act.next())
                        acR_ID = act.getString("Radio");
                        acLt = act.getDouble("Lat");
                        acLn = act.getDouble("Lon");
                        p.println("Active Lat: " + acLt + " " + acLn );
                             double earthRadius = 6378.137;
                             double dLat = Math.toRadians(inLt-acLt);
                             double dLng = Math.toRadians(inLn - acLn);
                             double a = Math.sin(dLat/2) * Math.sin(dLat/2) +
                        Math.cos(Math.toRadians(acLt)) * Math.cos(Math.toRadians(inLt)) *
                        Math.sin(dLng/2) * Math.sin(dLng/2);
                             double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
                             double dist = earthRadius * c;
                             if(dist <= 0.15)
                                  p.println("Active Lat: " + acR_ID + " " + acLt + " " + acLn + " " + dist);
                   p.close();
                   st1.close();
                   st2.close();
                   conn.close();
              catch
              (Exception e)
    System.err.println ("Connect problem");
    Thanking you in advance!

    Try something like below: change the script as required.
    create Table T1(Col1 int)
    Insert into T1 Select 1
    Insert into T1 Select 2
    Declare @T1 Table(Col1 int, errmsg varchar(100))
    create Table T2(Col1 int, errmsg varchar(100))
    DELETE T1
    output deleted.*,'error 1' INTO @T1
    Where Col1 = 1
    Select * From @t1
    If exists(Select 1 From @t1)
    Begin
    Insert into T2 Select * From @T1
    Drop table T1,T2
    return ;
    End
    DELETE T1
    output deleted.*,'error 2' INTO @T1
    Where Col1 = 2
    Select * From @t1
    Insert into T2 Select * From @T1
    Select * From T2
    Drop table T1,T2

  • How to return array of unsigned integer pointer from call library function node & store the data in array in labview

    I want to return array of unsigned integer from call library node.
    If anybody knows please help me
    Thanks & Regards,
    Harish. G.

    Did you take a look at the example that ships with LabVIEW that shows how to do all sorts of data passing to DLLs. I believe your situation is one of the examples listed. You can find the example VI in the "<LabVIEW install directory>\examples\dll\data passing" directory.

  • How can I get the "BackColor" of button from WinForm application in codedUI?

    I'm newbie in codedUI, I meet some problem when try to get "BackColor" property of WinForm control. I don't see it from property list. Please help me if you know or have some ideas about that. Thanks

    Hi Duy.Hung,
    Based on your issue, I think that you will have to extend the supported properties for controls used by the Coded UI framework.  The following articles will show you how to accomplish this. 
    Extending supported properties set of a control (WinForms example)
    http://blogs.msdn.com/b/gautamg/archive/2010/03/25/extending-supported-properties-set-of-a-control.aspx
    Coded UI Test Extension for 3rd party Windows Forms controls–How to?
    http://blogs.msdn.com/b/visualstudioalm/archive/2011/10/28/coded-ui-test-extension-for-3rd-party-windows-forms-controls-how-to.aspx
    Hope it help you!
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to use connection pooling in 6.5 from standalone application?

    Hi,
    Is it possible to standalone application get connection from connection pool Sun ONE App Server 6.5?
    If can means how pls tell me the steps?
    I am trying standalone application to get connection from pool it will throw StackOverflowError.
    thanks
    with regds
    parthi

    Hi,
    Is it possible to standalone application get connection from connection pool Sun ONE App Server 6.5?
    If can means how pls tell me the steps?
    I am trying standalone application to get connection from pool it will throw StackOverflowError.
    thanks
    with regds
    parthi

  • How to send notification in the Portal UWL from WD application

    Hi,
      My requirement is user will submit Leave application form from one of the WD application then the Workflow has to send notification in the Protal for the HR.When HR see this request in his UWL it has to display the user entered leave details.
    Thanks in advance...!!!!!

    Follow the link
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/using%20web%20dynpro%20java%20and%20web%20dynpro%20abap%20applications%20in%20universal%20work%20list.pdf

  • How to delete the NULL entries in nest table

    Hi,
    After I used a loop and open/fetch cursor populated the object table
    I found there are random NULL entries in my object table (nest table)
    The data look like this
    NULL NULL           NULL
    NULL NULL           NULL
    123     03-MAY-04     ACTIVE
    NULL NULL           NULL
    NULL NULL           NULL
    234     21-MAY-04     ACTIVE
    NULL NULL           NULL
    345     11-MAY-04     ACTIVE
    NULL NULL           NULL
    How can I get rid of those NULL entries in my nest table? So it can become
    123     03-MAY-04     ACTIVE
    234     21-MAY-04     ACTIVE
    345     11-MAY-04     ACTIVE
    Additional info:
    create type myType as object
    (id NUMBER (10,0),
    eff_date date,
    status VARCHAR2(17)
    create type myNestTab as table of myType;
    I have tried Delete procedure in following two ways.
    Version 1:
    FOR i IN l_my_nest_tab.FIRST..l_my_nest_tab.LAST
    LOOP
    IF l_my_nest_tab(i).id IS NULL THEN
    l_curr_event_tb.DELETE(i);
                   END IF;                         
    END LOOP;
    Version 2:
    FOR i IN l_my_nest_tab.FIRST..l_my_nest_tab.LAST
    LOOP
    IF l_my_nest_tab(i) IS NULL THEN
    l_curr_event_tb.DELETE(i);
                   END IF;                         
    END LOOP;
    Both of them give me the error “no data found.” And only left me the first NOT NULL entry in the table.
    123     03-MAY-04     ACTIVE
    Thanks in avdance.

    Hi Vishnu,
    u can write a report program for this and in that use the event  :
    AT NEW <field-name> ( use primary key)
    your statements
    ENDAT
    for eg.
    loop at itab ( herfe itab must be of type of table for which u want to track new entries)
    at new matnr
    write:/ new record
    endat
    endloop.
    schedule this report in background to run in every 5 or 10 mins as per your requirement and hence changes can be tracked.
    regards
    Vinod

  • Need urgent help on nested tables

    Everywhere i could find a single nested table but not two. Can anyone help me on how to access and assign multi nested tables ?
    Declare
    Type a is table of varchar2(1000);
    Type b is table of a;
    v_temp b;
    Begin
    How can i assign and access variable of v_temp ?
    Please help as i can find one level nested tables examples but not this type ?
    end;

    SQL> set serveroutput on
    SQL> Declare
      2  Type a is table of varchar2(1000);
      3  Type b is table of a;
      4  v_temp b := b();
      5  Begin
      6      v_temp.extend(2);
      7      v_temp(1) := a('A','B','C');
      8      v_temp(2) := a('1','2','3','4','5');
      9      for i in 1..v_temp.count loop
    10        for j in 1.. v_temp(i).count loop
    11          dbms_output.put_line('v_temp('||i||')('||j||') = '||v_temp(i)(j));
    12        end loop;
    13      end loop;
    14  End;
    15  /
    v_temp(1)(1) = A
    v_temp(1)(2) = B
    v_temp(1)(3) = C
    v_temp(2)(1) = 1
    v_temp(2)(2) = 2
    v_temp(2)(3) = 3
    v_temp(2)(4) = 4
    v_temp(2)(5) = 5
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Insert data into nested tables

    Hi,
    Can someone please advice how can I insert data into nested tables using APEX.
    I have a table "employee" and a column addresses of type address_table_type object which has address1, address2, address3 columns. I want to create form in APEX that will collect address1, address2, address3. I wonder how to do this? should the item be based in database item? if yes then how can I point to the column of address_table_type
    Thanks
    --Aali                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Can you post your tabB type, sample data, and your exact insert statement?
    Is it overwriting or not commiting the inserts?
    Have you traced your session to see what is happening?

  • Is it possible to create nested tables in MySql database?

    I am currently working on a project with my team and I'm in charge of designing the database. It's going to be a service delivery app that's going to have the name of several clients and their respective list services and cost of each service. The problem I'm having right now is finding a way to create separate tables, menus if you will, of their list of services offered since they all have different prices.
    Here's my question, can I create individual tables within a larger table (nested tables) using MySQL or would you recommend a different method?
    Please bear in min this is my first SQL project and I've had no prior experience with it.
    This topic first appeared in the Spiceworks Community

    It seems that the ability to link to a KB article within the WYSIWYG is broken.
    Spiceworks 7.4.00070
    IE 11 and Mozilla 38.0.5
    Can anyone else confirm?-Open the User Portal, edit any page and click the "Knowledge Base Article Link" button. -Chose a KB article and then publish your change.
    -Hover over the newly created KB link and/or click on the link.*screenshots are what I get.

  • In Smartforms can i use table type which has table inside table

    Hi ,
    I would like to know whether in Form Interface can we declare table type which has a table and one of its field is again a table( Nested tables)..
    Can we declare like that ?? Need your suggestions please...
    Rgds.,
    subash

    Yes, we can.
    Check Smartform LB_BIL_INVOICE
    Importing parameter IS_BIL_INVOICE TYPE LBBIL_INVOICE
    Regards,
    Naimesh Patel

Maybe you are looking for

  • IPhoto Crashes everytime I open it

    Hello, I was wondering if someone could help me out here? iPhoto '11 (Latest update) keeps on crashing everytime I open the program, so I have to force quit it.  This issue arose a few weeks ago even before any Apple iLife updates. I initially though

  • Active Directory Authentication

    I am trying to integrate BEA WLS 8.1 with MS AD Windows 2000 advanced server. I have enabled Debug and set the security debug flags and can see the output from the WLS as it trys to authenticate users (and the admin user when the WLS starts up). I ca

  • SMS/Contact Bug with iOS5

    All, I have a iPhone 4G on AT&T that I just upgraded to iOS5.  It seems when I text another iPhone user the name of the contact doesn't appear, just their phone number (eg: John Smith now shows up in the text view as his number (111-111-1111 for exam

  • G4 iMac slowing down

    I have a 1.25GHz G4 iMac, 768 MB memory & 80GB HD with 34GB available. performance is and always has been rock solid but recently I've noticed it's getting really slow opening applications eg Firefo, Word etc. I get the spinning beachball for 5-10 se

  • Internet Speed

    Hi, This is relating to my current internet speed. I have 10mbs Fibre Optic from Virgin Media. My flat mates windows laptops internet runs very fast...all the time. My macbook seems to go through various phases of being moderately fast to down right