Hi
I was trying to provide a default value for the CURRENT OPTIMIZATION HINT special register for my DB2 client application.
I tried db2dsdriver.cfg file and it's section and JDBC specialRegisters Uri parameter. Both lead to the same result: 1. When I set the value without quotes like so:
db2dsdriver.cfg:
<specialregisters>
<parameter name="CURRENT OPTIMIZATION HINT" value="HELLO1"/>
</specialregisters>
or with JDBC Uri:
jdbc:db2://<ip>:<port>/<database>:retrieveMessagesFromServerOnGetMessage=true;emulateParameterMetaDataForZCalls=1;specialRegisters=CURRENT OPTIMIZATION HINT=HELLO1;
I get an exception saying I have a problem with the SET instruction:
Message: ERROR [42721] [IBM][DB2] SQL0969N There is no message text corresponding to SQL error "-725" in the message file on this workstation. The error was returned from module "DSNLXENV" with original tokens "CURRENT QUERY OPTIMIZATION DALLASA". SQLSTATE=42721
Here is the exempt from the java trace:java trace
When I try the same and put quoted around the value, I get some strange results:
db2dsdriver.cfg:
<specialregisters>
<parameter name="CURRENT OPTIMIZATION HINT" value="'HELLO1'"/>
</specialregisters>
or with JDBC Uri:
jdbc:db2://<ip>:<port>/<database>:retrieveMessagesFromServerOnGetMessage=true;emulateParameterMetaDataForZCalls=1;specialRegisters=CURRENT OPTIMIZATION HINT='HELLO1';
The result is that the special registed is set to some faulty value:
SELECT CURRENT OPTIMIZATION HINT FROM SYSIBM.SYSDUMMY1;
returns a string:
"\0\0\0\u00010\u001a\0\0"