PL/SQL でこのスクリプトを実行しようとしています。しかし、常にエラーが発生しています。一重引用符を二重引用符に置き換えてみましたが、役に立ちませんでした。
ACCEPT p_name PROMPT "Enter Customer Name: "
VARIABLE g_output VARCHAR2(200)
DECLARE
v_street VARCHAR2(30);
v_city VARCHAR2(20);
v_prov VARCHAR2(20);
v_postal VARCHAR2(10);
BEGIN
SELECT cstreet, ccity, cprov, cpostal
INTO v_address,v_city,v_state,v_zip
FROM customer
WHERE cname = "&p_name";
:g_output := "&p_name" || " " ||v_street || " " || v_city;
:g_output := :g_output " " || v_prov || " " || v_postal;
END;
/
PRINT g_output
エラー:
Enter Customer Name: Ankur Kaushal
old 10: WHERE cname = "&p_name";
new 10: WHERE cname = "Ankur Kaushal";
old 11: :g_output := "&p_name" || " " ||v_street || " " || v_city;
new 11: :g_output := "Ankur Kaushal" || " " ||v_street || " " || v_city;
:g_output := :g_output " " || v_prov || " " || v_postal;
*
ERROR at line 12:
ORA-06550: line 12, column 27:
PLS-00103: Encountered the symbol " " when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between || indicator multiset member SUBMULTISET_
The symbol "." was substituted for " " to continue.
Input truncated to 14 characters
G_OUTPUT
--------------------------------------------------------------------------------
私がここで犯している間違いはありますか?