How to insert special characters in the table of DB2
In the actual use, you may encounter problems to insert special characters in the fields of the table. I have a simple summary, you are welcome to continue, so you can share, discuss together, and travel together! (The following mainly in DB2 7.x as an example).
1. Insert characters '(single quotes) INSERT INTO DB2ADMIN.AAAA VALUES (' ''); INSERT INTO DB2ADMIN.AAAA VALUES ('A' '' 'B'); 2. Insert Character ~ Insert Into DB2ADMIN.AAAA VALUES ('~'); INSERT INTO DB2ADMIN.AAAA Values ('a ~ b'); 3. Insert characters! Insert Into db2admin.AAAA Values ('!'); Insert Into db2admin.aaa Values ('a! B') ; 4. Insert characters @ INSERT INTO DB2ADMIN.AAAA VALUES ('@'); INSERT INTO DB2ADMIN.AAAA VALUES ('a @ b'); 5. Insert Character # Insert Into DB2ADMIN.AAAA VALUES ('#'); Insert INTO DB2ADMIN.AAAA VALUES ('a # b'); 6. Insert Character $ INSERT INTO DB2ADMIN.AAA VALUES ('$'); Insert Into DB2ADMIN.AAAA VALUES ('a $ b'); 7. Insert Character% INSERT INTO DB2ADMIN.AAAA VALUES ('%'); INSERT INTO DB2ADMIN.AAAA VALUES ('a% b'); 8. Insert Character ^ Insert Into DB2ADMIN.AAAA VALUES ('^'); Insert Into DB2ADMIN.AAAA VALUES (' A ^ b '); 9. Insert characters & INSERT INTO DB2ADMIN.AAAA VALUES (' & '); INSERT INTO DB2ADMIN.AAAA VALUES (' A & B '); 10. Insert Character * Insert Into DB2Admin.AAAA VALUES (' * ' ); INSERT INTO DB2ADMIN.AAAA VALUES ('a * b'); 11. Insert characters (Insert Into DB 2Admin.aaa Values ('); INSERT INTO DB2ADMIN.AAAA VALUES (' A (B '); 12. Insert Character) Insert Into DB2Admin.AAAA Values (') '); Insert Into DB2ADMIN.AAAA VALUES (' A ) B '); 13. Insert characters _ INSERT INTO DB2ADMIN.AAAA VALUES (' _ '); INSERT INTO DB2ADMIN.AAAA VALUES (' A_B '); 14. Insert Character - Insert Into DB2Admin.AAAA Values (' - ') Insert INTO DB2ADMIN.AAAA VALUES ('A-B'); 15. Insert Character Insert Into DB2ADMIN.AAAA VALUES (' '); Insert Into DB2Admin.AAAA Values
A b '); 16. Insert characters = INSERT INTO DB2ADMIN.AAAA VALUES (' = '); Insert Into db2admin.aaaa Values (' a = b '); 17. Insert Character / Insert Into db2admin.AAAA VALUES (' / '); INSERT INTO DB2ADMIN.AAAA VALUES (' A / B '); 18. Insert Character
27. Insert characters {INSERT INTO DB2ADMIN.AAAA VALUES ('{'); INSERT INTO DB2ADMIN.AAAA VALUES ('a {b'); 28. Insert characters} Insert Into db2admin.aaa Values ('}'); Insert Into DB2ADMIN.AAAA VALUES ('a} b'); 29. Insert characters [INSERT INTO DB2ADMIN.AAAA VALUES ('['); Insert Into DB2Admin.AAAA Values ('a [b'); 30. Insert characters] Insert Into DB2ADMIN.AAAA VALUES (']'); INSERT INTO DB2ADMIN.AAAA VALUES ('a] b');