Need some help Inserting data into a table

  • All, I have 26K records which I have to insert into a table. I have built a query using the Excel but I am running into an issue because there are so many lastname which contains single quote like O'Connor etc. How do I take care of this? 
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L'Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O'Connell ');

  • Syed Razi - Monday, November 13, 2017 10:50 AM

    All, I have 26K records which I have to insert into a table. I have built a query using the Excel but I am running into an issue because there are so many lastname which contains single quote like O'Connor etc. How do I take care of this? 
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L'Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O'Connell ');

    Double up the 'internal' quotes
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L''Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O''Connell ');

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Phil Parkin - Monday, November 13, 2017 10:53 AM

    Syed Razi - Monday, November 13, 2017 10:50 AM

    All, I have 26K records which I have to insert into a table. I have built a query using the Excel but I am running into an issue because there are so many lastname which contains single quote like O'Connor etc. How do I take care of this? 
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L'Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O'Connell ');

    Double up the 'internal' quotes
    INSERT INTO TEST (FirstName, LastName) VALUES ('Thomas','L''Ecuyer ');
    INSERT INTO TEST (FirstName, LastName) VALUES ('Tyler','O''Connell ');

    Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply