Menu

How Do I Get The Following Into A Stored Procedure Where I Can Enter Some Text A

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

Leave a Reply

Your email address will not be published. Required fields are marked *