cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle SQL Declare a column and select today's date into the column

yes1819
New Contributor III

Hi
I need to put today’s date in a column called “P_SNAP_DATE”
Oracle stored procedure
Execute Immediate ‘select sysdate from dual’ into P_SNAP_DATE
was working fine in the Oracle.
When I put that sql into Oracle-Execute snap, it gave me below error message.
Can anyone help me on this?
Thank you

image

5 REPLIES 5

koryknick
Employee
Employee

Can you provide more context around what you are trying to do? Do you need to perform multiple statements in the execute and this is just the first one? Or do you need the current timestamp in the pipeline?

yes1819
New Contributor III

I want to do exact same thing that Oracle PL/SQL does.

In the Oracle, I created Stored Procedure, that’s like below.

image

This will be the only statement in this snap

koryknick
Employee
Employee

You can add an output view to the Execute snap and use the following in your SQL Statement:

select sysdate as “P_SNAP_DATE” from dual

This will product an output field from the snap as “P_SNAP_DATE” with the current timestamp.

Or, you could do the same thing in a Mapper snap and use Date.now() as the expression.

yes1819
New Contributor III

That worked! Thank you so much!