What is the purpose of the subquery at the end of a multitable insert?

I am learning about multitable inserts and am confused about the required subquery at the end of the insert statement. Take the following for example:
INSERT ALL
INTO t1 VALUES('value1')
INTO t1 VALUES('value2')
SELECT 1 FROM DUAL;
What is the subquery "SELECT 1 FROM DUAL" for? The subquery must be there; and it can be any select statement, not just the simple one I have here. Does the subquery simply act as a termination for the inserts?

>
INSERT ALL
INTO t1 VALUES('value1')
INTO t1 VALUES('value2')
SELECT 1 FROM DUAL;
What is the subquery "SELECT 1 FROM DUAL" for?It is there for returning a single row from DUAL. Oracle evaluates the rows returned by the subquery and executes each of those "INTO" clauses once for each row returned by the subquery.
Thus, each of the "INTO ... VALUES" clause is evaluated once for that 1 row returned by DUAL.
Alternatively, you could write just one "INTO...VALUES" clause and return multiple rows in the subquery, thusly:
SQL>
SQL> drop table t1;
Table dropped.
SQL> create table t1 (x varchar2(10));
Table created.
SQL>
insert all
into t1 values (x)
select 'value1' as x from dual union all
select 'value2'      from dual union all
select 'value3'      from dual;
3 rows created.
SQL>
SQL> select * from t1;
X
value1
value2
value3
SQL>
SQL>
... Does the subquery simply act as a termination for the inserts?Well, no. The semi-colon character (";") or a forward slash character ("/") on the first column of the last line acts as the SQL terminator.
The subquery is there because Oracle needs some data to evaluate, process as per the conditions and insert into (one or more) tables.
Check the link to the documentation where it is explained in detail:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#SQLRF01604
isotope

Similar Messages

  • What is the purpose of GL account in the account assignment tab of PO scree

    hi,
    in the purchase order screen, in the account assignment tab, there is a field labelled as GL account. May i know what is the purpose of this gl account because as far as i am concerned we need to specify the vendor gl account (in the vendor master) and the stock account and GR/IR account in BSX and WRX transactions in OBYC respectively.
    In that case what is the purpose of specifyin a GL account in the purchase order account assignment tab?

    Hi,
    The fact is quite simple - When you are buying the material, you can be able to define if this is for inventorization or for consumption.  If it is for inventory replenishment, then the stock account will be debited during GR posting.  Otherwise, P&L account will be debited.  The G/L account you have seen in your PO is always needed in case of direct consumption.  At the time of GR posting, the posting lines will be -
    1)   For stock item:
    Dr     Stock Account (BSX Transaction/Event Key);
    Cr     GR/IR Clearing Account (WRX Transaction/Event Key)
    2)   In case of non-stock item:
    Dr     P&L Account (GBB/xxx Transaction/Event Key where xxx is defined in the 'Account Modifier field of the related account assignment category setting in OME9 transaction - which is seen in the PO);
    Cr    GR/IR Clearing Account (WRX Transaction/Event Key).
    Cheers,
    HT

  • What is the purpose of "Adobe Credential " in the server site ?

    Hi,
    I have read some installation pre-requisite in the server site for implement SAP Adobe Interactive form in the FAQ :
    1. SAP Web AS 6.40 Java (for all scenarios)
    2. SAP Web AS 6.40 ABAP (if you are looking at high-volume print scenarios)
    3. Adobe document services (run-time component)
    4. Adobe Credential (for creating interactive PDF forms).
    could you please give me some enlighteening on the number 4 ? is that compusory ?
    Thank You and Best Regards
    Fernand Lesmana

    Hi Fernand,
    4. Adobe Credential (for creating interactive PDF forms).
    could you please give me some enlighteening on the number 4 ? is that compusory ?
    The type of credential they are referring to in 4) is a Readers Right credential. Basically it is a special file of the form PKCS #12 that you install on your ADS system to enable your users using interactive forms to be able to save data into the form using Adobe Reader. It's a usage rights credential, without which you will not be able to save data in a PDF document. You will need to decide from a business point of view whether it is required or not as it is not compulsory unless you use interactive forms.
    You also get other credentials for digital signatures and certification.
    Regards,
    Nelis

  • What is the purpose of odbcinst.ini?

    I have installed unixODBC.x86_64 (2.2.14) and mysql-connector-odbc-5.3.4-linux-el6-x85-64 on Oracle Linux Server 6.5 64 bit with Oracle 12c and MySQL Community Server 5..6.14.
    I wonder what is the purpose of odbcinst.ini since the odbc driver is already configured in odbc.ini.
    ODBC.ini has the following configuration:
    [myodbc5]
    Driver          = /tmp/shared/mysql-odbc/lib/libmyodbc5w.so
    DATABASE        = peter
    DESCRIPTION     = MySQL ODBC 5.3 Unicode Driver
    SERVER          = localhost
    UID             = peter
    PASSWORD        = peter
    SOCKET          = /var/lib/mysql/mysql.sock

    This is really a question more specific to the ODBC driver itself and really should be asked in that forum.
    The purpose of an odbcinst.ini file is to list all installed drivers. The syntax is; a name followed by a property which tells us the drivers file name. For example;
    [Sybase 11]
    Comment = Super Duper Sybase Server
    Driver =  /usr/lib/libsybase.so.11
    Setup = /usr/lib/libsybaseS.so.11
    FileUsage = 1
    Botton line is you need to have a working ODBC connection for DG4ODBC to work.
    Regards,
    Matt

  • I need to set up an expense form so that our consultant can "filter" by customer type, program type, and finally the purpose of the trip. For instance: the customer types are churches, schools, organizations. The program type would be fund raising, gift p

    I need to set up an expense form so that our consultant can "filter" by customer type, program type, and finally the purpose of the trip. For instance: the customer types are churches, schools, organizations. The program type would be dependent on the customer type selection from the first list. Some examples would be: fund raising, gift planning, surveys, and others. The purpose of the trip would be dependent on the program type selected from the second list. Some examples of trip purposes would be: presentation, design, prospecting. Further, the purpose of trip selection from the third drop-down box would then have to determine the values of other fields by expense type: such as commission, airfare, hotel. etc. I've tried pop-up menu but can't figure out how to "select" from the final popup list and have it populate a field for the purpose of the trip. I've tried to look at the JavaScript examples for dependent drop-down boxes, but can't find any that quite fit what I'm trying to accomplish. I am very new to all of this. No training in writing Javascripts - just trying to wing it. The form has to be very simple for our consultants to use, but also give our office the detail we need to process through the correct account numbers. I would appreciate any detailed step-by-step instructions - kind of a javascript for dummies type of info. HELP!

    An AcroForm is the name given to the type of PDF form that you create in Acrobat. An XFA form is the type of form that you create in LiveCycle Designer. Although they are both PDF files, they are very different structurally and have significant;y different scripting models. So pay attention to the information on AcroForms and ignore anything about XFA. Be sure to get the sample PDF forms so you can look at how it works and where the scripts are placed.
    What you want to do will require scripting, and if you don't have the experience and are unable to use the information in the tutorials to create what you want, you might consider getting someone who has experience do this for you. I'll often suggest code if I can do so quickly, but what you want requires more than a few minutes.

  • While defining a columnar table, what is the purpose of column store type

    Hi folks
    I have two questions related to columnar table definition.
    1. What is the purpose of column store type.
    While defining a columnar table, what is the purpose of column store type (STRING ,CS_FIXEDSTRING,CS_INT etc) , when I define a table using the UI I see that the column is showing STRING but when I goto EXPORT SQL it does not show.  Is this mandatory or optional ?
    2.VARCHAR Vs. CHAR - In the UI when I create the table I do not see the CHAR option , but I do see lot of discussion where people are using CHAR for defining the columnar table. Not sure why UI dropdown does not show it. I also read that we should avoid using VARCHAR as those columns are not compressed, is that true, I thought the column store gives compression for all the columns. Are there certain columns which cannot be compressed .
    Please let me know where I can find more information about these two questions.
    Poonam

    Hi Poonam
    the CS_-data types are the data types that are used internally in the column store. They can be supplied but it is not at all required or recommended to do so.
    SAP HANA will automatically use the correct CS_-data type for every SQL data type in your table definitions.
    To be very clear about this: don't use the CS_-data types directly. Just stick to the SQL data types.
    Concerning VARCHAR vs CHAR: fixed character data types are not supported anymore and don't show up anymore in the documentation.
    I have no idea why you believe that VARCHAR columns are not compressed but this is just a myth.
    create column table charcompr (fchar char(20), vchar varchar(20));
    insert into charcompr (
        select lpad ('x', to_int (rand()*20), 'y'), null from objects cross join objects);
    -- same data into both columns
    update charcompr set vchar = fchar;
    -- perform the delta merge and force a compression optimization
    merge delta of charcompr;
    update charcompr with parameters ('OPTIMIZE_COMPRESSION' ='FORCE');
    -- check the memory requirements
    select COLUMN_NAME, MEMORY_SIZE_IN_TOTAL, UNCOMPRESSED_SIZE, COUNT, DISTINCT_COUNT, COMPRESSION_TYPE
    from m_cs_columns where table_name ='CHARCOMPR'
    COLUMN_NAME    MEMORY_SIZE_IN_TOTAL    UNCOMPRESSED_SIZE   COUNT   DISTINCT_COUNT  COMPRESSION_TYPE
    FCHAR       3661                    70285738            6692569 20              RLE
    VCHAR       3661                    70285738            6692569 20              RLE
    We see: compression and memory requirements are the same for both fixed and variable character sizes.
    - Lars

  • What is the purpose of Destination Function on Submit Button?(Doesn't work)

    Hi Gurus,
    There is a property "Destination Function" on Submit buttons.
    What is the purpose of this field.
    I tried setting some values here expecting following behavior in order:
    1. Process Form Request will get executed.
    2. User will be navigated to the OAF page related to the Destination Function.
    Destination Function property probably point to setInvokeFunction method of the OASubmitButtonBean.
    Please advise on this.
    Thanks and Regards,
    Prince

    Question 2. What is the purpose of View Instance on Submit Button? Is it there for BoundValues? Any examples how can we use this?
    Question 3. Related to Question 2, What is the purpose of View Instance and View Attribute on Button?

  • What is the purpose of open/close connection data socket?

    Hello everyone,
    I am writing and reading values in OPC Server through data socket. What is the purpose of open/close connection data socket when writing /reading a value?  Without the open/close connection element, it still work correctly. I am writing values in the server thru event stucture.I do not need any buffered reading or writing. What will happen if I didnt not use the open/close connection? Maybe it may cause some problems in my program which i didnt realise? 
    And I have attached an example of my program. Thanks
    Yehchia
    Attachments:
    Test Event.vi ‏11 KB

    Hi YehChia,
    I was talking about something like that:
    1. Not good. since with every iteration the DS connection needs to be opened and closed.
    2. Good. Since you open the connection only once then do the reads and close it afterwords.
    Christian

  • How to delete the  Reference customer in CRM ?? and what is the purpose for it ?

    what's is the purpose of using the  Reference customer in CRM  ?
    and can any one help me changing  the  Reference customer in CRM as i already assigned one and can't change it ??
    and how to use it .????.....
    thanks

    HI.
    Do you mean refresh the client ? if that is the case, i think you are posting in wrong forum since this one is for People Centric User Interface. Try in   Customer "Relationship Management (CRM) - General & Framework".
    Best Regards.
    Armando Rodriguez.

  • IPod Touch Newbie: What is the purpose of the iTunes app on my iPod Touch?

    What is the purpose of the iTunes app on my iPod Touch?
    All it does is connect to the iTunes store if I'm near a WiFi connection. It appears to be useful only for impulse purchasing of media. So why is it not named "iTunes Store"? It appears to have no other function.
    Also, to listen to my iTunes music on iPod Touch I have to click on the Music button...not the iTunes app. What logic is that?
    Also, iTunes has synced a movie for me, but I have no clue how to view it on the iPod Touch. It doesn't appear in iTunes on the iPod Touch, and there is no "Movie" button anywhere. What am I missing? I can't find it anywhere.

    For purchasing music, downloading podcasts,etc.
    http://manuals.info.apple.com/enUS/iPod_touch_3.1_UserGuide.pdf

  • SOA 10g: What is the purpose of the sync_trail and sync_store tables?

    Hello,
    We have a 10.1.3.3.1 MLR 19 environment and we're having a production problem where were seeing the following error msgs. When this has happened, it causes the affected server to fail and need to be recycled.
    ====================================================================================
    11/02/07 11:51:12 0 - ORABPEL-04040
    Cannot update lob column.
    The process domain was unable to update the lob column "5" in the datastore. The exception reported is: ORA-22990: LOB locators cannot span transactions
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid.
    sql statement: BEGIN INSERT INTO sync_store( cikey, domain_ref, bin_csize, bin_usize, bin ) VALUES ( ?, ?, ?, ?, '0' ) RETURNING bin INTO ?; END;
    11/02/07 13:06:15 0 - ORABPEL-04040
    Cannot update lob column.
    The process domain was unable to update the lob column "5" in the datastore. The exception reported is: ORA-22990: LOB locators cannot span transactions
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid.
    sql statement: BEGIN INSERT INTO sync_trail( cikey, domain_ref, bin_csize, bin_usize, bin ) VALUES ( ?, ?, ?, ?, '0' ) RETURNING bin INTO ?; END;
    ====================================================================================
    We have dozens of synchronous projects but only two of them are writing records to these tables. What makes a sync bpel project write to these tables and what is there purpose? I've seen them listed in various purge scripts so I have to assume they support audit trails or something similar.
    Thanks in Advance.

    I have an update. The two projects use the "inMemoryOptimization" property and that's the cause of the writing to the db. Why would this property trigger a write to the db when the purpose of the property is to do all processing in memory?

  • 10g: what is the purpose of sync_trail and sync_store?

    Hello,
    We have a 10.1.3.3.1 MLR 19 environment and we're having a production problem where were seeing the following error msgs. When this has happened, it causes the affected server to fail and need to be recycled.
    ====================================================================================
    11/02/07 11:51:12 0 - ORABPEL-04040
    Cannot update lob column.
    The process domain was unable to update the lob column "5" in the datastore. The exception reported is: ORA-22990: LOB locators cannot span transactions
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid.
    sql statement: BEGIN INSERT INTO sync_store( cikey, domain_ref, bin_csize, bin_usize, bin ) VALUES ( ?, ?, ?, ?, '0' ) RETURNING bin INTO ?; END;
    11/02/07 13:06:15 0 - ORABPEL-04040
    Cannot update lob column.
    The process domain was unable to update the lob column "5" in the datastore. The exception reported is: ORA-22990: LOB locators cannot span transactions
    Please check that the machine hosting the datasource is physically connected to the network. Otherwise, check that the datasource connection parameters (user/password) is currently valid.
    sql statement: BEGIN INSERT INTO sync_trail( cikey, domain_ref, bin_csize, bin_usize, bin ) VALUES ( ?, ?, ?, ?, '0' ) RETURNING bin INTO ?; END;
    ====================================================================================
    We have dozens of synchronous projects but only two of them are writing records to these tables. What makes a sync bpel project write to these tables and what is there purpose? I've seen them listed in various purge scripts so I have to assume they support audit trails or something similar.
    Thanks in Advance.

    I have an update. The two projects use the "inMemoryOptimization" property and that's the cause of the writing to the db. Why would this property trigger a write to the db when the purpose of the property is to do all processing in memory?

  • OIM: What is the purpose of "Update" while editing group memberships

    Hi,
    This is when you lookup a user's Resource Profile and go to "Edit" link. The process form shows up along with a drop down to edit the group memberships. When we select one of the choices such as "Groups" another window pops up where we could add more entires into the child form. In this form there is an "Update" column with a radio button besides a "Remove" column. What is the purpose of this "Update" column? We can add or delete child entries but what does update do? Is there a way to remove this selection altogether?
    Thanks in advance

    Update I can see used for a cases where you have multiple columns on a child table entry and want to change one of them. Strictly speaking, you can update a single column child table rather than delete and insert also. Access policies always do insert and delete actions, but you will want to implement an update task as well if you expect anyone to be editing child tables on resources directly.

  • What is the purpose of Multiproviders???

    Hi Everyone,
    I am currently trying to create a multiprovider.
    I have read the SAP documentation but I still do not understand in what circumstances should I create a multiprovider for reporting.
    Would appreciate if anyone can provide details on what is the purpose of multiproviders?
    Assuming I have the following scenario, should I create a multiprovider for reporting?
    Infocube A:-
    Characteristic
    - Employee Number
    - Cal Month/Year
    - Shift Type
    Key Figure
    - Hours
    Infocube B:-
    Characteristic
    - Employee Number
    - Cal Month/Year
    Key Figure
    - Amount
    I need to report on both the key figures for each employee and what is the shift type of the employee for the specific cal month/year. The employee number, cal month/year and shift type will be used as selection parameters.
    I am thinking of creating a multiprovider for this reporting need but I think there will be some problems.
    For example:
    1) If I input the employee number and shift type as selection parameters, the amount column will be empty when the report is displayed.
    2) If I input on the employee nunmber, then I'll be able to see both the key figures when the report is displayed but the data are on different lines which does not make sense to users.
    Emp ID   Shift Type    Cal Mth/Yr   Hours     Amount
    200001   Shift         05.2006       10 
    200001   Not assigned  05.2006                 1000
    Only if I don't show the shift type column, then the record will be display in a single line.
    How can I rectify such a problem.
    Please advise.
    Thanks.
    Shunhui.

    Hi,
    A MultiProvider is a type of InfoProvider that combines data from a number of InfoProviders and makes it available for reporting purposes. The MultiProvider does not itself contain any data. Its data comes entirely from the InfoProviders on which it is based. These InfoProviders are connected to one another by a union operation.
    InfoProviders and MultiProviders are the objects or views that are relevant for reporting.
    Multiprovider - used when we want to report on chracteristics and keyfigures that are in different data targets.
    http://help.sap.com/saphelp_nw04/helpdata/en/52/1ddc37a3f57a07e10000009b38f889/frameset.htm
    Thanks
    DST

  • What is the purpose of Defining a requirement in the procedure?

    Hi
    I have a query related to the Output type .
    What is the purpose of Defining a requirement in the procedure?
    And where shall we code for a new requirement and also what shall we code in it?
    Thanks

    <b>Requirement Use</b>
    If the requirement is fulfilled (SY-SUBRC = 0), then output determination also takes into consideration output type or the access sequence, for which the requirement has been specified.
    <u><b>Output determination:</b></u>
    An object that checks whether the application data (for example, data determined in Customizing) corresponds to the condition records.
    If this is the case, one or several messages are "found," which can then be processed (for example, sent electronically).
    The condition records are searched for according to a predefined hierarchy in message determination.
    After defining a new requirement no say 604 for billing pricing procedure and activating it, the standard sap system creates a routine with the no: 604 specifically for billing. So the name of the program automatically created by SAP will have the naming convention something like RV64A604. then you need an access key to go to the change mode for writing any logic. Then just put a break-point and then execute VF01 or VF04, then the cursor position directly goes into this routine, where the pricing structures KOMK and KOMP have the visibility. So based on the values flowing inside this structures, you can probably code that suites the business requirements.
    there are some useful transactions like VOFM for maintaining the requirements and formulaes for a pricing procedure.
    For viewing the requirements in the procedure you can also go to V/08 transaction.
    Lakshminarayanan
    P.S. Reward points for all helpful answers.

Maybe you are looking for

  • Using MacBook Pro as a monitor for video camera using HDMI

    I want to connect my Canon 70D to HDMI port on MacBook Pro so that I can use the MacBook Pro as a monitor while shooting video with the camera? AppleCare unable to provide a solution.  Is there a way to do this....and/or an app for that?

  • InDesign CS3 crashes when printing in OSX Lion

    I installed OSX Lion today and when I try to print from InDesign or Illustrator CS3 applications crash before the print dialogue window appears. Everything I do as a designer goes through InDesign so I really need to solve this problem!

  • FLVPlayback component skinAutoHide problem

    Hi guys! I have a problem with FLVPlayback component's skinAutohide property which works poorly when FLVPlayback component is the same size as your stage. The skin only hides when I move my mouse very slowly outside the FLVPlayback component. Also ma

  • PL/SQL cursor question (possible to pass in the table name?)

    I want to pass the name of a table to a cursor and select from that, Is this possible in PL/SQL? CURSOR get_rows(table_name IN VARCHAR2) IS SELECT * FROM table_name;      The actual sql statement that will be used is more complex.      I have 18 tabl

  • PDF呼び出し中にIE5.5がフリーズする

    ■質問内容 Server上にあるPDFをClientのIEから直接URL指定で呼び出す際. 初回は問題なく呼び出せますが. 2回目以降呼び出し途中に白い画面でIEがフリーズする場合があります. タスクマネージャでAcrobatRd32.exeを終了させると解消します. このような事象の情報をお持ちの方はおられないでしょうか? ■マシン環境 Server OS:HP-UX11.0 Apache Web Server Ver1.3.9 Client OS:Windows2000 Profession