Home » SQL & PL/SQL » SQL & PL/SQL » SP2-0552: Bind variable "00" not declared.
SP2-0552: Bind variable "00" not declared. [message #202368] Thu, 09 November 2006 06:41 Go to next message
Messages: 4
Registered: March 2005
Location: bangalore
Junior Member
Hi All

I am getting following error while executing the below sql query at oracle.can any body please help.

issues where sale_date = TRUNC(Mon Sep 11 20:00:00 EDT 2006);

Error :

SP2-0552: Bind variable "00" not declared.
Re: SP2-0552: Bind variable "00" not declared. [message #202371 is a reply to message #202368] Thu, 09 November 2006 06:52 Go to previous messageGo to next message
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
This information is cut and pasted from oracle documentation. this can also checked online at otn.oracle.com.

TRUNC (date)



Description of the illustration trunc_date.gif


The TRUNC (date) function returns date with the time portion of the day truncated to the unit specified by the format model fmt. The value returned is always of datatype DATE, even if you specify a different datetime datatype for date. If you omit fmt, then date is truncated to the nearest day. Please refer to "ROUND and TRUNC Date Functions" for the permitted format models to use in fmt.


The following example truncates a date:

"New Year" FROM DUAL;

New Year

Any value prefixed by a ":" is treated as a bind variable if it is not enclosed in quotes. So try to solve this by yourself.

Re: SP2-0552: Bind variable "00" not declared. [message #202372 is a reply to message #202368] Thu, 09 November 2006 06:54 Go to previous message
Messages: 20850
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is because colon (:) shows Oracle that 00 is a bind variable. You, probably, didn't want to do that. What you really need is to truncate DATE. We usually represent dates by a character string and enclose it into single quotes, such as '11.09.2006. 20:00:00'. This doesn't mean much to Oracle - it is much more happy when you (a developer) put it the way it uniquely knows what you meant. Therefore, use appropriate function and format mask:

TO_DATE('11.09.2006. 20:00:00', 'dd.mm.yyyy. hh24:mi:ss')

Once you have a DATE value, truncate it to desired precision using the TRUNC function.

Previous Topic: ORA12545 - Connect failed because target host or obejct does not exist
Next Topic: Formatting Data and inserting into a table
Goto Forum:

Current Time: Sun Oct 23 22:37:27 CDT 2016

Total time taken to generate the page: 0.13672 seconds