Hi,
Need help in this. I have a procedure which is passed a varchar parameter. It needs to do a SELECT on a table to get all rows where Name like the passed name. Here is a code I wrote:
PROCEDURE GET_NAME
(
p_name IN VARCHAR2
,p_cursor OUT dnCursor
)
IS
BEGIN
OPEN p_cursor FOR
SELECT
* FROM Table WHERE Name LIKE '%' + p_name + '%'
END GET_NAME;
This returns a invalid number error.
Whats wrong here..
Please advise
Thanks
orauser
06-17-2003, 01:52 PM
TomazZ
Does this select work out of PL/SQL?
;)
+ is not string concatenation character, || is
06-18-2003, 08:34 AM
AOrehek
Instead
SELECT
* FROM Table WHERE Name LIKE '%' + p_name + '%'
use
SELECT
* FROM Table WHERE Name LIKE '''%' || p_name || '%'''
06-18-2003, 08:39 AM
slimdave
I don't think so. That will only match patterns that start and end with a single-quote
06-18-2003, 02:54 PM
orauser73
Thanks for the reply. Sorry I am new to Oracle..
Trying to execute the procedure
I give this