Home » SQL & PL/SQL » SQL & PL/SQL » A strange problem
A strange problem [message #21352] Sun, 28 July 2002 05:00 Go to next message
Pradeep
Messages: 55
Registered: July 2000
Member
I am writing a simple pl/sql block which is somewhat like this,

DECLARE
lv_value VARCHAR2(20);

BEGIN
lv_value := TO_CHAR(800 * 4);
lv_value := TO_CHAR('3200');
lv_value := TO_CHAR(SYSDATE);
lv_value := TO_CHAR(NULL);

END;

then the line
lv_value := TO_CHAR('3200'); generates an error, while writing the same code in sql prompt

select TO_CHAR('3200') " output" from dual; executes fine.
please tell me why this is so?
Re: A strange problem [message #21353 is a reply to message #21352] Sun, 28 July 2002 06:18 Go to previous message
Mark the Shark
Messages: 15
Registered: February 2002
Junior Member
You can not use DDL commands within a pl/sql block. Only DML..
Previous Topic: Insert Images in a BLOB Datatype?
Next Topic: A strange problem
Goto Forum:
  


Current Time: Thu Apr 25 11:17:49 CDT 2024