Contributions
System Call Failed
I'm getting a "System Call Failed" error happen in a test which is testing some string functions. The test is the same and totally repeatable, however the error does not occur every single time. When it does occur the error seems to happen on one of two lines either: while (i < aqString.GetLength(value)) { or ch = aqString.GetChar(value, i); The test involved iterating through a list of about 200 random strings in a excel file and making them safe to pass into a sql statement, I tried to Log statements in before each of the line, to work out which string was causing the error, however the problem seems to dissapear then, and did not repear until I took out the Log.Messages. Sorry I could not get a good replicate for the error, but it does not seem to be a consistantly replicatable error. I am using TestComplete Version 8.50.618.7, on XP Pro Service Pack 314KViews0likes4CommentsRe: Sharing a Connection across ADO objects
If anyone is interested the eventual solution I used is below. It caches the StoredProc connection for faster calling when I am using that function a lot. Thanks for the Help. var connection = null; function getConnection(){ if (connection == null) { connection = ADO.CreateConnection(); connection.ConnectionString = getConnectionString(); connection.Open(); } return connection; } var gnCommand = null, gnReturn, gmParam; function get_Name(ID_OBJECT) { //FUNCTION GET_NAME(ID_OBJECT IN VARCHAR2) RETURN VARCHAR2; if (gnCommand == null) { gnCommand = ADO.CreateCommand(); gnCommand.ActiveConnection = getConnection(); gnCommand.CommandText = "{?=call GET_NAME(?)}"; gnReturn = gnCommand.CreateParameter("RETURN", adVarChar, adParamReturnValue, 1024, null); gmParam = gnCommand.CreateParameter("ID_OBJECT", adVarChar, adParamInput, 1024, null); gnCommand.Parameters.Append(gnReturn); gnCommand.Parameters.Append(gmParam); } gmParam.Value = ID_OBJECT; gnCommand.Execute(); return gnReturn.Value; }1.2KViews0likes0CommentsRe: Sharing a Connection across ADO objects
Sharing a ConnectionString does not mean we are sharing a oracle session. The SQL package I am testing has to be logged into and then it caches data, as well as its numerous functions. So I need to be able to run a number of sperate command against a single session. I cannot run this as a single SQL file because I need to check interim states.1.2KViews0likes0CommentsSharing a Connection across ADO objects
I have to call numerous StoredProcs from an Oracle package, and all of these calls have to be from the same connection. However whenever I try and assign the connection property of the “ADOStoredProc” I keep on getting a error “Object doesn't support this property or method” What I’m doing is: var connection = null; function getConnection(){ if (connection == null) { connection = ADO.CreateADOConnection(); connection.ConnectionString = getConnectionString(); connection.LoginPrompt = false; connection.Open(); } return connection; } function closeConnection(){ if (connection != null) { connection.Close(); connection = null; } } var xSProcFlush = null; function flush() { if (xSProcFlush == null) { xSProcFlush = ADO.CreateADOStoredProc(); xSProcFlush.Connection = getConnection(); xSProcFlush.ProcedureName = "OBJ_CACHE.FLUSH"; } xSProcFlush.ExecProc(); } var xSProcPrintNode = null, xParamPrintNode; function print_Node_Cache(value) { if (xSProcPrintNode == null) { xSProcPrintNode = ADO.CreateADOStoredProc(); xSProcPrintNode.Connection = getConnection(); xSProcPrintNode.ProcedureName = "OBJ_CACHE.PRINT_NODE_CACHE"; xParamPrintNode = xSProcPrintNode.Parameters.CreateParameter("p_MAX_ROWS ", DB.ftFloat, DB.adParamInput, 0, null); } xParamPrintNode.Value = value; xSProcPrintNode.ExecProc(); } function runSimpleSql(sql){ var connection = getConnection(); try { var rs = connection.Execute_(sql); if (!rs.EOF) { return rs.GetString(); } } catch (e) { Log.Warning(e.description, sql); } }16KViews0likes4Comments- 1.2KViews0likes0Comments
- 1.2KViews0likes0Comments
ADO reading parameters into SQL
I am sending some sql to Oracle which has double quotes inside a text string, fine no problem. However if there is a colan inside the double quotes then ADO throws a exception. Theexception it throws indicated it thinks there is a parameter. The exception I get is: "Parameter object is improperly defined. Inconsistent or incomplete information was provided" Oracle has not problem with the SQL, this is a ADO problem. An simplified example of the SQL is: var Qry = ADO.CreateADOQuery(); Qry.ConnectionString = getConnectionString(); Qry.SQL = "select '\" : \"' as text from dual"; Qry.Open(); Some other results to demo the problemare ERROR>select ' " : " ' as text from dual ERROR>select ' " : ' as text from dual GOOD>select ' " ":' as text from dual GOOD>select ' "' as text from dual GOOD>select ':' as text from dual17KViews0likes4CommentsRe: Global var's in JScript
Just standard programming practices, I'm writting a interface unit so less technicial testers can call our SQL API without have to worry about ADO. So when the call the unit using code complete I would like to hide the interal variables I used and just expose the functions they will use. So I do not know if JScript is up to it, but I would like to hide my interal variable and possible functions, but I do not "need" to do it.738Views0likes0Comments