SQL Developer Tips

Insert 資料含 & 符號

& 符號代表參數,因此SQL Developer會跳出視窗要求輸入參數值。如果要新增含 & 的內容可使用下列方法:

Oracle

分斷,再將字串連起來

'ABC & EFG' → 'ABC &'||' EFG'

MySQL

'ABC & EFG' → 'ABC &' 'EFG'

Reference: https://dev.mysql.com/doc/refman/5.7/en/string-literals.html

Insert 資料含單引號 Single Quote

MySQL (使用 \’ (escape)在SQL Developer會跳出視窗? 但基本上應該要能使用 escape才對…)

'L'ALDEA AMPOSTA TORTOSA' → 'L''ALDEA AMPOSTA TORTOSA'

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s