I want to create and run a stored procedure with an IN parameter, which is a date. Once the date passed into the procedure I want to run a simple select statement to transfer all data into a destination table.
Assuming that source table and destination tables are exactly same, I'm using:
CREATE OR REPLACE procedure Test ( start_date in data ) as
Begin
insert into Destination_table (column 1 , column2, date_Column)
Select column1, column 2, Date_column
from Source_table
Where date_column = Start_date;
Commit;
End Test;
Edited ...
CREATE OR REPLACE PROCEDURE Procedure_TEST ( s_date IN date ) AS
BEGIN
INSERT INTO Ps_dest_table ( Name, Salary, STATEMENTDATE )
SELECT Name, Salary, STATEMENTDATE
FROM ps_Source_table
WHERE (statementdate = s_date)
END procedure_TEST;
Is this the correct way of doing this? or am I missing something? How can I call this from C# code?