Automic Workload Automation

  • 1.  Error while using SEC_SQLI

    Posted Apr 08, 2019 12:56 AM

    Hello Team,

     

    I'm trying to use SEC_SQLI to retrieve some values. It's throwing me error when I'm using values from a static variable.

    SEC_SQLI variableStatic VARA which contains the table value

     

    When I'm trying to preview the output, I'm getting the below error. When I tried only with the system variable i.e. &$CLIENT#, I'm able to retrieve the values.

     

    Wrong SQL statement in 'VARA.SEC_SQLI.RETRIEVE.JOB_ATTRIBUTES'. DB error: 'U00003754 Database-error in SQLI-variable: 'U00003590 UCUDB - DB error: 'OCIStmtExecute', 'ERROR ', '', 'ORA-00903: invalid table name''

     

    Thanks in advance.

     

     



  • 2.  Re: Error while using SEC_SQLI

    Posted Apr 09, 2019 10:41 AM

    It is not possible to pass a table or column name in a bind parameter.

     

    If you want to choose the table or column name (or database!) dynamically, you’ll have to do this another way. I usually do this by replacing the SQLI VARA with an EXEC VARA that calls an SQL job. Then I can use ordinary object/script variables in the SQL query, and set their values in the job pre-process. See this discussion:

    Convert an SQL VARA to an EXEC VARA + SQL job. 



  • 3.  Re: Error while using SEC_SQLI

    Posted Apr 09, 2019 11:01 AM

    Keep in mind that one of the main reasons for using bind parameters is to prevent arbitrary changes to the SQL, by limiting the ways in which an SQL statement may be customized before being submitted. (For instance, it prevents SQL injection.)