Error in select statement with "with" keyword inside procedure

Database

Error in select statement with "with" keyword inside procedure


replace procedure myprocess(in p_date date)

Begin

insert into my_table(field_1,field_2)

with tmp_tab(field1,field2,field3) as

(select field1,field2,field3

    From my_table2)

select field1,field2

from tmp_tab;

end;

Hello everyone

i have a problem in a select statement, when I used a "with" keyword, I have the statement above

I create a procedure without problems but when I execute the procedure the database return this message:

"call failed. [3707] myprocess: syntax error, expected something like a name or a Unicode delimited identifiers or a 'SELECT' keyword or '(' between '(' and 'WITH' keyword."

I hope someone can help me resolve this error.

regards :)