ksc_itg_run_sql

This command executes SQL script against PPM schema using JDBC.

Syntax

ksc_itg_run_sql QUERY_STRING="<query string>" [EXCEPTION_OPTION=”-no_data_exception”]

Parameter Description
QUERY_STRING The query string
EXCEPTION_OPTION The value can only be -no_data_exception
    Note:
  • If the query returns no data and EXCEPTION_OPTION is not specified, then it will throw an exception.

  • If multiple records are returned, only the last one matters.

  • If there are multiple columns in the query, the values are joint by ~.

  • The returned value is put into the token [SQL_OUTPUT].

Example using ksc_itg_run_sql

ksc_itg_run_sql QUERY_STRING="select k.user_id from knta_users k where username ='username1' "
ksc_set P_USER_ID=[SQL_OUTPUT]
ksc_itg_run_sql QUERY_STRING="select k.full_name from knta_users k where username ='username1'"
ksc_set P_FULL_NAME=[SQL_OUTPUT]
ksc_store D_USER = "[P_USER_ID]","[P_FULL_NAME]"