Adding a variable

Database
Enthusiast

Adding a variable

Hi All,

I need a quick help.

 

I have a variable at the beginning of the stored procedure which has Load start date time. There are 3 insert statements within the same procedure. I have to get the start date time when each table data is getting inserted. Can I keep the variable before every insert? How to get that?

Any help is greatly appreciated.

 

Thank you

Amritha.

2 REPLIES 2
Teradata Employee

Re: Adding a variable

Declare a variable in the SP, e.g.

    DECLARE LoadStart VARCHAR(32):
Then before each insert do:

    Select CURRENT_TIMESTAMP into :LoadStart;

Enthusiast

Re: Adding a variable

Thank you! It worked!