Robotic Process Automation (RPA)

 View Only
  • 1.  Setting up an Oracle Connection

    Posted Wed June 30, 2021 03:01 PM
    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
    ------------------------------


  • 2.  RE: Setting up an Oracle Connection

    Posted Thu July 01, 2021 09:15 AM
    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
    ------------------------------



  • 3.  RE: Setting up an Oracle Connection

    Posted Thu July 01, 2021 06:18 PM
    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
    ------------------------------



  • 4.  RE: Setting up an Oracle Connection

    Posted Thu July 01, 2021 06:18 PM
    Hi Joba,

    It seems that my previous reply hasn´t been loaded because of an error message from the forum.
    But it´s okay, I´ll repeat it here:

    Using the site you recommended: https://www.connectionstrings.com/oracle/ , the error moved to the last line. Firstly check the script below:

    defVar --name dbConnection --type DbConnection
    defVar --name myUsername --type String --value XXXX
    defVar --name myPassword --type String --value YYYY
    defVar --name MyHost --type String --value "cluprod0703vm08-vip.br1.XXXXX.YYYYYY.ZZZZZZ"
    defVar --name MyPort --type String --value nnnn
    defVar --name MyOracle --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=${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"

    Error (in the last line assert --message):
    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
    ------------------------------



  • 5.  RE: Setting up an Oracle Connection

    Posted Fri July 02, 2021 08:22 AM
    Hi,
    your assert is wrong, it should have --negate: assert --message "Could not connect to the database!" --left "${dbConnection}" --operator "Is_Null" --negate

    You want to assert that the connection IS NOT NULL, but you're asserting that the connection should be null, which in this case it isn't because the command oracleConnect worked.

    ------------------------------
    Joba Diniz
    Product Manager
    IBM
    ------------------------------



  • 6.  RE: Setting up an Oracle Connection

    Posted Fri July 02, 2021 11:28 AM
    Great job, Joba!
    You solved it, thanks a lot for your speed and have a nice weekend.

    ------------------------------
    Mauro Sérgio Lima França
    ------------------------------