Hello everybody,
i have a problem that i don't know how to solve it.
I created a procedure like this:
create or replace
PROCEDURE Employee_LoadBy Id
(
p_Id NVARCHAR2
)
AS
BEGIN
EXECUTE IMMEDIATE 'SELECT DISTINCT "Employee"."Id" , "Employee"."Nam e", "Employee"."Las tWriteTime", "Employee"."Cre ationTime"
FROM "Employee"
WHERE "Employee". "Id" = :1' USING p_Id;
END;
My questions are:
1- I tried to create this procedure without the command "EXECUTE IMMEDIATE", but i have an error because the pl/sql don't allow to write the select statement without this key word or without the "Select INTO".
That why i use the key word "EXECUTE IMMEDIATE".
I want to know it's a good way to do or not for such procedure (to load the data in the table).
2- This procedure is no problem to compile or to exec by using the command " CALL ..." or "EXEC ..." and it display repectively that "Appel terminé" = "call finished" or " Procédure PL/SQL terminé avec succès" = "PL/SQL procedure finished with success".
This procedure doesn't display the result (the rows in the table) for me.
It has a problem with my procedure or not.
I search in the internet and most of the my result's research, it use the select statement without the command "EXECUTE IMMEDIATE". So can anyone give me any ideas?
Hope to receive some replies for this problem, i say thanks very much in advance.
Have a nice day.
i have a problem that i don't know how to solve it.
I created a procedure like this:
create or replace
PROCEDURE Employee_LoadBy Id
(
p_Id NVARCHAR2
)
AS
BEGIN
EXECUTE IMMEDIATE 'SELECT DISTINCT "Employee"."Id" , "Employee"."Nam e", "Employee"."Las tWriteTime", "Employee"."Cre ationTime"
FROM "Employee"
WHERE "Employee". "Id" = :1' USING p_Id;
END;
My questions are:
1- I tried to create this procedure without the command "EXECUTE IMMEDIATE", but i have an error because the pl/sql don't allow to write the select statement without this key word or without the "Select INTO".
That why i use the key word "EXECUTE IMMEDIATE".
I want to know it's a good way to do or not for such procedure (to load the data in the table).
2- This procedure is no problem to compile or to exec by using the command " CALL ..." or "EXEC ..." and it display repectively that "Appel terminé" = "call finished" or " Procédure PL/SQL terminé avec succès" = "PL/SQL procedure finished with success".
This procedure doesn't display the result (the rows in the table) for me.
It has a problem with my procedure or not.
I search in the internet and most of the my result's research, it use the select statement without the command "EXECUTE IMMEDIATE". So can anyone give me any ideas?
Hope to receive some replies for this problem, i say thanks very much in advance.
Have a nice day.
Comment