pl/sql insert problem. [message #39553] |
Tue, 23 July 2002 07:14 |
sn008
Messages: 7 Registered: July 2002
|
Junior Member |
|
|
Is there a solution to this ongoing problem..
SQL> l
1 DECLARE
2 -- Customer phone data.
3 v_cust_id CHAR(5) := chr(39)||&v_cust_id||chr(39);
4 v_simno VARCHAR2(10) := chr(39)||&v_simno||chr(39);
5 v_dirno VARCHAR2(12) := chr(39)||&v_dirno||chr(39);
6 BEGIN
7 insert into directory
8 ( DCID, SIMNO, DIRNO )
9 values
10 ( v_cust_id, v_simno, v_dirno );
11* END;
SQL> /
Enter value for v_cust_id: '10004'
old 3: v_cust_id CHAR(5) := chr(39)||&v_cust_id||chr(39);
new 3: v_cust_id CHAR(5) := chr(39)||'10004'||chr(39);
Enter value for v_simno: 'ER34UIT09'
old 4: v_simno VARCHAR2(10) := chr(39)||&v_simno||chr(39);
new 4: v_simno VARCHAR2(10) := chr(39)||'ER34UIT09'||chr(39);
Enter value for v_dirno: '978-929-9201'
old 5: v_dirno VARCHAR2(12) := chr(39)||&v_dirno||chr(39);
new 5: v_dirno VARCHAR2(12) := chr(39)||'978-929-9201'||chr(39);
DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at line 3
|
|
|
|
Re: pl/sql insert problem. [message #39560 is a reply to message #39553] |
Tue, 23 July 2002 08:34 |
sn008
Messages: 7 Registered: July 2002
|
Junior Member |
|
|
The single quotes chr(39) is not a input to the field but enclosed with character input ..But I understand your point...how do I insert only the value and not the single quotes.
For example: 'Customer number'
|
|
|