Jip De Lano
Apr 16, 2008 4:33:06 AM

Parameter query cluase error when used for a date.

I'm running a query using a parameter for a date, example: SELECT * FROM po WHERE orderdate > :date1 In the parameter window I fill in the value (e.g. 2008-01-01) and the data type (Date Time). The error I get is "Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000, Native Code: 0)" I've tried various formats for the date, such as: 01-01-2008, 01/01/2008, 01/01/2008 01:00:00 ... to no avail. What is the required date format to fill in here ? Or what could be the reason for the error message ? When I run exactly the same query in Toad it runs fine. Can anyone try a similar query successfully & provide the example ? Thanks, Jip


Jip DeLano
Apr 24, 2008 1:46:29 AM

Parameter query cluase error when used for a date.

More details: - using the WinSQL Oracle Wire Protocol driver (for Oracle DB) - Win XP PC, US regional settings (i.e. short date format MM/DD/YYYY) The database has a table PO with a date column ORDERDATE. In WinSQL I can enter: SELECT * FROM PO WHERE ORDERDATE > '04/01/2008' ... and get results. But when I enter: SELECT * FROM PO WHERE ORDERDATE > ::date ... and enter the same date as a DATETIME value in the paramet window, I get the aforementioned error. It doesn't make sense. If anyone has any ideas ? - Jip >"Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000, >Native Code: 0)"


John POlis
Oct 15, 2008 4:54:21 PM

Parameter query cluase error when used for a date.

I am also having a problem with Parameter queries. I want to prompt for parameters 1x at the beginning of a script and then use these parameters over and over again without being prompted. DECLARE @from1 DATETIME, @to1 DATETIME; SELECT @from1 = ::from1 , @to1 = ::to1 -- wn_TabTitle Window 1 select wasLead, sys_create_date, advisor_id, signindate, advisor_status_id, lead_created_by from advisors where advisor_status_id = 1 and lead_created_by = 133 and signindate between @from1 and @to1 go -- wn_TabTitle Window 2 select wasLead, sys_create_date, advisor_id, signindate, advisor_status_id, lead_created_by from advisors where advisor_status_id = 1 and lead_created_by = 133 and signindate between @from1 and @to1 go I only get results for Window 1. Why am I not getting results for Window 2? I want to be able to enter Parameters 1x and have them flow through my script. Any help would be appreciated. >More details: >- using the WinSQL Oracle Wire Protocol driver (for Oracle DB) >- Win XP PC, US regional settings (i.e. short date format MM/DD/YYYY) > >The database has a table PO with a date column ORDERDATE. >In WinSQL I can enter: >SELECT * FROM PO WHERE ORDERDATE > '04/01/2008' >... and get results. > >But when I enter: >SELECT * FROM PO WHERE ORDERDATE > ::date >... and enter the same date as a DATETIME value in the paramet window, I get the aforementioned >error. > >It doesn't make sense. If anyone has any ideas ? >- Jip > > >>"Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000, >>Native >Code: 0)"


Mark Boyd
Nov 6, 2008 1:13:32 PM

Parameter query cluase error when used for a date.

Jip - Have you ever figured this out? I am having a similar problem. I cannot figure out how to put dates into a parameter - no matter how I try to do it, I cannot seem to get it to work. If you have any ideas, I would apprecaite it. Thanks and take care. Mark >I'm running a query using a parameter for a date, example: >SELECT * FROM po >WHERE orderdate > :date1 > >In the parameter window I fill in the value (e.g. 2008-01-01) and the data type (Date >Time). The error I get is >"Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000, >Native Code: 0)" > >I've tried various formats for the date, such as: >01-01-2008, 01/01/2008, 01/01/2008 01:00:00 ... to no avail. > >What is the required date format to fill in here ? >Or what could be the reason for the error message ? >When I run exactly the same query in Toad it runs fine. >Can anyone try a similar query successfully & provide the example ? > >Thanks, >Jip


Anonymous
Apr 1, 2009 7:46:42 AM

Parameter query cluase error when used for a date.

>I am also having a problem with Parameter queries. > >I want to prompt for parameters 1x at the beginning of a script and then use these >parameters over and over again without being prompted. > >DECLARE @from1 DATETIME, @to1 DATETIME; SELECT @from1 = ::from1 , @to1 = ::to1 > >-- wn_TabTitle Window 1 >select wasLead, sys_create_date, advisor_id, signindate, advisor_status_id, lead_created_by >from advisors >where advisor_status_id = 1 and lead_created_by = 133 and signindate between @from1 >and @to1 >go >-- wn_TabTitle Window 2 >select wasLead, sys_create_date, advisor_id, signindate, advisor_status_id, lead_created_by >from advisors >where advisor_status_id = 1 and lead_created_by = 133 and signindate between @from1 >and @to1 >go > >I only get results for Window 1. Why am I not getting results for Window 2? I want >to be able to enter Parameters 1x and have them flow through my script. > >Any help would be appreciated. > > >>More details: >>- using the WinSQL Oracle Wire Protocol driver (for Oracle DB) >>- Win XP PC, US regional settings (i.e. short date format MM/DD/YYYY) >> >>The database has a table PO with a date column ORDERDATE. >>In WinSQL I can enter: >>SELECT * FROM PO WHERE ORDERDATE > '04/01/2008' >>... and get results. >> >>But when I enter: >>SELECT * FROM PO WHERE ORDERDATE > ::date >>... and enter the same date as a DATETIME value in the paramet window, I get the >aforementioned >>error. >> >>It doesn't make sense. If anyone has any ideas ? >>- Jip >> >> >>>"Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000, >>>Native >>Code: >0)"


Anonymous
Apr 2, 2009 11:13:33 AM

Parameter query cluase error when used for a date.

TRY 2000/10/10 form .. i belive it works >Jip - > >Have you ever figured this out? I am having a similar problem. I cannot figure out >how to put dates into a parameter - no matter how I try to do it, I cannot seem to >get it to work. If you have any ideas, I would apprecaite it. Thanks and take care. > >Mark > >>I'm >running a query using a parameter for a date, example: >>SELECT * FROM po >>WHERE orderdate > :date1 >> >>In the parameter window I fill in the value (e.g. 2008-01-01) and the data type (Date >>Time). >The error I get is >>"Escape clause beginning with --*( or { was not properly ended with *)-- or }. (State:37000, >>Native >Code: 0)" >> >>I've tried various formats for the date, such as: >>01-01-2008, 01/01/2008, 01/01/2008 01:00:00 ... to no avail. >> >>What is the required date format to fill in here ? >>Or what could be the reason for the error message ? >>When I run exactly the same query in Toad it runs fine. >>Can anyone try a similar query successfully & provide the example ? >> >>Thanks, >>Jip

Navigation

Social Media

Powered by 10MinutesWeb.com