cancel
Showing results for 
Search instead for 
Did you mean: 

Restrictions using InitString and SET TEMPORARY OPTION

justin_willey
Participant
2,008

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.

Former Member

I haven't found a complete answer but you can do 2 things to help diagnose this:

  1. 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,

  2. 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.

justin_willey
Participant
0 Kudos

Thanks Nick - I'll do some more digging based on your suggestions.

VolkerBarth
Contributor
0 Kudos

Justin, could you use a login procedure for the CREATE VARIABLE stuff (making that within the InitString unneccessary)?

Accepted Solutions (0)

Answers (0)