Project and Portfolio Management Practitioners Forum
cancel

Ksc_run_sql command not working in report

Highlighted
VarunS
Trusted Contributor.

Ksc_run_sql command not working in report

I am trying to create a report in which we need some sql calculations and perform some svn operations based on the result of sql.

Rest of things is working fine but below command is not working.

ksc_run_sql QUERY_STRING="select 5 from dual" ENV_NAME="PPM DEV"

ksc_store MAXREV="[SQL_OUTPUT]"

Store command is storing string sql_output in MAXREV variable.it should store 5.nothing visible in logs.. except

MAXREV="[SQL_OUTPUT]", "[SQL_OUTPUT]"


Thanks.
2 REPLIES
Andrea Loi
Super Contributor.

Re: Ksc_run_sql command not working in report

You can try with KSC_SET to set the variable and KSC_STORE to store the information in a PPM token.

E.G.
ksc_set MAXREV="[SQL_OUTPUT]"
ksc_store MY_TOKEN=[MAXREV], [MAXREV]

I hope that it helps
Andrea


Jim Esler
Acclaimed Contributor.

Re: Ksc_run_sql command not working in report

We have found that the ksc_run_sql special command works when executed in a workflow step only if the workflow step has source and destination environments specified. The environments must be specified even when an ENV_NAME parameter is specified on the command like you have done here. Since no workflow step is associated with a report, this special command may not be functional in reports.

You can use ksc_local_exec to execute sqlplus directly. The [exec.output] token should be usable to capture the output but I have not tried that sequence in a report.