DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: insert values

  1. #1
    Join Date
    May 2003
    Location
    NY
    Posts
    24

    insert values

    Hi all

    SQL> DESC PROJECT
    Name Null? Type
    ------------------------------- -------- ----
    PROJECT_ID NOT NULL VARCHAR2(6)
    PHASE NOT NULL VARCHAR2(1)
    MUNI NOT NULL VARCHAR2(6)
    MCLOSED VARCHAR2(1)

    SQL> SELECT PROJECT_ID,PHASE,MUNI,MCLOSED FROM PROJECT;

    PROJEC P MUNI M
    ------ - ------ -
    575573 1 520264 N
    575573 2 520264 N
    575573 3 520264 N


    INSERT INTO PROJECT

    I NEED INSERT SAME VALUES EXCEPT MUNI TO CHANGE
    HOW TO WRITE INSERT COMMAND ON THIS OR PROCEDURE




    SQL> SELECT PROJECT_ID,PHASE,MUNI,MCLOSED FROM PROJECT;

    PROJEC P MUNI M
    ------ - ------ -
    575573 1 520264 N
    575573 2 520264 N
    575573 3 520264 N

    575573 1 510000 N
    575573 2 510000 N
    575573 3 510000 N

    Thanks for your help

  2. #2
    Join Date
    Jul 2002
    Location
    Lake Worth, FL
    Posts
    1,492
    Hi, is this what you want?

    INSERT INTO PROJECT
    SELECT PROJECT_ID,PHASE,MUNI,NULL FROM PROJECT;

    "The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb

  3. #3
    Join Date
    May 2003
    Location
    NY
    Posts
    24

    THANKS

    Hi if u see my code below from select

    The muni is changed

    first 3 records initailally a 520000 muni
    next 3 records initailally a 510000 muni

    how to insert same values from first set except muni as different

    Thanks for your help

  4. #4
    Join Date
    May 2003
    Location
    Chennai, India
    Posts
    5
    Hi,
    Try this out :
    insert into project (PROJECT_ID,PHASE,MUNI,MCLOSED)
    select PROJECT_ID,PHASE, <>,MCLOSED from project;

    This wil insert all rows from project table with the new value you type for MUNI column.

    Regards,
    Aparna S.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width