cancel
Showing results for 
Search instead for 
Did you mean: 

How to send oracle to_date function in groovy sql.call.

SOLVED
RohitBorse
New Contributor

How to send oracle to_date function in groovy sql.call.

How to send oracle to_date function in groovy sql.call.

to_date('2021-04-28-00.00.00','YYYY-MM-DD-HH24.MI.SS','NLS_CALENDAR=GREGORIAN')

1 ACCEPTED SOLUTION

Accepted Solutions
RohitBorse
New Contributor

Re: How to send oracle to_date function in groovy sql.call.

Ok, I have done something below

 

import groovy.sql.Sql;
import groovy.sql.GroovyRowResult;

 

GroovyRowResult row = sql.firstRow("SELECT to_date('2021-04-28-00.00.00','YYYY-MM-DD-HH24.MI.SS','NLS_CALENDAR=GREGORIAN') AS MyDate FROM DUAL");
def MyDate= row.MyDate;

String RESULT = "";
sql.call( "{call MYAPP.MYDATE.UPDATE_DATE(?, ?)}", [ sql.inout(Sql.VARCHAR(RESULT), MyDate])

{OUT1 ->

RESULT = OUT1;

}

View solution in original post

1 REPLY 1
RohitBorse
New Contributor

Re: How to send oracle to_date function in groovy sql.call.

Ok, I have done something below

 

import groovy.sql.Sql;
import groovy.sql.GroovyRowResult;

 

GroovyRowResult row = sql.firstRow("SELECT to_date('2021-04-28-00.00.00','YYYY-MM-DD-HH24.MI.SS','NLS_CALENDAR=GREGORIAN') AS MyDate FROM DUAL");
def MyDate= row.MyDate;

String RESULT = "";
sql.call( "{call MYAPP.MYDATE.UPDATE_DATE(?, ?)}", [ sql.inout(Sql.VARCHAR(RESULT), MyDate])

{OUT1 ->

RESULT = OUT1;

}

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors