Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61297

Parameter to SQLScript from pipeline project using class SQLPlusRunnerBuilder

XMLWordPrintable

      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
       

            boaglio Fernando Boaglio
            ipvinay Vinaypal Singh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: