v16.0.0.2419 The use of the InitString connection parameters is one of the recommended methods of implementing OEM authentication, but except in the simplest scenarios there seem to be issues. Say my OEM connection key is CONNECTION_AUTHENTICATION='Company=MyCo;Application=MyApp;Signature=000fa55157edbxxxxxxxxxxxxxx' If I have an InitString like this: InitString="SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=MyCo;Application=MyApp;Signature=000fa55157edbxxxxxxxxxxxxxx';"it works fine and I see the details showing in Sybase Central under Connection | Properties |Extended Information. InitString seems quite happy to execute multiple commands eg InitString="CREATE VARIABLE MyTest char(4);set MyTest = 'Blah';" But if other commands are combined with setting the CONNECTION_AUTHENTICATION, then the CONNECTION_AUTHENTICATION fails. Commands before the SET TEMPORARY OPTION command work, even though the SET doesn't. Any commands after the SET don't get executed ie InitString="CREATE VARIABLE MyTest char(4);set MyTest = 'Blah'; SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=MyCo;Application=MyApp;Signature=000fa55157edbxxxxxxxxxxxxxx';"successfully creates and populates the variable but the SET OPTION fails. With: InitString="SET TEMPORARY OPTION CONNECTION_AUTHENTICATION='Company=MyCo;Application=MyApp;Signature=000fa55157edbxxxxxxxxxxxxxx';CREATE VARIABLE MyTest char(4);set MyTest = 'Blah'; "the variable isn't created, nor does the SET OPTION work. asked 11 May '17, 10:57 Justin Willey |
I haven't found a complete answer but you can do 2 things to help diagnose this:
group you statements inside of '{', '}' braces can be used to signal a SQL batch (though I don't see how much of a difference that makes,
use -zr sql to see what is happening on the database sever side
I see something similar to you and noticing various errors ... maybe your efforts can kick that ball the rest of the way into the net.
Thanks Nick - I'll do some more digging based on your suggestions.
Justin, could you use a login procedure for the CREATE VARIABLE stuff (making that within the InitString unneccessary)?