How to select data into multiple bind variables

Hi,
I need to load data into multiple bind variable how to do that
As of now i am using this
select a , b into :a, :b from dual
But i want even a to be loaded into both :a and :c also b to be loaded into :b and :d Please suggest
Thanks
Sudhir.

Thanks much it worked
Thanks
Sudhir

Similar Messages

  • How to spool data into multiple Excel sheet if result is more then 65k rows

    Hi all,
    Wann spool data into multiple excel sheet bocz my resultant no of rows are more then 65k.
    Thanks to all in advance.....

    many choices
    1) migrate to a newer version of Excel
    2) split the files after spooling
    for instance with split
    split -l65000 file.txtor with perl, java, vb or what-so-ever
    3) do more than one report by using rownum
    spool f1
    select empno,ename  from (select rownum r,empno,ename from emp order by empno) where r<6 ;
    spool off
    spool f2
    select empno,ename  from (select * from (select rownum r,empno,ename from emp order by empno) where r<11) where r>5 ;
    spool off
    spool f3
    select empno,ename  from (select rownum r,empno,ename from emp order by empno) where r>10 ;
    spool off

  • How can split data into multiple sheets using an excel template

    Hi all,
    I'm using BIP 10.1.3.4.1 upgrated with the latest rollup patch, 9546699.
    I followed the example inside the article "Real Excel Templates 1.5" (on the Tim Dexter's blog)
    http://blogs.oracle.com/xmlpublisher/2010/05/real_excel_templates_i.html
    and I built my report directly from an excel template containing only one sheet (plus the XDO_METADATA sheet), and for one sheet it worked fine !!!
    Now I need to add more sheets to the template.... and I have two big questions:
    1. if I need to create a second sheet which contains almost the same data (with a different layout), I saw that it is not possible to map a value to more than 1 cell....so if I map a value in the first sheet, I can't map it in the second sheet (because it's already used in the first one).
    How can I map same values into two or different execll
    2. if I need to create a second sheet which contains another dataset (completely different from the dataset in the first sheet), I can I do, considering that every BIP report is based on ONLY a data source.
    Tim wrote: The most impressive, for me at least, is the sheet 'bursting'. You can split your hierarchical data across multiple sheets and dynamically name those sheets
    but I didn't yet understand how this bursting it's possible.....considering what I said above.....
    Surely I've a lack of knowledge.....but anybody can help me to understanding the "multiple excel sheets" black hole ?
    I'll appreciate any kind of help
    Thanks in advance
    Alex

    You can find working solution here http://xlspe.com

  • How to select data from multiple dropdowns(HTMLDB)

    Hi,
    How to get the data from multiple dropdowns in the same report. Both the dropdowns are gerring data from the same table.
    Ex:
    abc-1st dropdown
    pqr-2nd dropdown.
    when abc and pqr are blank, it should display all records by default. If abc="some value" and pqr is empty then it should display all values corresponding to abc.
    Regards,
    Pallavi

    Pallavi,
    I think this might be something you are looking for:
    http://htmldb.oracle.com/pls/otn/f?p=31517:99
    There are some examples on how to modify your SQL to get it working the way you want.
    Denes Kubicek

  • HOW TO  WRITE DATA INTO A CLOB VARIABLE IN PL SQL-URGENT!!!!!!!

    Hi,
    In a PLSQL procedure, i need to store all error messages into a CLOB variable and finally RETURN the Clob.
    While using DBMS_LOB.wirteappend, i am getting Error like
    "INVALID LOB LOCATOR SPECIFIED".
    Here is the code sample i used,
    CREATE OR REPLACE procedure ErrorAppend
    is
    clobObj CLOB;
    amt binary_integer:=32767;
    errormsg varchar2(2000);
    BEGIN
    for j in 1..3
    loop
    BEGIN
    insert into errortest values(j);
    EXCEPTION
    WHEN others THEN
    errormsg:='ERROR OCCURED '||SQLERRM;
    dbms_lob.writeappend(clobObj,amt,errormsg);
    END;
    commit;
    end loop;
    dbms_output.put_line(clobObj);
    END ErrorAppend;
    Here i am not allowed to get empty_clob/clob from the table.
    Any help will be apprciated.
    rgds,
    senthil.

    InputStream inputStream = new ByteArrayInputStream(mss.getBytes());Use this to push into the file>
    Ummm.... no. InputStreams are for reading, not for writing.
    Anyway, OP, you're making a mistake. You're trying to open a stream to a file called "This is for dedo". Use FileOutputStream(File file) constructor or FileOutputStream(String pathToFile). You can then wrap that stream with a PrintWriter or whatever you need.

  • How to select data with multiple child nodes

    We have the following data:
    me table ei table
    m1 e1
    m1 e2
    m1 e3
    m1 e4
    m2 e5
    m2 e6
    m3 e7
    m3 e8
    I would like to display them as:
    m1 e1
    e2
    e3
    e4
    m2 e5
    e6
    m3 e7
    e8
    How to best do this with sql?
    I would like to produce this list with sql and then transform it to xml.
    Thanks.

    Since you did not use tags it is not clear what results should be:
    SQL> WITH TBL AS (
      2  SELECT 'm1' me, 'e1' ei FROM DUAL UNION ALL
      3  SELECT 'm1' me, 'e2' ei FROM DUAL UNION ALL
      4  SELECT 'm1' me, 'e3' ei FROM DUAL UNION ALL
      5  SELECT 'm1' me, 'e4' ei FROM DUAL UNION ALL
      6  SELECT 'm2' me, 'e5' ei FROM DUAL UNION ALL
      7  SELECT 'm2' me, 'e6' ei FROM DUAL UNION ALL
      8  SELECT 'm3' me, 'e7' ei FROM DUAL UNION ALL
      9  SELECT 'm3' me, 'e8' ei FROM DUAL
    10  )
    11  SELECT  CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN ME ELSE NULL END ME,
    12          EI
    13    FROM  TBL
    14    ORDER BY TBL.ME,
    15             TBL.EI
    16  /
    ME EI
    m1 e1
       e2
       e3
       e4
    m2 e5
       e6
    m3 e7
       e8
    8 rows selected.or
    SQL> WITH TBL AS (
    2 SELECT 'm1' me, 'e1' ei FROM DUAL UNION ALL
    3 SELECT 'm1' me, 'e2' ei FROM DUAL UNION ALL
    4 SELECT 'm1' me, 'e3' ei FROM DUAL UNION ALL
    5 SELECT 'm1' me, 'e4' ei FROM DUAL UNION ALL
    6 SELECT 'm2' me, 'e5' ei FROM DUAL UNION ALL
    7 SELECT 'm2' me, 'e6' ei FROM DUAL UNION ALL
    8 SELECT 'm3' me, 'e7' ei FROM DUAL UNION ALL
    9 SELECT 'm3' me, 'e8' ei FROM DUAL
    10 )
    11 SELECT CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN ME ELSE EI END ME,
    12 CASE ROW_NUMBER() OVER(PARTITION BY ME ORDER BY EI) WHEN 1 THEN EI ELSE NULL END EI
    13 FROM TBL
    14 ORDER BY TBL.ME,
    15 TBL.EI
    16 /
    ME EI
    m1 e1
    e2
    e3
    e4
    m2 e5
    e6
    m3 e7
    e8
    8 rows selected.
    SQL>
    SY.

  • How to insert one table data into multiple tables by using procedure?

    How to insert one table data into multiple tables by using procedure?

    Below is the simple procedure. Try the below
    CREATE OR REPLACE PROCEDURE test_proc
    AS
    BEGIN
    INSERT ALL
      INTO emp_test1
      INTO emp_test2
      SELECT * FROM emp;
    END;
    If you want more examples you can refer below link
    multi-table inserts in oracle 9i
    Message was edited by: 000000

  • How to execute a function and return the result into a bind variable

    Hi,
    I am trying to calculate the sum of salaries of all persons with a particular JOB_ID using a function TOTAL_INCOME(v_job_id).
    create or replace function total_income
    +(v_job_id IN varchar2)+
    RETURN number IS
    v_total number(6);
    cursor get_sal is
    select salary from employees
    where job_id = v_job_id;
    BEGIN
    v_total := 0;
    for emp in get_sal
    loop
    v_total := v_total emp.salary;+
    end loop;
    dbms_output.put_line('Total salary of '||v_job_id||' is: '|| v_total);
    return v_total;
    END;
    Now I woud like to execute this function and assign the returned value into a bind variable test_sal
    variable test_sal number(6)
    SELECT total_income('AD_VP') into :test_sal FROM DUAL;
    dbms_output.put_line('Total Sal:'||:test_sal);
    This is returning the below errors:
    SELECT total_income('AD_VP') into :test_sal FROM DUAL
    *+
    Error at line 0
    ORA-01036: illegal variable name/number
    dbms_output.put_line('Total Sal:'||:test_sal);
    Error at line 3
    ORA-00900: invalid SQL statement
    Could someone help me what could be the problem?? Thanks for your time...

    Dear,
    If everything you will do will be done inside PL/SQL (stored procedure or stored function) then you don't have to care about bind variable.
    When using PL/SQL (static SQL) you will never encounter issues related to bind variables. PL/SQL itself takes care of your code and uses bind variables behind the scene.
    The only situation where you have to look carefully to the use of bind variables within PL/SQL is when you use Dynamic sql into stored procedures or functions.
    So, see in the light of the above comment, if you have to care about returning your function into a bind variable?
    Best regards
    Mohamed Houri

  • How to load data into html:select using Struts ?

    How to load data into <html:select> using Struts ?
    I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
    please use:
    <html:select >
    <html:options />
    </html:select >
    Please help me. please detail it. thanks a lot.
    Message was edited by:
    tranminhman

    In order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
    here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
    Hope this helps...
    Chaitanya V

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • Insert data into multiple entities at once using a view object

    Hi,
    I'm trying to insert data into multiple entities at once using a view object, but unfortunately it doesn't seem to work. The two entities have a 1:1 association. I created a view object which contains both entities and I made sure they aren't read-only. But like I said it doesn't work, I can't insert data in both entities at once... :(
    Is this possible? And how (if it is)?

    Hi,
    I'm trying to insert data into multiple entities at once using a view object, but unfortunately it doesn't seem to work. The two entities have a 1:1 association. I created a view object which contains both entities and I made sure they aren't read-only. But like I said it doesn't work, I can't insert data in both entities at once... :(
    Is this possible? And how (if it is)? Peter:
    This is definitely supported and tested. Please send us the exception stack trace. You must running into other problems. A few things to note:
    A) You have to mark the entities as both updateable (not read-only) and not reference-only.
    B) If you're not seeing an exception stack, turn on diagnostic. Here is how:
    To turn on diagnostic, go to the IDE,
    1. Select the project.
    2. Do right mouse click and select "Project Settings..."
    3. On the Settings dialog, select Configurations/Runner.
    4. In the righthand side pane, you should see a textbox for "Java
    Options". Please add the following JVM switch:
    -Djbo.debugoutput=console
    Then, rerun. The run command should include
    -Djbo.debugoutput=console as in
    "D:\JDev9i\jdk\bin\javaw.exe" -Djbo.debugoutput=console -classpath ...
    You should now see a lot more output on the IDE's message window. Here you should see the exception stack trace.
    If you invoking your app directly from command prompt, just add "-Djbo.debugoutput=console" after your "java.exe".
    Thanks.
    Sung

  • Save data into multiple collections in Data Control

    Hi,
    In another post (https://forums.oracle.com/message/11094155) I asked how to merge data from multiple collections and show it into a table. FrankNimphius gave me the correct answer. I have now my table with data merged from some collections from my data control. But now I have the opposite request: the table must allow insert new rows and store the data in the model that is represented by all those collections.
    I saw this blog https://blogs.oracle.com/jdevotnharvest/entry/how_to_add_new_adf, and is great, but works with one collectionModel, but the idea is exactly the same, just with multiple collectionModels inside a parent one.
    The table is not bounded to one collectionModel, it is bounded to a List<MyObject> in my managed bean, so the built-in Create/Delete data control operations of the parent collection don't work.
    Another thing is: for me the model is a black box, I don't know anything about the model, I just know the datacontrol.
    Thanks!
    AAPDL

    Hi Frank,
    I tried calling the create built-in operation for each collection.
    I insert the row in the parent RowSetIterator and set it as the currentRow, then call the create operation. Later insert rows in each children and call the create operation of each one. Finally I call the commit operation.
    I tried and it worked, but you said that there would be a tricky part. I don't know if in the code bellow I did that, please let me know.
    In the bellow code the PersonasBinding2 is bind to the iterator of the parent collection, and the PersonaNaturalBinding2 and IdentificacionBinding2 are bind to the children collections.
                DCBindingContainer bindingContainer = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
                JUCtrlHierBinding personasBinding = (JUCtrlHierBinding)bindingContainer.findCtrlBinding("PersonasBinding2");
                RowSetIterator personasRowSet = personasBinding.getIteratorBinding().getRowSetIterator();
                Row nuevaFilaPersona = personasRowSet.createRow();
                nuevaFilaPersona.setAttribute("Id",15);
                nuevaFilaPersona.setAttribute("TipoPersona",0);
                OperationBinding createPersonaOperation = bindingContainer.getOperationBinding("CreatePersona");
                createPersonaOperation.execute();
                personasRowSet.setCurrentRow(nuevaFilaPersona);
                JUCtrlHierBinding personaNaturalBinding = (JUCtrlHierBinding)bindingContainer.findCtrlBinding("PersonaNaturalBinding2");
                RowSetIterator personaNaturalRowSet = personaNaturalBinding.getIteratorBinding().getRowSetIterator();
                Row nuevaFilaPersonaNatural = personaNaturalRowSet.createRow();
                nuevaFilaPersonaNatural.setAttribute("IdPersona",15);
                nuevaFilaPersonaNatural.setAttribute("PrimerApellido","PA");
                nuevaFilaPersonaNatural.setAttribute("PrimerNombre","PN");
                nuevaFilaPersonaNatural.setAttribute("SegundoApellido","SA");
                nuevaFilaPersonaNatural.setAttribute("SegundoNombre","SN");
                OperationBinding createPersonaNaturalOperation = bindingContainer.getOperationBinding("CreatePersonaNatural");
                createPersonaNaturalOperation.execute();
                JUCtrlHierBinding identificacionBinding = (JUCtrlHierBinding)bindingContainer.findCtrlBinding("IdentificacionBinding2");
                RowSetIterator identificacionRowSet = identificacionBinding.getIteratorBinding().getRowSetIterator();
                Row nuevaFilaIdentificacion = identificacionRowSet.createRow();
                nuevaFilaIdentificacion.setAttribute("IdPersona",15);
                nuevaFilaIdentificacion.setAttribute("NumeroIdentificacion","NI");
                nuevaFilaIdentificacion.setAttribute("TipoIdentificacion","TI");
                OperationBinding createIdentificacionOperation = bindingContainer.getOperationBinding("CreateIdentificacion");
                createIdentificacionOperation.execute();
                OperationBinding commitOperation = bindingContainer.getOperationBinding("Commit");
                commitOperation.execute()
    By other side, in the delete operation I guess that I must delete the childrens before the parent. I know that ADF supports the delete cascade operation only if in the database is configured in that way, but as I said, I don't know how is the model.
    Thanks!
    AAPDL

  • I need to divide selected row into multiple rows when i navigate  ADF 11g

    Hi
    I'm using jdeveloper 11.1.1.2.0 with ADF 11g.
    I need to divide selected row into multiple rows when i navigate to other page . Scenario - in first page i'm displaying some records with columns like empno , empstatus , empworkdepts ,curdepts
    Here empworkdepts gives the numeric number like no of departments work shifts 3 or 4 or 5. when i select any particular employee and fire next button to navigate next page.I have to divide the selected employee with same information into multiple times based on the empworkdepts value.
    empno empstatus empworkdepts curdept
    001 eds 2 TS
    002 hr 1 FO
    003 eds 4 TS
    *004 eds 3 TS*
    now i selected employee 004 , when i navigate to next page.
    Empno EmpStatus EmpWorkDepts CurDept
    004 eds 3 TS
    004 eds 3 TS
    004 eds 3 TS
    i did with java code in bean .but not stable .
    any help............
    thanks advance.............
    Edited by: user9010551 on May 5, 2010 10:48 PM
    Edited by: user9010551 on May 10, 2010 11:31 PM

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

Maybe you are looking for