Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Sql insert '

  • 02-11-2007 04:32PM
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    I want to insert a name into a table which has a apostrophe but am having problems doing this with sql plus.

    I got this error

    ERROR at line 1:
    column not allowed here

    Any ideas?


Comments

  • Closed Accounts Posts: 345 ✭✭FindingNemo


    quinnd6 wrote: »
    I want to insert a name into a table which has a semi-colon but am having problems doing this with sql plus.

    I got this error

    ERROR at line 1:
    column not allowed here

    Any ideas?

    can you post your insert statement up pls ?


  • Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭quinnd6


    insert into table(fielda,fieldb,fieldc,date) values ("JO'SMITH","J.O'SMITH@SMITHS.ie",333, to_date('30/10/07','dd/mm/yy') );

    I also tried this beforehand
    insert into table(fielda,fieldb,fieldc,date) values ('JO'Smith' ,'J.O'Smyth.ie',333, to_date('31/01/07','dd/mm/yy') );

    and got string not properly terminated


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    quinnd6 wrote: »
    insert into table(fielda,fieldb,fieldc,date) values ("JO'SMITH","J.O'SMITH@SMITHS.ie",333, to_date('30/10/07','dd/mm/yy') );

    I also tried this beforehand
    insert into table(fielda,fieldb,fieldc,date) values ('JO'Smith' ,'J.O'Smyth.ie',333, to_date('31/01/07','dd/mm/yy') );

    and got string not properly terminated


    try this


    insert into table(fielda,fieldb,fieldc,date) values ('JO''Smith' ,'J.O'Smyth.ie',333, to_date('31/01/07','dd/mm/yy') );


  • Closed Accounts Posts: 345 ✭✭FindingNemo


    try this


    insert into table(fielda,fieldb,fieldc,date) values ('JO''Smith' ,'J.O'Smyth.ie',333, to_date('31/01/07','dd/mm/yy') );

    sorry, just did the first column for you, this is correct.

    insert into table(fielda,fieldb,fieldc,date) values ('JO''Smith' ,'J.O''Smyth.ie',333, to_date('31/01/07','dd/mm/yy') );[/QUOTE]


  • Registered Users, Registered Users 2 Posts: 23,202 ✭✭✭✭Tom Dunne


    Or try Google - insert apostrophe oracle


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 12,025 ✭✭✭✭Giblet


    Are you typing this straight into the database, or through a driver for java etc.
    You could use prepared statements if you're using oracle + java.


Advertisement