DB2存入' 及 " 的方法:
1.存入' 的方法:
需再前方或後方加入一個 '
ex: 要存入字串 this is a 'test'
需將'test' 多加一個' ==> this is a ''test''
insert into airline (CODE, NAME,CNAME ) VALUES ( 'h', 'hel''lo', ' this is a ''test''

' ) -->this is a 'test'

2.存入" 的方法:
直接存入即可," 視為一個字元
ex:要存入字串 this is a "test"
insert into airline (CODE, NAME,CNAME ) VALUES ( 'j', 'hel''lo', 'this is a "test"' )

-->this is a "test"


arrow
arrow
    全站熱搜

    npitt 發表在 痞客邦 留言(0) 人氣()