As with most things in software, there are many ways to skin this cat.
If your requirement is to simply insert the timestamp representing the current time into an Oracle table, you can replace the ‘?’ substitution variable with the Oracle function sysdate or, if you wanted a time 15 minutes in the future, sysdate + (15/1440) as that adds a fraction of a day (1440 minutes) to the current time.
If you need to pass in some other value, you can set the data type to java.lang.String and pass a string like “2006-12-27 02:10:46.0171”. Note the space between the “27” and the “02” and the presence of fractional seconds after the “46”.
You can also get the current date using the pub.date:getCurrentDate, format it using pub.date:formatDate with the pattern “yyyy-MM-dd hh:mm:ss.SSSS” to adjust the timezone, if necessary, and set the data type of your input variable to java.lang.String.
If you don’t need to reformat the results of pub.date:getCurrentDate, you can set the data type of your input timestamp column to java.util.Date and pass the date object directly to the insert adapter service.
In my current project, we are frequently working with XML dateTime data types and inserting them into Oracle timestamp columns. To make this a bit simpler, we created a Flow service called xmlDateToOracleTimestamp that accepts only an XML dateTime string and returns a string formatted for easy insertion into an Oracle timestamp column.
HTH,
Mark
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB