Results 1 to 4 of 4

Thread: insert into

  1. #1
    Join Date
    Dec 2003
    Location
    Derby, England
    Posts
    38

    Unanswered: insert into

    Hi i have a table which is linked to many tables. When i enter data i do not always use all the foreign keys.
    Therefore i get a prompt message box saying no data entered into XX field.

    Just wanted to ask if i wanted to save data only to certain tables. how would i do it

    Insert into........

    thank you
    Kabir Hussein

    http://www.angelfire.com/theforce/precious/index.html

  2. #2
    Join Date
    Jan 2004
    Posts
    492

    Re: insert into

    Originally posted by kabir_hussein
    Hi i have a table which is linked to many tables. When i enter data i do not always use all the foreign keys.
    Therefore i get a prompt message box saying no data entered into XX field.

    Just wanted to ask if i wanted to save data only to certain tables. how would i do it

    Insert into........

    thank you

    As long as the table allows null columns, the way to only insert into certain columns is to explicity name them in the insert statement.

    Lets say you have:

    Table A
    ----------
    COL1
    COL2
    COL3
    COL4
    COL5

    You only want to insert values into 1,3,5:

    Code:
    Insert into table_a (col1, col3, col5)
    values ('Test', 'Test2', 'Test3')

  3. #3
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: insert into

    Originally posted by kabir_hussein
    Hi i have a table which is linked to many tables. When i enter data i do not always use all the foreign keys.
    Therefore i get a prompt message box saying no data entered into XX field.

    Just wanted to ask if i wanted to save data only to certain tables. how would i do it

    Insert into........

    thank you
    I'm a little confused. Do you have a required property set for the fields at the table level?

    I have quite a number of foriegn keys in quite a few tables. I don't like empty fields but have them occasionally. I can omit the foriegn key in my tables without an error message.

    There's probably more to it than this I know. That was my initial thought though.
    Gregg


    DAO, ADO, SQL, Automation and anything else I can pick up.

  4. #4
    Join Date
    Dec 2003
    Location
    Derby, England
    Posts
    38
    Hi

    many thanks for the two last messages, i have sorted it wat i changed was the properties in the E-r diagram as it was set to enfore referential intergrity.

    Many Thanks


    kabir
    Kabir Hussein

    http://www.angelfire.com/theforce/precious/index.html

Posting Permissions

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