Home » SQL & PL/SQL » SQL & PL/SQL » Prompt not being accepted into variable
Prompt not being accepted into variable [message #3464] Sun, 29 September 2002 08:09 Go to next message
randycgaz
Messages: 6
Registered: September 2002
Junior Member
Thank you for your help.
When I run this script I get the error message below, and I can't understand why. The asterisk was under the beginning of the second word in the message typed at the prompt. Does the blank space mess it up and why?

ACCEPT p_message PROMPT 'Please enter a message: '
DECLARE
v_message temp.message%TYPE := &p_message;
v_date_written temp.date_written%TYPE := SYSDATE;
BEGIN
INSERT INTO temp (message, date_written)
VALUES (v_message, v_date_written);
COMMIT;
END;
/

old 2: v_message temp.message%TYPE := &p_message;
new 2: v_message temp.message%TYPE := My name is Randy Waits.;
v_message temp.message%TYPE := My name is Randy Waits.;
*
ERROR at line 2:
ORA-06550: line 2, column 46:
PLS-00103: Encountered the symbol "NAME" when expecting one of the following:
. ( * @ % & = - + ; < / > at in is mod not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like
between ||
Re: Prompt not being accepted into variable [message #3471 is a reply to message #3464] Sun, 29 September 2002 21:18 Go to previous messageGo to next message
harish agarwal
Messages: 38
Registered: September 2002
Member
Put ur messege in ' '
like
'My name is Randy Waits.'
This will work
Harish
Re: Prompt not being accepted into variable [message #3491 is a reply to message #3471] Mon, 30 September 2002 11:07 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
I wouldn't change the input text - instead just add the single quotes to the code:

v_message temp.message%TYPE := '&p_message';
Previous Topic: SQL PLUS window
Next Topic: plzz...see if anyone can help me
Goto Forum:
  


Current Time: Tue May 07 09:30:06 CDT 2024