Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Sql insert '

  • 02-11-2007 3: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,212 ✭✭✭✭Tom Dunne


    Or try Google - insert apostrophe oracle


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 11,998 ✭✭✭✭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