[JIRA] (JENKINS-61297) Parameter to SQLScript from pipeline project using class SQLPlusRunnerBuilder

7 views
Skip to first unread message

ipvinay@yahoo.in (JIRA)

unread,
Mar 2, 2020, 2:03:06 PM3/2/20
to jenkinsc...@googlegroups.com
Vinaypal Singh created an issue
 
Jenkins / Task JENKINS-61297
Parameter to SQLScript from pipeline project using class SQLPlusRunnerBuilder
Issue Type: Task Task
Assignee: Fernando Boaglio
Components: sqlplus-script-runner-plugin
Created: 2020-03-02 19:02
Environment: Linux
Priority: Major Major
Reporter: Vinaypal Singh

HI Team,

I have created 2 String parameter that is SCHEMA_OWNER & SCHEMA_ROLE within Pipeline project and trying to run parameter based sql script(grant_role.sql)  with script type as file and passing params as given below. 

{stage('SQLRunner_DB02'){

step([

$class: 'SQLPlusRunnerBuilder',

credentialsId:'BASE_OWNER',

instance:'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=127.0.0.1)(Port=1521))(CONNECT_DATA=(SID=ORC:L)))',

scriptType:'file', 

script: 'grant_role.sql ${SCHEMA_OWNER} ${SCHEMA_ROLE}',

scriptContent:'',

customOracleHome:'/usr/lib/oracle/19.5/client64'])

Output:::
[DB_Test] $ /usr/lib/oracle/19.5/client64/bin/sqlplus -L BASE_OWNER/BASE_OWNER@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=127.0.0.1)(Port=1521))(CONNECT_DATA=(SID=ORCL))) "@/var/lib/jenkins/workspace/DB_Test/grant_role.sql EST_OWNER TEST_ROLE"

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Mar 2 12:04:33 2020
Version 19.5.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Last Successful login time: Mon Mar 02 2020 12:04:33 -05:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SP2-0310: unable to open file "/var/lib/jenkins/workspace/DB_Test/grant_role.sql TEST_OWNER TEST_ROLE"

 
Please suggest a way to overcome this problem
 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

fernando@boaglio.com (JIRA)

unread,
Mar 2, 2020, 10:41:04 PM3/2/20
to jenkinsc...@googlegroups.com
Fernando Boaglio commented on Task JENKINS-61297
 
Re: Parameter to SQLScript from pipeline project using class SQLPlusRunnerBuilder

Sorry, there is no support for SQL*Plus parameters, maybe you can create manually a SQL script before calling it.

ipvinay@yahoo.in (JIRA)

unread,
Mar 3, 2020, 12:15:02 AM3/3/20
to jenkinsc...@googlegroups.com

Thanks For response.

You mean to say from script type as File, we will call one normal scripts from inside we need to call our parameter based script, but i think it will not solve the purpose of passing parameters to sql scripts, how inner sql scripts will identify the parameters.

Can you please elaborate more about your suggestion to solve this problem.

fernando@boaglio.com (JIRA)

unread,
Mar 3, 2020, 6:00:06 AM3/3/20
to jenkinsc...@googlegroups.com

No, I meant use another plugin (Iike Managed Scripts) and manually create temp.sql file with contents "grant_role.sql TEST_OWNER TEST_ROLE".

After that use temp.sql as you script to be called by SQL*Plus.

 

Reply all
Reply to author
Forward
0 new messages