Reputation: 73
I am creating this very simple function in Oracle 23ai using the client SQLPro for Oracle, which is not being compiled due to errors.
create or replace function test_func (data1 varchar2, data2 varchar2)
return varchar2
is
data3 varchar2(200);
begin
data3 := data1||data2;
return data3;
end;
/
The error:
Statement completed successfully. 0.211 seconds. (Line 1).
ORA-06550: line 2, column 2:
PLS-00201: identifier 'DATA3' must be declared
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored
ORA-06550: line 3, column 2:
PLS-00372: In a procedure, RETURN statement cannot contain an expression
ORA-06550: line 3, column 2:
PL/SQL: Statement ignored. 0.028 seconds. (Line 5).
I have follow the guidance of the Oracle documentation and internet samples but it remains a puzzle. Thank you for your help.
Upvotes: 0
Views: 56
Reputation: 73
I found the error. This issue only happens when using the client SQLPro for Oracle, which has worked very well with other database tasks and when creating functions that do not require setting variables. To test, I switched to the web SQL client Oracle provides in their testing VM, and the function creation works as expected.
I will contact the SQLPro developer to determine why this is happening in this client. Thank you to those who reached out to help.
Upvotes: 2