Plugin . SQL_SetPlugInSession

Buzz_ss

Member²
Hello.

How can I use function SQL_UsePlugInSession?
This function is described as :

function SQL_SetPlugInSession(PlugInID: Integer;
Username, Password, Database, ConnectAs:
PAnsiChar): Bool;

I tried next code:

Code:
function Change_SQL_PlugConnection():boolean ;
var
 curUserName, curPassword, curDatabase,curConnectAs :PAnsiChar;
begin
  IDE_GetConnectionInfoEx(1,curUserName, curPassword, curDatabase,curConnectAs);
//  Result := SQL_UsePlugInSession(PlugInID) ;
  Result := SQL_SetPlugInSession(PlugInID, curUserName, curPassword,curDatabase, curConnectAs);
end;

But It always return "False" and all SQL_functions continue using main connect. What is wrong?

Thank You.
 
Last edited:
Can you let me know your "Session Mode" preference and your "Allow multiple connections" preference? Both are located on the Oracle / Connection preferences page.

Session Mode must be "Multi Session" and "Allow multiple connections" must be enabled.
 
Thanks for Your reply.

Both preferences are correct.

Session Mode = "Multi Session"
and "Allow multiple connections" enabled

 
In debug I see that line :

IDE_GetConnectionInfoEx(1,curUserName, curPassword, curDatabase,curConnectAs);


return correct values for variables.
 
Last edited:
To obtain some more diagnostic information, can you modify the PL/SQL Developer shortcut and add the DebugSQL parameter? For example:

"C:\Program Files\PLSQL Developer\plsqldev.exe" DebugSQL

Reproduce the problem and send me the debug.txt file that is generated in the PL/SQL Developer directory or in the %APPDATA%\PLSQL Developer directory (e.g. C:\Users\\AppData\Roaming\PLSQL Developer).
 
I have already found reason of my problem.
I had bug in my copy of unit PlugInIntf.

I had SQL_SetPlugInSession declaration as:
SQL_SetPlugInSession:function (PlugInID: Integer;Username, Password, Database, ConnectAs: PAnsiChar):Bool;

It was without "cdecl" directive. When I had written this directive the problem disappeared.

Sorry for Your time spent.
Thanks
 
Last edited:
Back
Top