Hi,
I use db2cmd in DB2 v9.5 FP2a on Windows.
I did the following:
1. Open DB2 Command Window (db2cmd).
2. Set LANG variable with command: set LANG=en
3. Echo variable to see if it is set: echo %LANG%
Echo command should display "en".
4. Connect to database: db2 "CONNECT TO mydatabase"
5. Create table: db2 "CREATE TABLE ADMIN.MYTABLE (COL1 CHAR(10))"
6. Insert data: db2 "INSERT INTO ADMIN.MYTABLE VALUES ('LANG')"
7. Make select: db2 "SELECT * FROM ADMIN.MYTABLE WHERE COL1 LIKE '%LANG%'
Note: You see %LANG% is a variable in Windows command prompt, so instead of %LANG% value 'en' gets inserted.
8. Work-around on cmd I have deleted variable with command: set LANG=
9. If I re-execute select from step 7 and I get data from database.
The problem is I need LANG variable to be set to en, to make it possible to some of the program's batch (and some other programs) work correctly.
Question: How to escape %LANG% variable?
Thanks