Oracle connection string reported error ORA-01722: solution to invalid numbers, the following function, used to find a string similar to create or replace function f_GetUsers (key in varchar2,
P_cursor out pkg_test.myrctype)
Return number is
Result number;
Begin
Open p_cursor
SELECT * FROM Accounts_Users where TrueName like '%' + key + '%' order by UserID;
Result: = 0;
Return (Result );
End;
Compilation was successful, and no errors were found during the test, but in the real production environment,
Error reported ORA-01722: Invalid Number is inexplicable
Later, I checked the network.
It is found that the ORACLE string connection must use the | symbol, and then modify the test as follows:
Create or replace function f_GetUsers (varkey in varchar2,
P_cursor out pkg_test.myrctype)
Return number is
Result number;
Begin
Open p_cursor
SELECT * FROM Accounts_Users where TrueName like '%' | varkey | '%' order by UserID;
Result: = 0;
Return (Result );
End; compiled
There is no problem with the test data.