Jump to content

sql


prichardson

Recommended Posts

I have csv import that inserts a csv file into my db table.I am trying to adapt the sql statement to make my csv import more flexible on what i want it to do. I want to be able to insert a csv file that may be insert for the first time or it may be updating a record within the db table. To make it complex - it may be just updating 1 or 2 columns out of the 10 in the db table. The trick is to have a dynamic sql yo be able to work out the values and where to insert it to the correct column within the db.This is my current sql statement for inserting, can someone adjust the code to enable it to be more flexible as i just mentioned:strsql = "INSERT INTO Autosports_Products (Page_Section, Page_Title, Page_Title_Level_3, etc etc )"strsql = strsql & "VALUES ('" &sSeg(0) &"', '" &sSeg(1) &"', '" &sSeg(2) &"', '" &sSeg(3) &"', etc etc )"Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...