sql中用于h2数据库的特殊字符

时间:2011-12-17 10:58:15

标签: sql special-characters h2

我使用以下查询:

update ACCOUNT_EXTERNAL_IDS 
   set EXTERNAL_ID = 'username:vietnt' 
 where ACCOUNT_ID='1000000' 
   and EMAIL_ADDRESS='NULL'

显示错误:

ERROR: Column "USERNAME" not found; SQL statement:
update ACCOUNT_EXTERNAL_IDS set EXTERNAL_ID=username:vietnt where ACCOUNT_ID=1000000 and EMAIL_ADDRESS=NULL [42122-147]

我使用反斜杠\,然后,查询变为:

update ACCOUNT_EXTERNAL_IDS 
   set EXTERNAL_ID = 'username\:vietnt' 
 where ACCOUNT_ID = '1000000' 
   and EMAIL_ADDRESS='NULL'

错误是一样的。

1 个答案:

答案 0 :(得分:0)

解决!

转义字符'\'解决问题。

我遇到的问题是我使用ssh connect。因此,它消除了字符'\'