Afrida Anzum
Afrida Anzum

Reputation: 573

how to insert new line in insert query in oracle 11g sql

i want to insert new line between these two line in db."Asperger's syndrome have difficulty with social interaction and communication.They also have a narrow range of interests." i want my o/p to be like this

'Asperger's syndrome have difficulty with social interaction and communication.
They also have a narrow range of interests.'

insert into ab(column) values ('a'+char(10)+'b');

i tried to insert like this but sql shows error

Error report -

SQL Error: ORA-00936: missing expression 00936. 00000 - "missing expression"
*Cause:

Upvotes: 1

Views: 5324

Answers (2)

robhit
robhit

Reputation: 9

    insert into ab
  (col1)
values
  (q'[Asperger's syndrome have difficulty with social interaction and communication.]' ||
   chr(13) || 'They also have a narrow range of interests.')

Use the above code for your requirement.

Upvotes: -1

dnoeth
dnoeth

Reputation: 60462

The operator for string concatenation in Oracle is || and the function name is CHR instead of CHAR.

insert into ab(column) values ('a' || chr(10) || 'b');

Upvotes: 5

Related Questions