Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

INSERT INTO - Must I specify all fields?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • INSERT INTO - Must I specify all fields?

    If the columns are the same, I believe you can do:
     INSERT INTO fileb (SELECT * FROM filea WHERE ......) 

  • #2
    INSERT INTO - Must I specify all fields?

    Worked great. Seems so simple I can't beleive I didn't already know that one. Thanks. -dan

    Comment


    • #3
      INSERT INTO - Must I specify all fields?

      When doing an INSERT INTO in SQL, if I am loading all the fields in a file, if all the fields are exactly the same in the file I am selecting from and the file I am inserting into, is there a way that I can avoid specifying every field in the file? I'm actually doing this in SQLRPG and planning to do a DSPFFD to an outfile and create the field list on the fly from there, but thought I'd ask you guys first in case there is a better trick. -dan
      Code

      Comment


      • #4
        INSERT INTO - Must I specify all fields?

        Since we had zero SQL knowledge/experience as 18 months ago we bought some materials to help. The combination of all three books/courses have answered the majority of our problems the 3 are; 1. Power RPG with SQL by Daniel Jacobs 2. SQL for Dummies (don't laugh it's got some good stuff in it) 3. SQL for eServer i5 and iSeries by Kevin Forsythe I swear I am going to write a book and combine all three of these into a single source. All kidding aside, the investment was minimal with #1 being the most expensive since it is a course with practice excercises and such. It is old but gives a good starting point. The SQL for Dummies is a generic SQL Primer and does a pretty god job of making some things simple. SQL for eServer is very practical and shows a bunch of stuff for embedded SQL including stored procedures, functions, dynamic sql with prepare etc. I would strongly recommend all three, unless you are already the greatest SQL guru going :-) Bill Barnes The Pantry, Inc

        Comment

        Working...
        X