Looking for a better style or a way to write the INSERT statement, possible with brand of continuation

Honestly, I really looked everywhere for this.

The problem is that, while tinkering in SQL Developer and knowing that in the spreadsheet I can just execute individual instructions by placing the cursor on the SQL statement I want to run I tried to do an INSERT query that would allow me to run an INSERT statement for... Well many inserts.

I thought I could use a brand of continuation but nothing I've tried has worked.

INSERT INTO

HF_easy_drinks

VALUES

("Blackthorn", "tonic water", 1.5, 1.0, "pineapple juice", "mix with ice").

("Blue Moon", "soda", 1.5 "Blueberry Juice",. 75, "mix with ice, strain")

;


I ended up doing just individual INSERT statements, which was not as convenient.

INSERT INTO HF_easy_drinks

VALUES ('Blackthorn', 'tonic water', 1.5, 1.0, "pineapple juice", "mix with ice");

INSERT INTO HF_easy_drinks

VALUES ('Blue Moon', 'soda', 1.5, 'Blueberry Juice',. 75, "mix with ice");

Hello

Perhaps you might prefer "an" insert like this:

INSERT INTO hf_easy_drinks (x, y, z,...)
SELECT "Blackthorn", "tonic water", 1.5, 1.0, "pineapple juice", "mix with ice" OF THE double
UNION ALL SELECT 'Blue Moon', 'soda', 1.5, 'Blueberry Juice',. 75, "mix with ice, strain ' FROM dual
SELECT UNION ALL... OF the double
SELECT UNION ALL... OF the double
;

Best regards

Bruno Vroman.

Tags: Database

Similar Questions

  • I tried for AN HOUR to find a way to put the two different fonts on the same line

    Pages is crap. I tried for AN HOUR to find a way to put the two fonts on the same line, even if I highlight 1 WORD, the whole line changes (if you know how to do that please tell me, I'll me CRAZY!). Wouldn't recommend, that Word is 100 x better and easier to use

    < published by host >

    Hi varn,.

    Seems to work here (Pages of screen capture):

    Select (highlight) the text you want to change. Click on the Format brush, and then click Style. Choose the font you want to use.

    The example above is in the text layer. I also tried in a text box and a table cell.

    I also tried to change the font for a single word of a line of text in Pages for iOS. The police has changed to the selected word, while the rest of the line remained in the police, he had previously.

    Cannot test it in 5 Pages, because I have not installed. The above example is Pages ' 09.

    It is possible that you have applied to a paragraph Style, what would change everything in the paragraph containing the insertion point.

    Kind regards

    Barry

    PS: MS Word is available for OS X, if you feel the need to switch.

    B

  • I'm looking for an image compatible Windows Server 2003 vmware study the operating system. Anyone know where I can find an image file?

    Original title: Windows Server

    I don't know where to put this question, so here goes I am looking for a picture compatible Windows Server 2003 vmware study the operating system. Anyone know where I can find an image file?

    Hello

    Post your question in the TechNet Server Forums, as your question kindly is beyond the scope of these Forums.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    See you soon.

  • Is there a way to get the first Pro CS6 with still now I can't find the previous, offered versions with the subscription of the CC 2015?

    Is there a way to get the first Pro CS6 with still now I can't find the previous, offered versions with the subscription of the CC 2015? What is recommended for creating DVDs with interactive menus?

    Instructions again, cloud or version https://forums.adobe.com/thread/1992717 serial number
    -a of notes on different versions of cloud and step by step on these differences
    -contains information about the separate library download which is necessary
    -CS6 is the last reminder, see here #8 why http://forums.adobe.com/thread/1337952?tstart=0

    Still and 10 Windows https://forums.adobe.com/thread/2015461 use the compatibility mode of Windows 8
    problem/solution to install Encore CS6 https://forums.adobe.com/thread/1934087

  • Best way to write the Pl/Sql

    Hi all
    Can someone say best written below stored proc:

    procedure missing_authorized_services is
    v_truncate_sql varchar2 (200);
    v_sql varchar2 (2000);
    BEGIN
    v_truncate_sql: = "truncate table missing_authorized_services;
    immediately run v_truncate_sql;
    commit;

    v_sql: = "INSERT into missing_authorized_services select distinct trim (service_group_Cd) as service_group_Cd, trim (service_cd) as stage_1_mg_service_request service_cd
    where (service_group_cd, service_cd) not in)
    Select distinct service_group_cd, stage_3_servcd_servgrp_dim service_cd)';

    immediately run v_sql;
    commit;

    END missing_authorized_services;


    / * I do select the table and then try to insert into another table the result set * /.

    Please help,
    Thank you
    J

    Hello

    The best way to write the PL/SQL (or any code) is by small steps.
    Start with a very simple procedure that does something (anything), just enough to make sure it works.
    Add a lot of statements of output so you can see what made the procedure. Don't forget to delete them after that trial is over.

    For example:

    CREATE OR REPLACE procedure missing_authorized_services IS
            v_truncate_sql  VARCHAR2 (200);
    BEGIN
         v_truncate_sql := 'truncate table missing_authorized_services';
         dbms_output.put_line (  v_truncate_sql
                        || ' = v_truncate_sql inside missing_authorized_services'
                        );
    END      missing_authorized_services;
    

    If you get any errors (for example, ORA-00955, because you try to give the same name to a procedure that you already use for a table), then fix the error and try again.
    When he worls perfectly, then add another baby step. For example, you can add the line

    EXECUTE IMMEDIATE v_truncate_sql;
    

    and test again.

    Do not use SQL dynamic (EXECUTE IMMEDIATE) unless you have to.
    Is there a reason to use dynamic SQL for INSERT statements?

  • I have the code for an Adobe Creative Cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code?

    Hi, I have a problem with code for my Adobe Creative cloud, it is alphanumeric, but the registry works only with numeric codes ¿where I can use my code? is a subscription to creative cloud of throughout the year.

    Probably you have a redemption code... especially if you did not purchase directly from Adobe

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html

    -or https://forums.adobe.com/thread/1572504

  • Looking for a better way to count the responses to the survey questions

    Hello all - I have created a survey for a site and now want to display the results to the admins of the site. I am trying to display the countdown - the number of times that a question has been answered in a certain way. I realize that I may need to build the investigation itself differently and how it stores data, but here is how it goes far.

    There are 10 questions, each with 4 options of radio button groups. The database table contains a column for each issue and stores the value of the selected option button. So it's pretty simple.

    Now on the results page, that it's the only way I can think to do, but there must be a better way. For each answer, I create a Recordset filtered on the issue and the value option, then display the total number of records. Which works great, but count each option, which means that 40 recordsets on the page - al simply determine "how many times was the Question 1, Option was selected and how many times has the Question 1, selected Option B and so on.»

    The only other thing I can think it maybe is a better way to count the occurrences of these values in the table is with PHP or in the SQL itself.  Or, perhaps, if the values themselves are entirely digital and follow a kind of model I can use a solution of math.

    Thoughts, solutions, and ideas are welcome!  Thank you.

    Your problem is a bad design. You should have a separate line for each answer, not to separate the columns. It also makes the very rigid investigation. A simple design would include a few tables - a master of the investigation that stores the questions and response table that contains a foreign key to the question number in the master, the answer, as well as any other details you need to capture. You might get more elaborate, but it's essential. Your result page and then just be a single recordset with a simple query with a group by clause.

    I urge you to review this before going any further.

  • looking for a better way to add many groups of

    Hello

    I'm new to G language and I find it quite difficult to figure out how to deal with table in labview. I am creating the over $ 15 consine functions (discrete) each with different frequencies. I use the loop and consine function to generate the table for each COS, but to add each other (adding the element by element), I have to use a loop again? I'm really curious to know if there is another way to generate the sum of all these cosine at a time and convert the result into a single table. Someone suggested using the form and loop for, but I don't understand how to use the form and how to make the result?

    You can create and add in the same iteration using a registry to offset.

    Here's a quick demo, adding five functions sinus with different numbers of cycles. You should be able to adapt it to your problem.

  • Looking for Eloqua example API Code loading mass Contacts in the Contact Group

    I'm looking for examples of Eloqua API .NET code to bulk load 10 000 + contacts in the Contact Group.  Please help if you have done this before.

    Thank you!

    David

    Hi David,

    I recently published an article on The import of Contacts in lists by using bulk API. I hope it will be useful.

    Thank you

    Fred

  • Looking for model/data format to import survey data in the survey on demand in the apex 4.2.5

    Hello

    Looking for a model/data format to import survey data in the survey on demand in the apex 4.2.5.

    Thank you

    hayatms wrote:

    Where I can get this CSV format, so I have to add in the file accordingly. Thank you

    Click on the button create poll on the surveys page, then select the option to create a survey from a text file. An example of the required format is displayed. It is not a CSV format.

  • I'm looking for video clips that I can use to open and close my video with a third lower, y at - it a link to download these templates?

    I was looking for video clips on the theme, like a clip that opens and closes my video and with the lower thirds

    the lower third models are here, if that's what you're looking for?  Library, title, missing model projects templates: Premiere Pro, After Effects, yet

  • Another way to write the query:

    Dear Experts, I am a beginner in sql. With my knowledge, I wrote this query
    but he took great moment in my database 11g
    Please tell any alternative to write this query in another way to increase performance

    Please find the explanation below
    SELECT DISTINCT *
               FROM UPGRADATION r1,
                    LOG t2,
                    OMNIACCOUNT m1,
                    (SELECT rid
                       ,  LISTAGG(ACCOUNTNO, ',') WITHIN GROUP (ORDER BY ACCOUNTNO) AS ACCOUNTNO
                               FROM   OMNIACCOUNT
                                 GROUP  BY rid) mk3,
                    (SELECT mobileno
                          ,  LISTAGG(ACCOUNTNO, ',') WITHIN GROUP (ORDER BY ACCOUNTNO) AS ACCOUNTNO
                                    FROM   OMNIACCOUNT
                                           GROUP  BY mobileno) mk1,
                    (SELECT mobileno
                          ,  LISTAGG(ACCOUNTNO, ',') WITHIN GROUP (ORDER BY accounttype) AS ACCOUNTTYPE
                                    FROM   OMNIACCOUNT
                                           GROUP  BY mobileno) mk2
              WHERE t2.txnauthid = r1.txnauthid
                AND r1.rid = mk3.rid
                AND t2.txntype = '54'
                AND mk1.mobileno = r1.regmobileno
                AND t2.reqtype = '11'
                AND t2.dc_id IN (SELECT deliverychannel_id
                                   FROM Channel)
                AND t2.custbankcode = '32472'
                AND t2.txndatetime BETWEEN TO_DATE ('28/12/2011 12:00:00 AM',
                                                    'DD/MM/YYYY hh:mi:ss AM'
                                                   )
                                       AND TO_DATE ('28/12/2012 11:59:59 PM',
                                                    'DD/MM/YYYY hh:mi:ss PM'
                                                   )
                AND r1.rid = m1.rid(+)
                AND t2.txnstatus IN ('C', 'F', 'T')
                AND t2.paymentinitiator = 'C'
                AND mk1.mobileno = mk2.mobileno
    
    
    
    
    Explain Plan For the above statement :
    -----------------------------------
    
    
    
    SELECT STATEMENT  FIRST_ROWSCost: 16  Bytes: 4,270  Cardinality: 1                                      
        25 HASH UNIQUE  Cost: 16  Bytes: 4,270  Cardinality: 1                                  
            24 NESTED LOOPS  Cost: 15  Bytes: 4,270  Cardinality: 1                              
                19 NESTED LOOPS  Cost: 14  Bytes: 4,270  Cardinality: 1                          
                    13 HASH JOIN  Cost: 13  Bytes: 2,268  Cardinality: 1                      
                        9 NESTED LOOPS OUTER  Cost: 4  Bytes: 252  Cardinality: 1                  
                            7 NESTED LOOPS  Cost: 3  Bytes: 239  Cardinality: 1              
                                4 NESTED LOOPS  Cost: 2  Bytes: 119  Cardinality: 1          
                                    2 TABLE ACCESS BY INDEX ROWID TABLE LOG Cost: 1  Bytes: 116  Cardinality: 1      
                                        1 INDEX RANGE SCAN INDEX IX_LOG Cost: 1  Cardinality: 8  
                                    3 INDEX UNIQUE SCAN INDEX (UNIQUE) PK_Channel Cost: 1  Bytes: 3  Cardinality: 1      
                                6 TABLE ACCESS BY INDEX ROWID TABLE UPGRADATION Cost: 1  Bytes: 120  Cardinality: 1          
                                    5 INDEX RANGE SCAN INDEX IDX_REG_AUTH Cost: 1  Cardinality: 1      
                            8 INDEX RANGE SCAN INDEX IDX_MLTN_BNK_ACCT Cost: 1  Bytes: 13  Cardinality: 1              
                        12 VIEW  Cost: 8  Bytes: 1,110,816  Cardinality: 551                  
                            11 SORT GROUP BY  Cost: 8  Bytes: 16,530  Cardinality: 551              
                                10 TABLE ACCESS FULL TABLE OMNIACCOUNT Cost: 7  Bytes: 21,210  Cardinality: 707          
                    18 VIEW PUSHED PREDICATE  Cost: 1  Bytes: 2,002  Cardinality: 1                      
                        17 FILTER                  
                            16 SORT GROUP BY  Bytes: 33  Cardinality: 1              
                                15 TABLE ACCESS BY INDEX ROWID TABLE OMNIACCOUNT Cost: 1  Bytes: 33  Cardinality: 1          
                                    14 INDEX RANGE SCAN INDEX IDX_MUL_LNKG Cost: 1  Cardinality: 1      
                23 VIEW PUSHED PREDICATE  Cost: 1  Cardinality: 1                          
                    22 FILTER                      
                        21 SORT GROUP BY  Bytes: 29  Cardinality: 1                  
                            20 INDEX RANGE SCAN INDEX IDX_MLTN_BNK_ACCT Cost: 1  Bytes: 29  Cardinality: 1              

    It would be best to leave the desired projection.
    Probably you don't really want all columns form this query.
    However, these are your join criteria:

    t2.txnauthid = r1.txnauthid
                AND r1.rid = mk3.rid
                AND r1.regmobileno = mk1.mobileno
                AND mk1.mobileno = mk2.mobileno
                AND r1.rid = m1.rid(+)
    

    Maybe you can get rid of AND mk1.mobileno = mk2.mobileno
    with

    (SELECT mobileno
                          ,  LISTAGG(ACCOUNTNO, ',') WITHIN GROUP (ORDER BY ACCOUNTNO) AS ACCOUNTNO
                          ,  LISTAGG(ACCOUNTNO, ',') WITHIN GROUP (ORDER BY accounttype) AS ACCOUNTTYPE
                                    FROM   OMNIACCOUNT
                                           GROUP  BY mobileno)
    

    After the combination seems to be suspicious:

    AND r1.rid = mk3.rid
    AND r1.rid = m1.rid(+)
    

    The first limit the result on all lines with the same id in
    OMNIACCOUNT and UPGRADATION
    so, o see no gain from the outer join.

    Do you really need the listagg on all OMNIACCOUNT lines.
    If this isn't the case, it would be probably better to do the listagg in the final projection.

    Maybe one way could be to start with OMNIACCOUNT and join outer UPGRADATION to it.
    You can do the listagg at the end.

    Maybe something like

    select
    *
    from
    OMNIACCOUNT m1
    left outer join
    (Select
     projection goes here
    from
    log t2 join UPGRADATION r1
    on
    r1.txnauthid = t2.txnauthid
        AND t2.reqtype = '11'
        AND t2.dc_id IN (SELECT deliverychannel_id
                           FROM Channel)
        AND t2.custbankcode = '32472'
        AND t2.txndatetime BETWEEN TO_DATE ('28/12/2011 12:00:00 AM',
                                            'DD/MM/YYYY hh:mi:ss AM'
                                           )
                               AND TO_DATE ('28/12/2012 11:59:59 PM',
                                            'DD/MM/YYYY hh:mi:ss PM'
                                           )
        AND t2.txntype = '54'
        AND t2.txnstatus IN ('C', 'F', 'T')
        AND t2.paymentinitiator = 'C'
    ) r1
    on
    m1.rid=r1.rid
    AND
    r1.regmobileno = m1.mobileno
    

    Published by: chris227 on 10.01.2013 01:45
    fix

  • Is there a way to find the IP address associated with a device that is currently using my Apple ID?

    Hi, is it possible to find the IP address associated with a device that is currently using my Apple ID? There is a device currently using my Apple ID, and I would like to know its IP address. When I connect to appleid.com, the device is listed. The device is an iPhone. It is an emergency situation. Thank you.

    Unless it's on your local network, the IP address won't be useful to you in any way. (and no, you can do that)

    If this is really an "emergency", inform the authorities.

  • Way to monitor the current state of vi?

    I have the problem that I have a .vi which worked very well... and then I started to play with the code, and now it is blocked and does not end the operation who worked.  I tried, but could not find the problem.  Is there a way to monitor the ongoing operation that Labview is doing at a given time? (other than breakpoints).

    You can use my Abort.vi to see which screw are running.  It will give you the option to close, but you can use it just to see what happens.

  • trigger for the insert statement

    Hello.
    I have a table, say, with 3 columns: ID, NAME, NAME_LENGTH.
    I am trying to create a trigger that fires when a record is inserted in the table.
    I send values for the ID and NAME columns per INSERT statement. and I need the trigger to write the LENGTH OF THE NAME INSERTED in the 3rd column

    CREATE OR REPLACE TRIGGER schema_name. GENERATE_length
    AFTER INSERT ON table_name
    FOR EACH LINE
    DECLARE
    F NVARCHAR2 (200);
    L NUMBER (5);
    NL NUMBER (5);
    NUMBER OF ID_LENGTH (5): = 5;
    BEGIN
    F: =:New.Name;

    L: = LENGTH (F);

    UPDATE HR_ORG_TREE

    SET name_length = NL;

    END;


    but does not work. error occurres as...

    ORA-04091: table schema_name.table_name is changing, the function of triggering/can not see
    ORA-06512: at the 'schema_name '. GENERATE_length', line 13
    ORA-04088: error during execution of trigger ' schema_name. GENERATE_length'

    Thank you.
    Sara
    CREATE OR REPLACE TRIGGER schema_name.GENERATE_length
        -- is "table_name" real name of your table?
        AFTER INSERT ON table_name
        FOR EACH ROW
    BEGIN
        -- this update will change all rows in HR_ORG_TREE table
        -- specify WHERE for this update
        UPDATE HR_ORG_TREE
           SET name_length = LENGTH(:NEW.name);
    END;
    

    Suppose your table_name is HR_ORG_TREE and you need to calculate the length of the name for just inserted row
    After maybe the code will be useful (not tested)

    CREATE OR REPLACE TRIGGER schema_name.GENERATE_length
        BEFORE INSERT ON HR_ORG_TREE
        FOR EACH ROW
    BEGIN
        :new.name_length := LENGTH(:NEW.name);
    END;
    

    Good luck

Maybe you are looking for

  • Replacement Time capsule

    How can I replace with a new an old Time Capsule and Time Machine backup, then move to the new TC?

  • build dynamically graphic

    Hi guys,. I'm a 3d graphics dynamically update, now its easy to plot the graph 3d when all values are known. In my case, check the vi, I have three wavelengths distance axis and power. The wavelength and distance are fixed I'll take the wavelength of

  • is - what the office jet 7610 supports Apple os 10.9 Maverick?

    I heard that new HP AiO-printers support is no longer Apple OS Maverick (10.9) for scanning and other key multifunctios. Is this true? I think purchasin one new OfficeJet 7610 for my iMac.

  • Computer laptop U410, SSD cache is not valid

    Hi all I bought a laptop U410 and installed Windows 7 64-bit. In the standard of this series of machine that it have a 32 GB SSD inside. But I don't find it in the window.In the bios, menu technology Intel Rapid Start, option status of partition TSRI

  • What should I do if the wireless radio does not work and cannot connect to the wireless router?

    What should I do if, during the installation of my c309a Photosmart Premium printer all in one, which I am trying to install a wireless connection, I get an error message that the wireless radio is not working?