2016-04-28 71 views
0

我想在db中的這兩行之間插入新的行。「阿斯伯格綜合徵在社交和交流方面有困難,他們也有很窄的興趣範圍。我希望我的O/P是這樣如何在oracle 11g中插入新行插入查詢sql

'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'); 

我試圖插入這樣的,但SQL顯示錯誤

Error report -

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

回答

1

在Oracle中字符串連接操作是||和函數名是CHR而不是CHAR

insert into ab(column) values ('a' || chr(10) || 'b'); 
0
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.') 

使用您的要求,上面的代碼。