Project and Portfolio Management Practitioners Forum
cancel

ksc_run_sql - Error

SOLVED
Go to solution
Highlighted
Greg Sliva
Respected Contributor.

ksc_run_sql - Error

Trying to use the ksc_run_sql special command. I have set the destination environment JDBC URL and did a check through the environment check which is successful. When I run the ksc_run_sql command in an object type I am getting the follwoing error.

Unexpected error!
ERROR: java.sql.SQLException: Could not connect to the JDBC URL: [ENV="'d550 (DISCO)'".DB_JDBC_URL].
No suitable driver

Any ideas what I am doing wrong?

Here is the command I have set in the obejct type.

ksc_run_sql QUERY_STRING='select obj_developer_key from EUL_US.EUL5_OBJS where obj_developer_key = [P.P_FOLDER]' ENV_NAME='[DEST_ENV.ENVIRONMENT_NAME]'
6 REPLIES
Greg Sliva
Respected Contributor.

Re: ksc_run_sql - Error

OK. Got by the error above, but I am getting a new error when the sql runs.

Running query: select obj_developer_key from EUL_US.EUL5_OBJS where obj_developer_key = MIGRATION_CUSTOM_FOLDER_TESTING
Unexpected error!
ERROR: java.sql.SQLException: ORA-00972: identifier is too long

This is the same error I recieved when trying to execute the query in SqlPlus. MIGRATION_CUSTOM_FOLDER_TESTING is over 30 chars which I believe is throwing this error. Is there any way around this?
Mahen M
Acclaimed Contributor.

Re: ksc_run_sql - Error

ksc_run_sql QUERY_STRING='select obj_developer_key from EUL_US.EUL5_OBJS where obj_developer_key = [P.P_FOLDER]' ENV_NAME='[DEST_ENV.ENVIRONMENT_NAME]'


I have not used this command before, but I think there is some format errors.

There is a single quote before Select, but I see no end for it.

I see a quote end of ([P.P_FOLDER]') I don't find a Quote before the token.

Regards,
Mahendran M
Mahen M
Acclaimed Contributor.
Solution

Re: ksc_run_sql - Error

ksc_run_java com.kintana.core.server.execution.KSCSQLQuery [ENV="[ENV_NAME]".DB_JDBC_URL] [ENV="[ENV_NAME]".DB_USERNAME] "[ENV="[ENV_NAME]".DB_PASSWORD]" "[QUERY_STRING]" -token SQL_OUTPUT -delimiter "#@#" -file [AS.PKG_TRANSFER_PATH][PKGL.SEQ].txt [EXCEPTION_OPTION]


Use the above as base for Oracle and the below for SQL Server DB.

ksc_run_java com.kintana.core.server.execution.KSCSQLQuery jdbc:inetdae:[ENV="[ENV_NAME]".DB_NAME]:[ENV="[ENV_NAME]".DB_PORT_NUMBER]?[ENV="[ENV_NAME]".MSSQL_DB_NAME] [ENV="[ENV_NAME]".DB_USERNAME] "[ENV="[ENV_NAME]".DB_PASSWORD]" "[QUERY_STRING]" -token SQL_OUTPUT -delimiter "#@#" -file [AS.PKG_TRANSFER_PATH][PKGL.SEQ].txt [EXCEPTION_OPTION]

Regards,
Mahendran M
Jason Nichols K
Acclaimed Contributor.

Re: ksc_run_sql - Error

Greg,

Try using this for your run command:

ksc_run_sql QUERY_STRING="select obj_developer_key from EUL_US.EUL5_OBJS where obj_developer_key = '[P.P_FOLDER]'" ENV_NAME="[DEST_ENV.ENVIRONMENT_NAME]"

Another question: which verision of PPM are you on? I'm currently working on a 7.5 instance and I could only get the [SQL_OUTPUT] token to work if I used ksc_itg_run_sql.
Greg Sliva
Respected Contributor.

Re: ksc_run_sql - Error

Thanks all for the info. It was just a formatting issue.
Greg Sliva
Respected Contributor.

Re: ksc_run_sql - Error

Formatting issue