Answered You can hire a professional tutor to get the answer.

QUESTION

How do I get the following into a stored procedure where I can enter some text as a parameter to do the following: select * from PRODUCTS where...

How do I get the following into a stored procedure where I can enter some text as a parameter to do the following:

select * from PRODUCTS where products.product_name like '%ABC%';

where ABC would be a parameter entered.

Thus far I have this:

CREATE OR REPLACE PROCEDURE PRODUCT_SEARCH_BY_NAME (

  PRODUCT_NAME_ARG IN VARCHAR,

  PROD_NAME OUT VARCHAR

  )

AS

BEGIN 

  SELECT PRODUCT_NAME INTO PROD_NAME 

  FROM PRODUCTS

  WHERE PRODUCTS.PRODUCT_NAME like '%' ||PRODUCT_NAME_ARG || '%';

END;

but it's not working

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question