【发布时间】:2021-05-04 15:32:25
【问题描述】:
以下是说明:
一家公司希望允许客户通过选择产品名称或 描述,然后键入搜索词。使用本机动态 SQL,创建一个 返回产品名称、描述和价格基础的过程名称 SEARCH_SP 根据用户的搜索条件。该过程需要处理返回的多行。
这是我目前的代码。
CREATE OR REPLACE PROCEDURE search_sp (product_name IN VARCHAR2,
description IN VARCHAR2,
price_based IN NUMBER
)
AS
BEGIN
SELECT customer.product.name, customer.description, customer.price
FROM dbo.customer
WHERE customer.description = @SEARCH.customer.product.name = @SEARCH
END;
/
EXECUTE IMMEDIATE plsql_block
USING IN OUT new_product_name, new_description, new_price_based;
END;
/
我遇到了编译错误等等。任何帮助或建议将不胜感激。
【问题讨论】:
-
您遇到的具体错误是什么?
-
@MichaelD,这是我得到的错误。
Warning: Procedure created with compilation errors. BEGIN IMMEDIATE plsql_block; END; * ERROR at line 1: ORA-06550: line 1, column 17: PLS-00103: Encountered the symbol "PLSQL_BLOCK" when expecting one of the following: := . ( @ % ; The symbol ":=" was substituted for "PLSQL_BLOCK" to continue. SP2-0734: unknown command beginning "USING IN O..." - rest of line ignored. SP2-0042: unknown command "END" - rest of line ignored. Warning: Procedure created with compilation errors
标签: sql oracle plsql object-oriented-database