Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2013

    Unanswered: DB2 insert from a select statement

    I'm a bit new to this so please forgive me if my syntax is off

    What I want to do in insert multiple rows into a table based on a unique part number. The basic insert is:

    insert into XFLOWERINVENTORY values (844785, '2013-12-10 00:00:00.0','7000000000000000101',999,999,35,null, null,null,null,0)

    now the first value is a part number from the same table and I need to insert a new number of rows corresponding to the unique value of the part number e.g.

    select unique partnumber from XFLOWERINVENTORY

    so I'm looking at insert into XFLOWERINVENTORY values (** RESULTS FROM SELECT **, '2013-12-10 00:00:00.0','7000000000000000101',999,999,35,null, null,null,null,0)

    Is that possible?

  2. #2
    Join Date
    Jun 2003
    Toronto, Canada
    Provided Answers: 1
    Quote Originally Posted by Muckydevil View Post
    Is that possible?
    Not like you suggest - the correct syntax would be INSERT INTO ... SELECT ... FROM ...

    You can check the syntax details in the manual.
    "It does not work" is not a valid problem statement.

Posting Permissions

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