Insert into... How to do it with a big enough request?

Hello

I want to store the result of this query in a table:

insert into dbsnmp.zetup_iostat (seq_ms, seq_ct, lfpw_ms, lfpw_ct, scat_ms, scat_ct, dpr_ms, dpr_ct, dprt_ms, dprt_ct, prevseq_ct, prevscat_ct, prevseq_tm, prevscat_tm, prevsec, prevlfpw_tm, prevlfpw_ct, prevdpr_ct, prevdpr_tm, prevdprt_ct, prevdprt_tm, prevdpw_ct, prevdpw_tm

prevdpwt_ct, prevdpwt_tm) values (seq_ms, seq_ct, lfpw_ms, lfpw_ct, scat_ms, scat_ct, dpr_ms, dpr_ct, dprt_ms, dprt_ct, prevseq_ct, prevscat_ct, prevseq_tm, prevscat_tm, prevsec, prevlfpw_tm, prevlfpw_ct, prevdpr_ct, prevdpr_tm, prevdprt_ct, prevdprt_tm, prevdpw_ct, prevdpw_tm

prevdpwt_ct, prevdpwt_tm)

Select

Round (seqtm/NULLIF(seqct,0), 2) seq_ms.

Round (seqct/NULLIF(Delta,0), 2) seq_ct.

Round (lfpwtm/NULLIF(lfpwct,0), 2) lfpw_ms.

Round (lfpwct/NULLIF(Delta,0), 2) lfpw_ct.

Round (scattm/NULLIF(scatct,0), 2) scat_ms.

Round (scatct/NULLIF(Delta,0), 0) scat_ct,

Round (dprtm/NULLIF(dprct,0), 2) dpr_ms.

Round (dprct/NULLIF(Delta,0), 2) dpr_ct.

Round (dprttm/NULLIF(dprtct,0), 2) dprt_ms.

Round (dprtct/NULLIF(Delta,0), 2) dprt_ct.

prevseq_ct, prevscat_ct, prevseq_tm, prevscat_tm, prevsec, prevlfpw_tm, prevlfpw_ct

prevdpr_ct, prevdpr_tm, prevdprt_ct, prevdprt_tm, prevdpw_ct, prevdpw_tm

prevdpwt_ct, prevdpwt_tm

Of

(select

sum (decode (event, 'db file sequential read', round(time_waited_micro/1000) - & prevseq_tm_var, 0)) seqtm,.

sum (decode (event, "db-reading of scattered files", round(time_waited_micro/1000) - & prevscat_tm_var, 0)) scattm,.

sum (decode (event, 'parallel writing to log file', round(time_waited_micro/1000) - & prevlfpw_tm_var, 0)) lfpwtm,.

sum (decode (event, 'db file sequential read', round(time_waited_micro/1000), 0)) prevseq_tm,.

sum (decode ("db-reading of scattered files", event, round(time_waited_micro/1000), 0)) prevscat_tm,.

sum (decode (event, 'parallel writing to log file', round(time_waited_micro/1000), 0)) prevlfpw_tm,.

sum (decode (event, 'db file sequential read', total_waits - & prevseq_ct_var, 0)) seqct,.

sum (decode (event, "db-reading of scattered files", total_waits - & prevscat_ct_var, 0)) scatct,.

sum (decode (event, 'parallel writing to log file', total_waits - & prevlfpw_ct_var, 0)) lfpwct,.

sum (decode (event, 'db file sequential read', total_waits, 0)) prevseq_ct,.

sum (decode ("db-reading of scattered files", event, total_waits, 0)) prevscat_ct,.

sum (decode (event, 'parallel writing to log file', total_waits, 0)) prevlfpw_ct,.

sum (decode (event, 'direct path read', round(time_waited_micro/1000) - & prevdpr_tm_var, 0)) dprtm,.

sum (decode ('direct path read', event, round(time_waited_micro/1000), 0)) prevdpr_tm,.

sum (decode (event, 'direct path read', total_waits - & prevdpr_ct_var, 0)) dprct,.

sum (decode ('direct path read', event, total_waits, 0)) prevdpr_ct,.

sum (decode (event, 'Write direct path', round(time_waited_micro/1000) - & prevdpw_tm_var, 0)) dpwtm,.

sum (decode (event, 'Write direct path', round(time_waited_micro/1000), 0)) prevdpw_tm,.

sum (decode (event, 'Write direct path', total_waits - & prevdpw_ct_var, 0)) dpwct,.

sum (decode (event, 'Write direct path', total_waits, 0)) prevdpw_ct,.

sum (decode (event, ' path direct writing temp', round(time_waited_micro/1000) - & prevdpwt_tm_var, 0)) dpwttm,.

sum (decode (' path direct writing temp', event, round(time_waited_micro/1000), 0)) prevdpwt_tm,.

sum (decode (event, ' path direct writing temp', total_waits - & prevdpwt_ct_var, 0)) dpwtct,.

sum (decode (' path direct writing temp', event, total_waits, 0)) prevdpwt_ct,.

sum (decode (event, 'the direct path read temp', round(time_waited_micro/1000) - & prevdprt_tm_var, 0)) dprttm,.

sum (decode (event, "the direct path read temp", round(time_waited_micro/1000), 0)) prevdprt_tm,.

sum (decode (event, 'the direct path read temp', total_waits - & prevdprt_ct_var, 0)) dprtct,.

sum (decode (event, "the direct path read temp", total_waits, 0)) prevdprt_ct,.

Delta to_char (sysdate, 'SSSSS') - & prevsec_var,

to_char(sysdate,'SSSSS') prevsec

Of

v$ system_event

where

test of ('db file sequential read',

"scattered files db reading."

"direct way read temp."

"direct path write temp."

"direct path read."

"Write direct way."

"log file parallel write")

) ;

create table iostat_table)

number of seq_ms

number of seq_ct

number of lfpw_ms

number of lfpw_ct

number of scat_ms

number of scat_ct

number of dpr_ms

number of dpr_ct

number of dprt_ms

number of dprt_ct

number of prevseq_ct

number of prevscat_ct

number of prevseq_tm

number of prevscat_tm

number of prevsec

number of prevlfpw_tm

number of prevlfpw_ct

number of prevdpr_ct

number of prevdpr_tm

number of prevdprt_ct

number of prevdprt_tm

number of prevdpw_ct

number of prevdpw_tm

number of prevdpwt_ct

number of prevdpwt_tm

);

I get

ERROR on line 4:

ORA-00933: SQL not correctly completed command.

When you run the query.

How well do things?

Concerning

3

Delete 'values' of the insert bit.

insert into iostat_table...

Select

Tags: Database

Similar Questions

  • Double insert into, how to get the last insert id

    Hi all

    I need to insert some values into 2 tables, and on the second Board, I put the last id inserted in the first table. I actually did more the thing, but it does not work:

    insert into ADDRESS (id, street, neighborhood, zip code, city, idcountry, phonenumber, fax, phone, mail, post number) values (",", ",", ",", "," "," ");
    insert into samplecenter (ID, idaddress, samplecentername) values (", * IDENT_CURRENT ('ADDRESS') *,"GENERAL - CO");

    -What someone could help me.

    Thank you very much.
    Jarod.

    You must use a sequence.

    for example

    create sequence address_seq
    minvalue 1
    maxvalue 1000000000000000
    start with 1
    increment by 1
    nocache;
    
    insert into ADDRESS (id, street, area, zipcode, town, idcountry, phonenumber, faxnumber, gsm, mail, post)
      SELECT
             address_seq.NEXTVAL,'','','', '', '', '', '', '', '', ''
        FROM dual;
    
    insert into samplecenter (ID, idaddress, samplecentername) values ('',address_seq.CURRVAL,'GENERALE - CO');
    
  • Insert into a table... with order by

    Oracle 10.2.0.3

    I want to insert into a table, records from another table ordered in a certain way. We want a specific order that we want the data grouped the disk.

    No idea why it does not work?
    create table test_a (
         id number primary key,
         value1 varchar2(20));
    
    insert into test_a (id, value1) values (1,'ccc');
    insert into test_a (id, value1) values (2,'bbb');
    insert into test_a (id, value1) values (3,'aaa');
         
    create table test_b (
         id number primary key,
         value1 varchar2(20));
    
    insert into test_b (id, value1) (select id, value1 from test_a order by value1)
                                                                   *
    ERROR at line 1:
    ORA-00907: missing right parenthesis     
    If I leave aside the order, it works fine...
    SQL> insert into test_b (id, value1) (select id, value1 from test_a);
    
    3 rows created.
    This does not work either:
    create table test_b as (select id, value1 from test_a order by value1)
                                                          *
    ERROR at line 1:
    ORA-00907: missing right parenthesis

    Lose the parenthesis.

    TUBBY_TUBBZ?create table test_b as select id, value1 from test_a order by value1;
    
    Table created.
    
    Elapsed: 00:00:00.02
    

    Or

    TUBBY_TUBBZ?
    insert into test_b select id, value1 from test_a order by value1;
    
    3 rows created.
    
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?
    
  • How to load xml with base64 big element using sqlldr

    Hello
    I'm trying to load xml data into Oracle 10 g 2. I want to use tool standard sqlldr if possible.
    (1) I recorded my schema successfully:
    -Put the 6kbytes schema in a table
    - and
    DECLARE
    schema_txt CLOB.
    BEGIN
    SELECT the text IN schema_txt patterns;
    DBMS_XMLSCHEMA.registerschema ("uddkort.xsd", schema_txt);
    END;
    -Success: I can create table like:
    CREATE TABLE XMLTYPE XmlTest
    XMLSCHEMA 'uddkort.xsd '.
    ELEMENT 'profile '.
    ;
    -USER_XML_TABLES shows:
    XMLSCHEMA, SCHEMA_OWNER, NOM_ELEMENT, TABLE_NAME, STORAGE_TYPE
    "XMLTEST", "uddkort.xsd", "THISE", "profile", "OBJECT-RELATIONAL".

    (2) how can I load XML data into that?
    -An element of the schema is < xs: element name = "billede" type = "xs: base64Binary" minOccurs = "0" / >
    -This data field may be 10kbytes or more

    I tried many control files - search the net but no luck so far.
    Any suggestions?
    / Christmas, DK

    I regret - it seems, Miss me some basic understanding here (XBD is new to me...):

    Reread this part of the documentation on the XML to mappings of SQL types:
    http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14259/xdb05sto.htm#sthref831

    When you save the relational storage schema object, Oracle creates SQL object types to support the underlying structure.
    In particular (see table 5-6 in the link), XS: base64Binary is mapped to a compatible SQL binary data type: RAW (default), or BLOB (if we use the annotation).

    In my example, the generated object type is:

    SQL> desc "image888_T"
     Nom                                       NULL ?   Type
     ----------------------------------------- -------- ----------------------------
     SYS_XDBPD$                                         XDB.XDB$RAW_LIST_T
     name                                               VARCHAR2(4000 CHAR)
     content                                            BLOB
    

    I don't understand how this can be (is) done automatically?

    When you load an XML instance in the table, the contents of the string encoded in base64 is automatically converted into format binary original and stored as a BLOB (that's works the mapping).
    Then, when you run:

    select extractvalue(t.object_value, '/image/content') from images_table t;
    

    It follows a BLOB column containing the original image, not the string base64, so you won't need a converter.

  • How to manage them with not not enough memory?

    If I open too much demand, it pops up a window not having enough memory,

    Increase virtual memory size help?

    Anyone have any suggestions on how to handle this situation?

    Thanks in advance for your suggestions

    Referring to the following items.

    http://support.Microsoft.com/kb/308417

    How to manually optimize the memory usage

    You really need to stop fixing on memory. We have already established that the memory is currently NOT a problem. We have identified the following two issues:
    1 Excel, for some reason, uses far too much of your CPU cylces (no memory).
    2. There is at least one instance of explorer.exe by using too much CPU cycles (even if your PC was supposed to be inactive). You MUST exclude a malware infection before anything else!
    I offered you advice:
    1 post in the forum of users of Excel.
    2. switch to another program of worksheet if you are unable to solve your problem of Excel.
    3 disable indexing (which said you you would).
    4 search for malicious software.
    It's to you now.
  • How the values to insert into the table with the command insertion

    Dear all
    can someone tell me how the values to insert into the table with the command insert, I want to say I always use command insert behind my forms on what shutter release button press the button of my save, but today I had a form of 6i, where controls (textbox, combo, etc.) are delineated with directly the table with I guess than the Properties Windows , I created 3 columns in tand 3 text on forms fields, now kindly tell me how to do this fields to fill and do not insert command, I mean directly defined with table column



    Please help me its urgent

    Hello

    If the block is based on your database table, just committed the shape, then changes will be applied to the database.

    François

  • How do I update my laptop so he sees my micro sd card, I inserted into my laptop, but it did not come

    How I update my laptop so he sees my micro sd card, I inserted into my laptop, but it didn't come up.

    help much appreciated.

    Hello

    Thank you for visiting Microsoft Community.

    According to the description, I understand that the problem with you want to update the laptop so that it can recognize the micro SD card in the computer.

    Of course, I understand the inconvenience and will try my best to help you.

    In order to understand the issue more clearly, please provide me the following information.

    1. What exactly happens when you insert the micro SD card in the laptop?
    2. Do you receive an error message? If Yes, what is the exact error message and the error code?
    3. What is the brand and model of the laptop?
    4. How you try to connect the SD card? Is inserting into the card reader on your computer or you are using an external card reader?
    5. You see an error message or the exclamation point in Device Manager when you connect the SD card?

    I suggest you follow the steps how to check for the exclamation point in Device Manager.

    1. Click on Start and go to Run.
    2. In the prompt to run it, type devmgmt.msc , and then click OK.
    3. Device Manager opens.
    4. In Device Manager, double-click the device category.
    5. Check the yellow exclamation point against each category.

    It is possible that this problem would have occurred if the chipset drivers are not updated in the system.

    I would suggest trying the following methods and check if it helps.

    Method 1:

    I suggest you to update the Chipset drivers on the manufacturer's Web site and check if it helps.

    If the problem persists, please follow method 2.

    Method 2:

    Try to run the built-in troubleshooting utility and check if it works.

    Open the hardware and devices Troubleshooter, please follow the steps in the link provided below.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    Note: If your computer is having problems with a recently installed device or other hardware, try to use the hardware and peripheral troubleshooting tool to solve the problem. It checks the common issues of interest and ensures that a new device or hardware connected to your computer has been installed correctly.

    I hope this information is useful.

    Please let us know if you need more help, we will be happy to help you.

    Thank you.

  • How to perform an addition of column values in an insert query that would insert in the 3rd column, and the values how to insert into another table.

    I have two tables (2) RESULT TAB (1)

    CREATE TABLE TAB

    (

    NUMBER OF SNO

    A NUMBER,

    B THE NUMBER.

    NUMBER OF THE SUM

    );

    CREATE AN ARRAY OF RESULT

    (

    NUMBER OF SNO

    NUMBER OF THE SUM

    )

    my doubt is:

    (1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.

    SNO   A  SUM           

    1 100 150 250

    2 300 100 400

    I want to like this, it is possible with single insert query?


    (2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?

    in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem

    First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.

    Second, you might solve your problems with bind variable:

    Insert tab

    (sno, a, b, sum)

    values

    (: SNO,: A: B: A + B :))

    You should not use sum as column name because it is a reserved word.

    More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:

    Start

    insert into tab values (: SNO,: A: B: A + B :);)

    insert into result values (: SNO,: A + B :);)

    end;

    If you meet sno from a sequence, you could do something like this:

    Start

    insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.

    insert into result values (: SNO,: A + B :);)

    end;

    Hope that helps,

    dhalek

  • How to INSERT INTO a specific line?

    I have a form with a calendar on the top, below is a list of items to each with a checkbox.

    This is a wonderful Visual-

    Calendar

    Box | Col | Col | Col

    Box | Col | Col | Col

    Box | Col | Col | Col

    I want so you select the date and it passed into the database on the same line as that (definitely a multiple is better) that has been verified by the user.

    I was trying an INSERT INTO statement with a WHERE statement, but apparently you can do. So if I can use a WHERE with INSERT IN, how can I identify which line to insert the info?

    It is currently passing dates, but it creates a new line.

    I didn't post the code is neccisary power for this question, but if anyone wants to see what it let me know and I'll post it.

    Thank you!

    An INSERT operation will be * always * do exactly that, insert rows in a table.  It's sounds like maybe you should do a UPDATE operation instead.  Can you give a little more explanation on the design of database and table that represents each row of the table?  Maybe that walk through the interaction of the user more too?  And including the corresponding code is generally useful.

    -Carl V.

  • How to select a rectangle that was inserted into the Clipboard?

    For inserting images batch execution, I am faced with this situation:

    There is a document with a large number of paragraphs containing a file name of image as "034.tif."

    I have a rectangle that has the exact size and style how the images should be placed.

    I copy it to the Clipboard.

    Then I run a script which seeks names of image files and replaces them with the contents of the Clipboard (the desired rectangle).

    If the script ends here, the cursor is placed directly after the just inserted rectangle.

    How the script can select the rectangle on the left of the slider so that the image is inserted into the rectangle instead of after him?

    The script looks like this:

    copy the rectangle desired the Clipboard manually

    app.changeGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.findWhat = "002.tif";
    app.changeGrepPreferences.changeTo = "~ c";
    myPlace var = app.changeGrep ();

    This is the point where I have to select the rectangle that changeGrep just inserted

    concerned about myPlace [0] ('002.tif', false);

    Your script as written will replace all occurrences of the text in all documents open with the contents of the Clipboard, sort of 'selection', the result could be problematic. However, you can get an array of references to the result like this:

    var myPlaces = app.changeGrep ();

    for (var j = 0; myPlaces.length > j; j ++) {}

    var myRect = myPaces [j] .rectangles [0]; assume that the content of the Clipboard was indeed a rectangle

    var myRect.place ('002.tif', false);

    }

    Even though I'm doubtful that you can simply pass the name of made it to the set command. I myself spend a full file reference.

    The point here is that the changeGrep command returns an array of references to text for the amended text. Each of your texts has changed (even if there is only one) is a character containing an inline or anchored, rectangle that is referenced as the first member of the collection of rectangles by the character.

    Dave

  • INSERT INTO table (columns...) with table_tmp in select... ...

    Hi guru,.

    Is less than a valid SQL | Statement of PLSQL? or several instructions and what it does?

    insert into table (col1, col2, col3, col4)
    with table_tmp as
    (select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
    from table1, table2 t2 t1
    where t1.id = t2.id
    and t2.start > sysdate()
    )
    Select tcol1, tcol2, tcol3, tcol4
    of table_tmp tt1, table3 t3
    where tt1.id = tt3.id;

    I checked the SQL quick reference card and don't see anything similar to this... I wonder where I can find a better book of reference for the syntax.

    Thanks in advance
    KH

    user5885318 wrote:
    Is less than a valid SQL | Statement of PLSQL? or several instructions and what it does?

    It inserts data into the table

    insert into table (col1, col2, col3, col4)

    (ok, ignoring the fact that you can't have a table named table)

    using the select statement located below

    with table_tmp as
    (select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
    from table1, table2 t2 t1
    where t1.id = t2.id
    and t2.start > sysdate()
    )
    Select tcol1, tcol2, tcol3, tcol4
    of table_tmp tt1, table3 t3
    where tt1.id = tt3.id;

    I checked the SQL quick reference card and don't see anything similar to this... I wonder where I can find a better book of reference for the syntax.

    SQL reference documentation contains the complete syntax for Oracle SQL, so how can you find a better reference for the syntax. I think your concept to better is all simply because you are not familiar with things and don't know where to find things. SQL is a huge beast, so you cannot expect to find things very quickly in all cases, especially if you don't really know what you are looking for.

    I'm guessing you are struggling to find information about the clause "WITH"?

    It is called subquery factoring and lie under the SELECT statement in the SQL reference:

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_10002.htm#i2161315

    An equivalent statement without the WITH clause (using your insert as a base statement)...

    insert into table(col1, col2, col3, col4)
    select tcol1, tcol2, tcol3, tcol4
    from (select ccol1, ccol2, ccol3, ccol4, ccol5, ccol6
          from table1 t1, table2 t2
          where t1.id=t2.id
          and t2.start > sysdate()
         ) tt1
         , table3 t3
    where tt1.id=tt3.id;
    

    The done WITH clause takes the subquery in the main query. This is useful if the same subquery is needed more than once in the main query.

  • Insert into the table with the help of the string

    Hi all

    I have a string with commas.
    Is it possible to insert the values of string directly in the table in each column.

    For ex:

    v_str = "10,20,30,40";

    insert into v_tab (col1, col2, col3, col4) values (10,20,30,40);

    I would like to pass v_str instead of numbers in the insert statement.

    Thank you

    I try with this simple block
    DECLARE
      v_char VARCHAR2(1000) := '10,20'; 
      v_query VARCHAR2(3000); 
    BEGIN
      v_query := 'INSERT INTO week_bkgs(week_num, product_bkg) VALUES (:x)'; 
      EXECUTE IMMEDIATE v_query USING v_char; 
    END; 
    /
    How can achieve us if
    the column a. data types are the NUMBER
    b column data types are VARCHAR2

    Published by: polasa on October 30, 2008 21:20

    Try this

    SQL> set lines 100
    SQL> desc student;
     Name                                                  Null?    Type
     ----------------------------------------------------- -------- ------------------------------------
     NAME                                                           VARCHAR2(100)
     STUDENT_NUMBER                                                 NUMBER(10)
    
    SQL> declare
      2     str_v   varchar2(100) :='''abc'',1';
      3  begin
      4     execute immediate 'insert into student values ('|| str_v ||')';
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from student where student_number=1
      2  ;
    
    NAME                 STUDENT_NUMBER
    -------------------- --------------
    abc                               1
    
    SQL> 
    
  • How to insert into DB tables of bean

    I want to insert in some custom tables of bean. How

    (1) get the connection?

    (2) can someone please give me the code?

    (3) how to engage? or the transaction AM will assign commit?

    (4) I intend to do so in the following manner, but I am getting error "getDBTransaction method not found" even if I imported all needed packages

     

      DBTransaction trans = getDBTransaction();

          CallableStatement statement = null;

          int rows = 0;   

          String plsql =

                " BEGIN "

              + " INSERT INTO EMPLOYEES "

              + " VALUES (?,?,?);"

              + " END; ";

           

          statement = trans.createCallableStatement(plsql, 3);

          try{

              statement.setInt(1, empName);

              statement.setInt(2, empId);

    statement.setInt(3, deptId); 

             rows = statement.executeUpdate();

    (5) I'm doing right thing by inserting Backing Beans? Ideally, I know we do h, but how I read AM screen values?

    All the world done this before? any help?

    Thank you

    Rahul

    Do not like that!

    I would do the following:

    -Create an entity object, then a view based on this object to insert lines.

    -Write an Application Module method that gets values that must be inserted as parameters. Get the VO, create a new line, set the values and insert the line.

    -To make this method available in the interface of the AM AM.

    -Create the binding of the method in the user interface.

    -Use this method within managed bean and run the validation using binding validation operation.

    I hope this helps.

    Kind regards

    Linda

  • How to insert into a GLOBAL TEMPORARY TABLE and get the data from it?

    The requrement is
    Split the string ENTRY point on the base and store it in a Collection. And the values of the collection will be stored in a global temporary table. Then, I'm updating some other table based on the data from the temporary table.

    There is in fact no error message. But there is no data in the temporary table and also no change in the update statement

    First of all, I'm creatiing a global temporary table only once outside the procedure.

    CREATE GLOBAL TEMPORARY table GLt (data_element number)


    create or replace procedure test_proc (p_in_string VARCHAR2) is
    i the number: = 0;
    number of POS: = 0;
    CLOB lv_str: = p_in_string;
    p_delim VARCHAR2 (1): = ', ';

    TYPE t_array IS TABLE OF VARCHAR2 (20) INDEX directory.
    t_array channels;

    BEGIN

    -cutting of string input and store in the strings (i) collection

    POS: = instr (lv_str, p_delim, 1, 1);
    WHILE (pos! = 0) LOOP
    i: = i + 1;
    Strings (i): = substr(lv_str,1,pos-1);
    lv_str: = substr (lv_str, pos + 1, length (lv_str));
    POS: = instr (lv_str, p_delim, 1, 1);
    IF pos = 0 THEN
    Strings (i + 1): = lv_str;
    END IF;
    END LOOP;

    run immediately "drop table TWG;
    run immediately ' CREATE GLOBAL TEMPORARY table (data_element number) TWG on commit preserve rows ";

    FORALL i in strings.first... Strings.Last
    INSERT INTO VALUES TWG (strings (i));
    commit;

    Update first_tbl set PIN is "XXX" where first_col in (select data_element from TWG);.
    commit;

    END test_proc;

    Published by: cedric b on January 25, 2013 12:59

    Remove the two execute immediate line. They are wrong.

    And then use the table in your code that you created at the beginning. The name is GLT.
    And delete the first commit. This validation would empty the temporary table of GLT.

    You get an error? Or it does not work as expected?

    Also, show how you call the procedure.

    Published by: Sven w. January 25, 2013 14:45

  • Insert Into with subquery less 00947. 00000 - not enough of"values."

    I'm writing an insert using LESS but can't seem to get the syntax right or it will even work?

    I use less because it is more accurate with the data in the table.

    INSERT INTO PROVIDER_TESTS (PROVIDER_TESTS_ID, PROVIDER_ID, ALL_CODE_ID, ORDINAL, GENERIC_DESCRIPTION, FASTING_HOURS, EMERGENCY, ABN_INDICATOR, PROCEDURE_ID, COMPENDIUM_ID)
    VALUES (SEQ_PROVIDER_TESTS_ID. NEXTVAL, 2395350,)
    (SELECT ALL_CODE_ID, ORDINAL, GENERIC_DESCRIPTION, FASTING_HOURS, EMERGENCY, ABN_INDICATOR, PROCEDURE_ID, COMPENDIUM_ID
    OF PROVIDER_TESTS WHERE PROVIDER_ID = 921
    LESS
    SELECT ALL_CODE_ID, ORDINAL, GENERIC_DESCRIPTION, FASTING_HOURS, EMERGENCY, ABN_INDICATOR, PROCEDURE_ID, COMPENDIUM_ID
    OF PROVIDER_TESTS WHERE PROVIDER_ID = 2395350));

    Thank you

    This is because the values clause only supports scalar subquery expressions. This means that the query may return only as a column and a row. You should be able to restructure your query like this:

    INSERT INTO PROVIDER_TESTS
    ( PROVIDER_TESTS_ID
    , PROVIDER_ID
    , ALL_CODE_ID
    , ORDINAL
    , GENERIC_DESCRIPTION
    , FASTING_HOURS
    , URGENCY
    , ABN_INDICATOR
    , PROCEDURE_ID
    , COMPENDIUM_ID
    )
    SELECT SEQ_PROVIDER_TESTS_ID.NEXTVAL
         , 2395350
         , a.*
    FROM
    (
         SELECT ALL_CODE_ID
              , ORDINAL
              , GENERIC_DESCRIPTION
              , FASTING_HOURS
              , URGENCY
              , ABN_INDICATOR
              , PROCEDURE_ID
              , COMPENDIUM_ID
         FROM PROVIDER_TESTS
         WHERE PROVIDER_ID =921
         MINUS
         SELECT ALL_CODE_ID
              , ORDINAL
              , GENERIC_DESCRIPTION
              , FASTING_HOURS
              , URGENCY
              , ABN_INDICATOR
              , PROCEDURE_ID
              , COMPENDIUM_ID
         FROM   PROVIDER_TESTS
         WHERE PROVIDER_ID = 2395350
    ) a;
    

Maybe you are looking for

  • How to configure microsoft exchange account

    How to configure Microsoft Exchange account on iPhone. I'm getting a problem while creating a Microsoft Exchange account on the iPhone. Can any body tell me How to set up a mail in iPhone because I want to set up an account for Microsoft exchange on

  • I bought an album and it shows in iTunes, but will not let me burn to disc

    I have a 6splus iphone I bought an album on my music and it shows in my lap top and plays ituneson but will not let me burn to disc says its icloud in music? and download to pc? Help < re-titled by host >

  • "Toshiba Places" does not work

    My Toshiba RL958 TV is now a failure load Toshiba places after worked OK since I bought it. The Wired internet connection is good because the Media Guide Downloads okay and I updated the firmware with a download. I also did a factory reset before I u

  • What is the Standard warranty on desktop computers and is it free?

    I'll buy a new Tower of this evening of Best Buy, and even though I know that I can buy a scope here warrantly, I need to know what than the standard warranty for a HP desktop computer and I need to check that this is part of the purchase of office a

  • How to disable the button to remove the application.

    I want to implement a feature to disable a button Delete a particular application so that the user can not remove it applications. How can I implement this.