Forum Discussion

Decapent's avatar
Decapent
New Contributor
12 years ago

Connection string galore

Good morning,



I’m having a hard time
finding documentation on how to properly get a connection string to execute a
stored procedure contained in an Oracle Database package through ODBC… 


Using the interface, I can create database
checkpoints no problem and the connection to the database is working properly.
There is some connection string utility that can create it from scratch and
test the connexion. So far all those works fine. However, if I use the
connection string provided by TC and then paste it into a JScript Routine
using the ADOCommand object, I get the following error:


Parameter
object is improperly defined. Inconsistent or incomplete information was
provided.


I’ve been trying several alternatives but
they aren’t working…


Here is what I’m trying to do (connections string are commented):



Thank you,


function
testDB(status, batch_seq)


{


  try


  {


    var result, isBatchReady;


    var sp  = ADO.CreateADOCommand();


    //var extendedProperties =
aqString.Quote("DSN=ABCDEFGH;UID=ABCDEFGH;PWD=ABCDEFGH;DBQ=ABCDEFGH;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;MLD=0;ODA=F;");


    //sp.ConnectionString =
"Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="
+ extendedProperties;


    //sp.ConnectionString = "Driver={Oracle in
OraClient11g_home1};Dbq=ABCDEFGH;Uid=ABCDEFGH;Pwd=ABCDEFGH;";


    sp.CommandType
= adCmdStoredProc;


   
sp.CommandText = "PK_TEST_API.isBatchAtStatus";


    sp.Parameters.CreateParameter("status", adVarChar, adParamInput, 3, status);


    sp.Parameters.CreateParameter("batch_seq", adInteger, adParamInput, 6, batch_seq);


    result =
sp.Execute();


    // Oracle
doesn't handle properly BOOLEAN type... SP as a VARCHAR2 return


    // type which need to be converted to a boolean value


    isBatchReady
= result == "TRUE" ? true:false;


   


    if(isBatchReady)


    {


      Log.Message("Batch #" + batch_seq + " at " + status);


    }


    else


    {


      Log.Error("Batch #" + batch_seq + " not at
" + status);


    }


  }


  catch(ex)


  {


    Log.Error("Exception in testDB - " + ex.name, ex.description);


  }


}

No RepliesBe the first to reply