Hi Joba!
I took one connection string example from the recommended site:
https://www.connectionstrings.com/oracle/Just to information: This script runs in a test environment, not a production, after we get zero errors then I will start moving to PROD.
Attempts were performed, see below the script:
defVar --name dbConnection
--type DbConnection
defVar --name myUsername
--type String
--value XXXXXXX
defVar --name myPassword
--type String
--value YYYYYYY
defVar --name MyHost
--type String
--value "cluprod0703vm08-vip.XXXXXX.YYYYYY"
defVar --name MyPort
--type String
--value nnnn
defVar --name MyOracle
--type String
--value "domain.subdomain.etc.etc.etr"
// Connect to the bank via the connection string and store the data in the connection variable.oracleConnect --connectionstring "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=
${MyHost})(PORT=
${MyPort}))(CONNECT_DATA=(SERVICE_NAME=
${MyOracle})));User Id=
${myUsername};Password=
${myPassword};" dbConnection=connection
// Check whether the string is empty or not.assert --message "Could not connect to the database!"
--left "
${dbConnection}"
--operator "Is_Null"
Now the error moved to the last line
assert --message "Could not connect to the database!"
--left "
${dbConnection}"
--operator "Is_Null"
Error:
WDG.Automation.Language.AutomationAssertFailedException:
A asserção falhou na linha 10: Could not connect to the database!em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
em WDG.Automation.Language.ErrorHandler.m0nvU46Nja(Exception )
em WDG.Automation.Language.ErrorHandler.HandleExecutionExceptionIfNeeded(Exception exception, IAutomationCommand command)
em WDG.Automation.Language.CommandInterpreter.<Run>d__12.vQ7xHXNECMOJPEvfGI5(Object , Object , Object )
em WDG.Automation.Language.CommandInterpreter.<Run>d__12.MoveNext()
--- Fim do rastreamento de pilha do local anterior onde a exceção foi gerada ---
em System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
em System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
em WDG.Automation.Language.ScriptInterpreter.<RunCore>d__17.MoveNext()
------------------------------
Mauro Sérgio Lima França
------------------------------
Original Message:
Sent: Thu July 01, 2021 08:21 AM
From: Joba Diniz
Subject: Setting up an Oracle Connection
Hi,
Please check out the several connection strings available for Oracle: https://www.connectionstrings.com/oracle/
Also, share the error you're experiencing.
------------------------------
Joba Diniz
Product Manager
IBM
Original Message:
Sent: Wed June 30, 2021 02:47 PM
From: Mauro Sérgio Lima França
Subject: Setting up an Oracle Connection
Hi!
I ´ve already tried tens of attempts to compose the connection string of an Oracle Connection but they haven´t work.
The parameters of this connection are:
Host = cluprod0703vm08-vip.br1.ocm.s.XXXXXXXX
Port = XXXX (a number)
Service Name = domain.subdomain.XXX.YY
User ID = XXXXXXX
Password = XXXXXXX
Could you kindly help me to tackle this?
Here is the script snippet:
defVar --name dbConnection --type DbConnection
defVar --name myUsername --type String --value XXXXX
defVar --name myPassword --type String --value YYYYY
defVar --name MyHost --type String --value "cluprod0703vm08.XXXX.YYYY"
defVar --name MyPort --type String --value NNNN
defVar --name MyOracleSID --type String --value "domain.subdomain.etc.etc.etc."
// Connect to the bank via the connection string and store the data in the connection variable.
oracleConnect --connectionstring "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;" dbConnection=connection
// Check whether the string is empty or not.
assert --message "Could not connect to the database!" --left "${dbConnection}" --operator "Is_Null" --negate
------------------------------
Mauro Sérgio Lima França
------------------------------