Insert the number of declaration

Hello

I want to insert a few selected records from another table so that some other data in to a new table.
Is this possible? If so can u show me an example of a query?


For example:

Select a, b, c of the test;

insert into test_bak values (a, b, c, 'TT', '123');
This 'ttt' and '123' must be repeated in all selected lines.

So what would be the correct insert her statement?

Thank you very much.

Pascale

insert into test_bak
Select a, b, c, 'TT', '123'
of the test;

---------
Sybrand Bakker
Senior Oracle DBA

Tags: Database

Similar Questions

  • by pressing the arrow down 'quick search' opens and inserts the number 3

    pressing arrow opens 'fast search' and inserts the number 3. pressing the left or right arrows, the slider moves correctly but also inserts the number. To ti3mes the number 3 seems sel3f 333 "insert" as it does now as I'm typing

    You are welcome.

    Thanks for reporting on your results.
    You can mark your answer above as the solution by clicking on the "Solves the problem" button next to this response.

  • Insert the number of references in parentheses in only one step

    Hi all

    Sorry for my English is not good.

    Is it possible to insert automatically (in a single step with find-replace) the reference numbers of referrals superscript in parentheses should not be exposed, but under normal conditions?

    Thanks in advance

    If you want to leave a reference superscript, I think you have to do it in two steps - add the parnetheses find ~ F and change ($0)

    and then find parentheses exposing and change normal Find [()] set the find of exponent format (I'm not sure you'll actually any open parentheses are Exhibitor, but it won't hurt to watch), then leave the filed blank change and set the format of change to its normal position.

    Edit: changed the number of steps to two...

  • FM inserts the wrong doctype declaration / strange

    When I create and save a new task of DITA in FM11 (using DITA 1.1), FM 'Concept' doctype written while referring to the correct task dtd. FM also auto-insère a concept as root element element. The XML looks like this:

    doctype1.png

    The structapps file seems to me and also contains the correct doctype declaration. Do you have any idea where I could look to find the error?

    doctype2.png

    Robert

    OK, I found it now. Regardless of what is configured elsewhere, FM simply inserts the FIRST element of the EDDmarked as "valid" as root element.

    I used a flat DSP with all elements in a single file.

    So I have to work with separate EDDs for different types of items to have only a single valid root by file.

  • Flash as3 physical so the number of declaration:

    When the speed is greater than 4, the ball must stop. I also tried the code if(xx>4) { ball.stop (); } { inside the partition and out of reach... but do not work }

    amount of gravity Set

    var gravity: Number =. 000098;

    together from velcity

    var xx:Number = 0.2;

    mark the start time and add listener

    var lastTime:int = getTimer();

    addEventListener (Event.ENTER_FRAME, animateBall);

    step animation

    function animateBall(event:Event) {}

    get lag

    var timeDiff:int = getTimer () - last time;

    last time += timeDiff;

    adjust the vertical speed of gravity

    XX += gravity * timeDiff;

    Move the ball

    ball.rotation += timeDiff * xx;

    }

    if(XX>4) {}

    ball. Stop();

    }

    This code stops the chronology of the ball, but he will not stop turning ball.

    If you want to stop the ball to turn when xx > 4, use:

    amount of gravity Set

    var gravity: Number =. 000098;

    together from velcity

    var xx:Number = 0.2;

    mark the start time and add listener

    var lastTime:int = getTimer();

    addEventListener (Event.ENTER_FRAME, animateBall);

    step animation

    function animateBall(event:Event) {}

    get lag

    var timeDiff:int = getTimer () - last time;

    last time += timeDiff;

    adjust the vertical speed of gravity

    XX += gravity * timeDiff;

    Move the ball

    If (xx<>

    ball.rotation += timeDiff * xx;

    }

    }

  • get the number in the declaration of DBMS

    Hello everyone,

    my friend, I create the following code, but I've always faced a problem to display the result of County all the

    the code is:

    ------------------------------

    I insert a count (*) to get the number of employees

    but he keep get only '1' to the last of the result in the following way:

    DETAILS OF THE EMPLOYEE:

    YJOSEPH5 | YOUSEFJOSEPH | 15 NOVEMBER 15

    HYOUSEF10 | HASSANYOUSEF | 15 NOVEMBER 15

    HYOUSEF17 | HASSANYOUSEF | 15 NOVEMBER 15

    HYOUSEF14 | HASSANYOUSEF | 15 NOVEMBER 15

    HYOUSEF16 | HASSANYOUSEF | 15 NOVEMBER 15

    COUNT: 1

    the code

    ------------------------------------

    DECLARE
    V_USER_ID VARCHAR2 (50);
    NUMBER OF V_EMP_NO;
    V_FIRST_NAME VARCHAR2 (30);
    V_LAST_NAME VARCHAR2 (30);
    DATE OF V_REG_DATE;
    NUMBER OF V_COUNT;
    V_SQL_SATEMENTS VARCHAR2 (1000);
    NCOUNT THE NUMBER;
    CURSOR C IS SELECT USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE, COUNT (*) FROM EMP
    USER_ID, FIRST_NAME, LAST_NAME, EMP_NO, REG_DATE GROUP;
    BEGIN
    OPEN C;
    SELECT COUNT (*) FROM NCOUNT FROM USER_TABLES WHERE TABLE_NAME = 'EMP ';
    IF (NCOUNT < = 0) THEN
    V_SQL_SATEMENTS: =' CREATE TABLE EMP)
    USER_ID VARCHAR2 (40) PRIMARY KEY,.
    NUMBER OF EMP_NO,
    FIRST NAME VARCHAR2 (30),
    VARCHAR2 (30) LAST_NAME,.
    DATE OF REG_DATE)';

    RUN IMMEDIATELY "DROP TABLE EMP;
    IMMEDIATELY RUN V_SQL_SATEMENTS;
    END IF;

    SELECT NVL (MAX (EMP_NO), 0) + 1
    IN V_EMP_NO
    YOUSEF. EMP;
    INSERT YOUSEF. EMP (USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE)
    VALUES (SUBSTR (: LAST NAME, 1, 1) |: LAST_NAME |) V_EMP_NO, V_EMP_NO,:FIRST_NAME,:LAST_NAME,TO_DATE(SYSDATE,'DD-MON-YY'));
    DBMS_OUTPUT. PUT_LINE (' DETAILS OF THE EMPLOYEE: "");
    LOOP
    EXTRACT THE C IN V_USER_ID, V_EMP_NO, V_FIRST_NAME, V_LAST_NAME, V_REG_DATE, V_COUNT;
    WHEN THE EXIT %C NOTFOUND;

    DBMS_OUTPUT. PUT_LINE (V_USER_ID |'|) ' || V_FIRST_NAME | V_LAST_NAME |' | ' || V_REG_DATE);
    END LOOP;
    DBMS_OUTPUT. PUT_LINE ("COUNT:" | "|") V_COUNT);

    CLOSE C;
    END;
    /

    ALL FRIENDS,

    THANKS FOR EVERY BODY,

    I JUST FOUND THE RIGHT WAY TO DO

    FOR THOSE WHO WANT TO SEE:

    -----------------------------------------------------------

    DECLARE
    V_USER_ID VARCHAR2 (50);
    NUMBER OF V_EMP_NO;
    V_FIRST_NAME VARCHAR2 (30);
    V_LAST_NAME VARCHAR2 (30);
    DATE OF V_REG_DATE;
    NUMBER OF V_COUNT;
    V_SQL_SATEMENTS VARCHAR2 (1000);
    NCOUNT THE NUMBER;
    CURSOR C IS SELECT USER_ID, FIRST_NAME, LAST_NAME, EMP_NO FROM EMP REG_DATE;
    BEGIN
    SELECT COUNT (*) IN THE EMP V_COUNT;
    OPEN C;
    SELECT COUNT (*) FROM NCOUNT FROM USER_TABLES WHERE TABLE_NAME = 'EMP ';
    IF (NCOUNT<=0)>
    V_SQL_SATEMENTS: =' CREATE TABLE EMP)
    USER_ID VARCHAR2 (40) PRIMARY KEY,.
    NUMBER OF EMP_NO,
    FIRST NAME VARCHAR2 (30),
    VARCHAR2 (30) LAST_NAME,.
    DATE OF REG_DATE)';
                                             
    RUN IMMEDIATELY "DROP TABLE EMP;
    IMMEDIATELY RUN V_SQL_SATEMENTS;
    END IF;

    SELECT NVL (MAX (EMP_NO), 0) + 1
    IN V_EMP_NO
    YOUSEF. EMP;
    INSERT YOUSEF. EMP (USER_ID, EMP_NO, FIRST_NAME, LAST_NAME, REG_DATE)
    VALUES (SUBSTR (: LAST NAME, 1, 1) |: LAST_NAME |) V_EMP_NO, V_EMP_NO,:FIRST_NAME,:LAST_NAME,TO_DATE(SYSDATE,'DD-MON-YY'));
    DBMS_OUTPUT. PUT_LINE (' DETAILS OF THE EMPLOYEE: "");
    LOOP
    EXTRACT THE C IN V_USER_ID, V_EMP_NO, V_FIRST_NAME, V_LAST_NAME, V_REG_DATE;
    WHEN THE EXIT %C NOTFOUND;

    DBMS_OUTPUT. PUT_LINE (V_USER_ID |'|) ' || V_FIRST_NAME | V_LAST_NAME |' | ' || V_REG_DATE);

    END LOOP;

    CLOSE C;
    DBMS_OUTPUT. PUT_LINE ("COUNT:" | "|") V_COUNT);

    END;
    /

  • Insert page number in the footer

    How is - a insert number into the footer of a document from the Page?

    Evolution of salvation,

    5 pages has three fields in a header or a footer. Aligned left, Center, right.

    Click in the field where you want the page number and Menu > insert > Page number (and the number of pages if you wish)

    I had a look at your other post (how to insert a line over a foot of page)

    How to put the line above the footer area?

    and I couldn't find a way to insert a row above each paragraph, not the entire footer:

    Bad luck!

    Maybe someone else knows how to do this.

    Kind regards

    Ian.

  • How to insert the phone number in icloud?

    How can I insert phone number in the I cloud id. There is no option to add the phone number.

    Hi, gurkiratfrommoga.

    Please visit Apple support communities.

    Looks like you want to add the number of your iPhone to iMessage and FaceTime.  If this is the case, please see the instructions below.

    If your phone number is missing on your iPad or iPod touch

    Disconnect from the iMessage and FaceTime on all your devices:

    1. Go to settings > Messages > send & receive. Enter your Apple ID, then tap Sign Out.
    2. Go to settings > FaceTime. Enter your Apple ID, then tap Sign Out.

    Reconnect to the iMessage and FaceTime on all your devices:

    1. Go to settings > Messages > send & receive. Click on use your Apple ID for iMessage. Then sign in with your Apple ID.
    2. Go to settings > FaceTime. Click on use your username for the FaceTime Apple. Then sign in with your Apple ID.

    Link your number of iPhone and Apple ID to use iMessage and FaceTime

    See you soon

  • How can I get a name of table 1, column A, if column B is a negative number and insert the names of table 2?

    How can I get a name of table 1, column A, if column B is a negative number and insert the names of table 2?

    What is the formula?

    You can do this with a column of "index" in table 1, as this assistance:

    The formula in C2, filled to the bottom:

    IF (B =<>

    That increments a counter each time that it finds a negative number in column B.

    In the second table, you can retrieve a list of negative values in this way:

    The formula in A2, filled to the bottom:

    = INDEX (array 1::A, CORRESPONDENCE (LINE (−1, Table 1::C), 0))

    It takes the line number, the formula is activated, subtracts 1 to the header line and look up the result in the column of table 1 C.  If it finds a match, it feeds the line number to the INDEX page with retrieves the value of the column of table 1A.

    To hide the red triangles of signage wrap the IFERROR formula, like this:

    = SIERREUR (INDEX (table 1::A, CORRESPONDENCE (LINE (−1, Table 1::C), 0)),"")

    Of course, you can also simply filter on column B without the need to set up a column from another table or index.

    SG

  • can keyboard usuage:How I insert a number 2 at the upper right part of 10 to represent 10 squared?

    How can I insert a number 2 at the upper right part of 10 to represent 10 squared? Similarly, if I wanted to display oxygen gas, whose symbol is uppercase O with a number 2 at the bottom right of the letter O, can I do?

    Start - type in the search box-> find the table of characters at the top of list - Double click on it.

    on the line of police - click on the arrow down and select the font you want - then Double click on a character
    and at the bottom right will be the main features this character to the product.

    How to use the character map in Vista
    http://www.Vistax64.com/tutorials/93584-character-map.html

    Using special characters (character map): frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows-Vista/using-special-characters-character-map-frequently-asked-questions

    These can help:

    Special ALT characters
    http://www.tedmontgomery.com/Tutorial/altchrc.html

    ALT Codes / key Codes Alt
    http://usefulshortcuts.com/ALT-codes

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • How to check the number of lines inserted since the week last in the table

    Hello

    Oracle version: 11g

    OS: Linux

    We need to know the number of rows inserted for a table of 7 days, please can anyone suggest is all views to find that answer

    BR

    PMP

    The function dbms_stats.diff_table_stats_in_history should give you what you need, assuming you analyze the table regularly.

  • I bought the upgrade to lightroom from Adobe site 6, regularly paid with credit card, receive e-mail of confirmation of payment and the serial number, just start the program installation insert the serial number provided to me by email and I get this wa

    Bought @I upgraded lightroom to Adobe site 6, regularly paid with credit card, receipt of payment confirmation e-mail and serial number, just start the program installation insert the serial number provided to me by email and I get this warning: COULD NOT VALIDATE THIS serial NUMBER for LIGHTROOM CALL SERVICE since the upgrade I paid I might have a valid serial number thanks

    Have you contacted service the customer the message instructed? Generally, we cannot help with password issues in this forum.

  • Insert the ROWNUM in a column of data type of NUMBER table

    Hello

    I have a table that has a column named "rank" of the NUMBER data type. Basically, I want to make an analysis of top-n and insert the ROWNUM with other columns in the table.

    Definition of table1:

    CREATE TABLE

    (

    col1 VARCHAR2 (10),

    Col2 NUMBER,

    NUMBER of col3,

    rank NUMBER

    );

    INSERT INTO table1

    SELECT col1, col2, col3, rownum

    DE)

    SELECT col1, col2, col3

    FROM table2

    ORDER BY DESC of col3

    )

    WHERE rownum < = 5;

    I get an error ORA-01722: invalid number. I think the mistake is virtual ROWNUM is not data type of NUMBER, so I tried to cast as CAST (ROWNUM AS NUMBER), but it does not work, same error. Can can you please shed some light on how to convert a ROWNUM number or if the issue is something else.

    you're right, your example worked. It is an example of table I just created just to illustrate the problem, but my real table was always showing the same problem. Weird, isn't? However when I added the column names after that insert the question but statement I resolved. Adding code

    INSERT INTO TABLE1

    (col1, col2, col3, rank) - added

    SELECT col1, col2, col3, rownum

    DE)

    SELECT col1, col2, col3

    FROM table2

    ORDER BY DESC of col3

    )

    WHERE rownum<=>

    So that means ROWNUM returns number; and another confusion: why the inclusion of the column has solved my problem when it is not necessary for your example. in any case thank you.

  • How to find the number of bind variables declared in the current session

    Hi all
    I want to know a query to find out the number of variables declared in the current session.

    Note that the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions) * ', as well as for the issues with the SQL Developer tool. Please post these questions under the dedicated [SQL and PL/SQL | https://forums.oracle.com/forums/forum.jspa?forumID=75] forum (you have posted here before).

    Kind regards
    K.

  • Get the number of inserted records

    Hello

    I am moving from 6.1 to 8.0 and have found a query that runs in 6.1, but not in 8.0, and I wonder if there is a solution for this.

    What I do is to insert multiple records in a table and using @@rowcount to see the number of inserted records, this code has worked at 6.1 but the 'qry' variable is not defined in 8.0. Any help would be appreciated, thanks.

    You must use SET NOCOUNT to remove the number of records returned by the insert statement

    SET NOCOUNT ON
    INSERT INTO emp
    SELECT, l_name
    Candidates
    WHEN hiring = 1

    SELECT @@rowcount AS NumberOfRecords
    SET NOCOUNT OFF

Maybe you are looking for

  • Silverlight Plugin missing

    I want to watch Netflix and refuses to use an other Brwoser than Firefox. So here's the problem:After correctly uninstall silverlight and put it back, once again, Netflix continues to give me notice that silverlight must be installed, although it is.

  • BlackBerry Z10 battery charger Bundle

    I bought a package of the Q10, but then 'abandoned' battery charger device for the Z10. Can I charge/use the bundle to load the Z10 and/or use it if the Z10 is low the power in use by plugging the charger Q10 in the Z10? I understand that the battery

  • BlackBerry smartphones, I have a red! with 72 behind it.

    I have a red! with 72 behind it on my phone.  -What this means and how do I get rid of him?

  • Started to download the bridge and it is stuck on 42%?

    The computer (MacBook Pro) has started to download Bridge and then just hung up - yesterday - 42%, still there today?Also there was a notice for an "update" for Lightroom so I clicked on it and it is 'pending' since yesterday?

  • Download Shockwave Flash problem

    I use a very slow remote internet connection.  Which takes more than a few minutes to download takes me all day.  I run a Windows XP Pro SP3 operating system and a browser Firefox 35.0.1.  My main issue is with your Downloader/Installer, I can't main