Query Builder - Where Clause - Could not format error using date comparison

We've come across a bug in the Query Builder, under the Create Where Clause tab, if you select a column of Date type plus one of the comparison operators =, !=, <, >, <=, >=, BETWEEN or NOT BETWEEN it displays an error in the Logging Page:
Level: Severe
Source: o.d.r.queryBuilder.SQLGenerator
Message: Could not format :2010-09-02 16:20:31.0
Then under the Show SQL tab it doesn't display the date(s) you selected, e.g.
WHERE LAST_UPDATE BETWEEN AND
Also the View Results tab does not display any results.
You can still press Apply to add the SQL as is to the editor window and from there you have to manually code in the date parameters.
We're using the latest version of SQL Developer 2.1.1.64.45 Windows 32bit version with JDK

Hi Gordon,
When I add the following lines:
declare @refdt1 date
set @refdt =
/*select 1 from jdt1 t0 where t0.RefDate*/ '[%1]'
declare @refdt2 date
set @refdt =
/*select 1 from jdt2 t0 where t0.RefDate*/ '[%2]'
WHERE T0.RefDate >= @refdt1 and T0.RefDate <= @refdt2
... the error message is now:
Must declare the scalar variable @refdt1
Note: Before adding these lines, the query works perfectly, and returns totals from the whole database (with dynamically generated column headings!)
Thanks
Leon Lai
AMENDED QUERY:
declare @refdt1 date
set @refdt1 =
/*select 1 from jdt1 t0 where t0.RefDate*/ '[%1]'
declare @refdt2 date
set @refdt2 =
/*select 1 from jdt1 t0 where t0.RefDate*/ '[%2]'
--------- I inserted the 6 lines above ---------------------
DECLARE @listCol VARCHAR(2000)
DECLARE @query VARCHAR(4000)
SELECT @listCol =
STUFF
( SELECT DISTINCT   '],['    +    CAST(month(T0.RefDate) AS varchar)
FROM  JDT1 T0
FOR XML PATH('')
), 1, 2, ' ') +   ']'
SET @query =
'SELECT * FROM
(SELECT Account, month (T0.RefDate) Month , Debit
FROM JDT1 T0
------------------- I add the WHERE clause below --------------------
WHERE T0.RefDate >= @refdt1 and T0.RefDate <= @refdt2
GROUP BY Account, RefDate, Debit
) S
PIVOT
Sum(Debit)
FOR Month IN ('+@listCol+')
) AS pvt'
EXECUTE (@query)
Edited by: LEONLAI on Oct 21, 2011 2:36 PM

Similar Messages

  • Query in the where clause is not allowed

    Hi all,
    I have a table m_vehicle that stores 1 or more than 1 rows of data for each person. But the partner's schema requires that 0 or 1 vehicle license plate data be sent with the xml file. I have the following nested select statement inside a bigger one and it does not work,
    select xmlelement("VehicleLicensePlate",
         (case when mv.lic_plate_state is not null then
              xmlelement("PlateState", mv.lic_plate_state)
         end), -- end of plate state
         (case when mv.lic_plate_no is not null then
              xmlelement("PlateNumber", xmlelement("ID", mv.lic_plate_no))
         end),
         (case when mv.lic_plate_year is not null then
              xmlelement("PlateExpiryYear", mv.lic_plate_year)                                                  
         end)
         ).extract('/*')
    from m_vehicle mv where mv.mni_id = 1083650
    and mv.seq_no = (select max(mv2.seq_no) from m_vehicle mv2
    where mv2.mni_id = mv.mni_id) and mv.lic_plate_no is not null
    But it works when I run it alone and gets the latest row for the person. It does not work either if I join this table with other tables. My root element select is from dual because I have to supply lots of SOAP and other artifacts in the xml. Is it because I have this root select from dual that the query in the where clause does not work? How do I make it work so that I get 0 or one row only from the table? My solution was to write a function that returns each part of the license plate data using dymanic sql and call it in the xmlelement function. It works but I would like to use plain sql instead.
    Thanks.
    Ben

    By the way, the error I get is this,
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00216: invalid character 3 (0x3)
    Error at line 1
    ORA-06512: at "SYS.XMLTYPE", line 111
    Ben

  • Error 25109 : The install program could not create the config data store. Is this a know issue with a solution?

    Hi I cant install the Management Console.
    I keep getting
    Error 25109 : The installation program could not create the configuration data store. Please see the installation log for more info.
    Has someone come across this problem before?
    I am using
    MS Server 2008 Std x86
    SQL Server 2005 SP2 Std x86
    MDOP 2008 R2
    APP-V 4.5
    Please can someone help.
    Thanks

    I'm running into the same problem myself, I have an almost identical setup.
    Trying to do a clean install of App-V Management Server 4.5 from the MDOP 2008 R2 CD.
    Server OS: Windows Server 2008 Enterprise SP1 (Has WDS and IIS installed (IIS 6 Management Compatibility too), as well as .Net 3.5 SP1 Framework)
    Database: Microsoft SQL Server 2005 Enterprise (Version 9.00.3068.00) (Note: SQL server is running on a different server than the server App-V is being installed on.)
    Installer gets to the point where it starts creating the database than dies, reporting a 25109 error.
    Checked out the logfile the installer created, here's a snip of the last few lines before is starts rolling back the install:
    1
    [2008-12-23 15:58:35] (2284:3084) SQL state: ``01000'', Native: 0, Text: ``[Microsoft][ODBC SQL Server Driver][SQL Server]<<< CREATED TRIGGER dbo.TR_U_SYSTEM_OPTIONS >>>''. 
    2
    [2008-12-23 15:58:36] (2284:3084) SQL state: ``42000'', Native: 18058, Text: ``[Microsoft][ODBC SQL Server Driver][SQL Server]Failed to load format string for error 16873, language id 1033.  Operating system error: 122(The data area passed to a system call is too small.). Check that sqlevn70.rll is installed in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\Resources\1033, where 1033 is the language ID of US English, or the appropriate folder for the locale in use. Also check memory usage.''. 
    3
    [2008-12-23 15:58:36] (2284:3084) SQL state: ``01000'', Native: 3621, Text: ``[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated.''. 
    4
    [2008-12-23 15:58:36] (2284:3084) ::SQLExecDirectW error 0xffffffff. 
    5
    [2008-12-23 15:58:36] (2284:3084) Failed to execute SQL ``/* ------------------------------------------------------------------------- *\ 
    6
        Copyright (c) Microsoft Corporation.  All rights reserved. 
    7
    8
        Description: 
    9
            This script creates all user-defined messages. 
    10
    11
            The types of messages allowed (and their severities) are: 
    12
            FATAL   - SQL Server Severity = 17; ours = 1 
    13
            ERROR   - SQL Server Severity = 16; ours = 2 
    14
            WARNING - SQL Server Severity = N/A; ours = 3 
    Can anyone help me shed some light on what's going on here?

  • Query Bean Where clause

    In Query Bean (Auto Customization Criteria) , OA FWK generate
    where clause automatically .
    I want to disable this criteria in some cases. Is there any way exists?
    (Disable means remove some condition )
    I want to see runtime query with where clause(In case of Query Bean) . Is there is any way to find out it?
    Thanks, Avaneesh

    You have couple of options to do this,
    1. You can use getCriteria API on the queryBean which will stop the query execution by framework and it's the responsibility of the developer to use the dictionary returned by getCriteria and bind the complete where clause yourself.
    2. You can use getNonViewAttrCriteria API on queryBean. This provides a dictionary of criteria on the column which are not mapped to a viewAttribute, for example if you want a poplist in the search region which has values like "Last one week", "Last 2 weeks", "Last 15 days" and so on and want to bind the criteria your self by interpreting the value selected.
    In this case, framework still binds the where clause for the other criteria's which are mapped to a vo based column in the table and expects the developer to bind the criteria for these non viewattribute mappings in the controller.
    I think your requirement fits in the second approach.

  • "Could not get the audio data from the file" error

    Hi
    I get a lot of "Could not get the audio data from the file" errors when opening a project. Sometimes they crash Premiere Pro CC 7.01 (Mac). But if not Premiere works as usual, with the audio.
    I tried to convert the audio files (coming from Audition) from 32 to 16 bit. It worked while opening a project once, but not the following times.
    Where can it come from ?
    Edit: I also get this error when importing audio: "Error: Premiere Pro version 7.0 is not compatible with the Premiere Pro Plug-in version 5.7.4". Maybe it is connected.

    Got it! It was the Smartsound plugin making trouble. Got rid of it and no more errors.

  • "Could not understand your search date" - Error?

    I use date filters in smart albums. No problems until latest update. I now get an error message "Could not understand search date". This happens even if I exactly copy the example given in the error message.
    Any ideas? Is it just me? Is there a work-around?
    Thanks.

    Okay. Still having problems with this. Can anyone help?
    I have a number of "SMART ALBUMS" set up that include date parameters. These always worked well until recently. Now the date parameters are ignored and if I try to set up new ones, I get an error message saying that "Could not understand search date..."
    Leonie kindly suggested the use of 'CALENDAR' instead but this only allows me to specify one specific date. I need to use a specific month or a date range.
    Is anyone else having this search date problem?
    INFO:
    I have checked that I am using the correct date format. Even if, as suggested in the error message, I exactly copy the example formats -
    [Could not understand your search date.
    Some acceptable formats include:
    Oct 13, 2007
    October
    10/13/2007 12:52
    10/2007 4 pm],
    I still get the error message.
    ANY HELP GRATEFULLY RECEIVED
    EDITED UPDATE: I have just tried Lionie's suggested method again and it now works. (Thank you Lionie). However, I'd still like to know why the date thing doesn't work and I now have to change every smart album in my Aperture library to use CALENDAR instead of DATE.
    Message was edited by: Thatblokeoverthere

  • Where clause is not being passed to the report

    I just upgraded my crystal reports from 10.0 to 11 R2. Reports were working fine in 10.0 version,
    Reports are called from vb.net (vissual studio 2005). When I was running this reports using crystal 10.0 and visual studio 2005, it was working fine, After the upgrade report runs but I am noticing that where clause is not being passed to the reports.It generates report as there is no where clause and produces multiple pages report.

    I believe you are encountering an issue documented in [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bip/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note.
    Ludek

  • Could not open error log file ''. Operating system error = 5(failed to retrieve text for this error. Reason: 15105).

    Hello
    When I try to start the SQl server service i get the following error:
    Event id 17058
    Could not open error log file ''. Operating system error = 5(failed to retrieve text for this error. Reason: 15105).
    As a test I have made sure the errorlog file ,and the entire drive it is, has everyone full control permissions, but to no avail. Does anyone have any ideas to resolve this issue?
    Thank you

    Hi,
    Try running:
    SELECT SERVERPROPERTY('ErrorLogFileName')
    Then verify that the account being used to run the SQL Server service account has access to the path output above.  If possible, you could try logging onto the server with the same account used to run SQL Server then navigate to the errorlog folder.
    Thanks,
    Andrew Bainbridge
    SQL Server DBA
    Please click "Propose As Answer" if a post solves your problem, or "Vote As Helpful" if a post has been useful to you

  • SQL Server not Starting Up - Could not open error log file system error = 5(Access is denied.)

    Hi guys,
     I am working on issue with SQL Server 2008 R2 .. we rebooted the server and after that all SQL services is not coming up. below is the error from eventlog...
    SQL Server running under NetworkService account and has full control on this files..
    from Config Manager ....
    The request failed or the service did not respond in a timely fashion....
    From Event log..
    initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 5(Access is denied.).
    Any idea or workaround..?
    Thanks..
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Finally I found solution and was able to bring back online the SQL Services...
    I had a very similar issue with the following error (event log):
    Description:
    The SQL Server (MSSQLSERVER) service terminated with service-specific error 17058 (0x42A2).
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Event Type:      Error
    Event Source:      MSSQLSERVER
    Event Category:      (2)
    Event ID:      17058
    Date:            19/05/2012
    Time:            10:20:14
    User:            N/A
    Computer:      NSQLXX
    Description:
    initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
    Operating system error = 5(error not found).
    In this case the ERRORLOG file had been marked as read only. This was following a scheduled automated boot.  -This
    was culprit
    MSSQL wouldn't not start until this file had been changed.
    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_23951723.html
    Thanks everyone for your kind replies and time...
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

  • Hierarchical query with where clause

    Hi,
    How can I query hierarchically a query with WHERE clause? I have a table with three fields session_id,id and root_id.
    When I try with the following query,
    select id, level from relation
    where session_id = 79977
    connect by prior id = root_id start with id = 5042;
    It gets duplicate values.
    I want the query to show in the hierarchical manner with a filter condition using WHERE clause. Please help me how can I achieve this. If you know any link that describes more about this, please send it.
    Thanks in Advance.
    Regards,
    -Parmy

    Hi Sridhar Murthy an others,
    Thanks a lot for your/the answer. It's working for me. It saved a lot of other work around without the proper knowledge of hierarchical query. Please send me any link that describes these issues in detail and also I hope as I have mentioned in the other message, same cannot be achieved on views or ( on two different tables ???)
    Any way thanks for your reply,
    It's working for me.
    With happiness,
    -Parmy

  • Aspnet_compiler web.config(132): error ASPCONFIG: Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'

    My latest MVC 5 project built with VS 2013 compiled and works fine on my PC but can not be published to server using command line aspnet_compiler. I kept getting the web.config(132): error ASPCONFIG: Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'
    In my web.config file, I have the following as suggested by many for solution:
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
     <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    However, the error is persisting.  I have no clue how to fix this.  Hope someone can help.

    Hello FredVanc,
    As you mentions, it could work with your develop environment, so I am wondering it is that on the server machine, the assembly is not there actually. Here are some information I found which might be helpful:
    https://support.microsoft.com/en-gb/kb/958975?wa=wsignin1.0
    https://social.msdn.microsoft.com/Forums/en-US/1295cfa8-751b-4e9b-a7a7-14e1ad1393b6/compiling-error?forum=adodotnetentityframework
    By the way, since this issue is related with ASP.ENT project, I suggest that you could post it to the ASP.NET forum, there are web experts will help you:
    http://forums.asp.net/
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I fix Error Message = Out Of Memory Could Not Install or Delete Data"

    I have looked all over the internet and there is a lot of discussion about WHY this happens and a lot of discusion about what to do in the future to avoid this from happening.
    I need help with specific steps on how to delete the static image that is stuck on my desktop. The image is large and covers most of my screen. I have shut down, unplugged, let the machine rest....started up several times. Not working.
    The error reads "OUT OF MEMORY - COULD NOT INSERT OR DELETE DATA"
    Thanks!

    Probably you are running out of disk space. Can you interact with your Mac at all, or is the error  message preventing you from using Finder windows?
    I'd try to boot into Save Mode: This will only load a rudimentary version of Max OS X, needing less space, and will clean some caches. The Start Up will tale longer, however.
    When in Save Mode try to empty the Trash and to free as much disk space as you can, by deleting files.
    How much free disk space do you have right now?
    See:
    http://www.wikihow.com/Start-Your-Mac-in-Safe-Mode
    If you cannot access the FInder to free disk space, even in Save Boot Mode, post back.
    Regards
    Léonie

  • I tried to empty my trash and could not - an error code 8003 showed up and stopped me. What can I do to empty the trash?

    I tried to empty my trash and could not - an error code 8003 showed up and stopped me. What can I do to empty the trash?

    Look to the right under 'More like This' - many good sugestions there.

  • Landed Cost Error "Some rows could not be calculated weight data is missin

    Friends,
       I am facing an error "Some rows could not be caluculated weight data is missing [Message 922-7], I have defined the weight in Item Master in Both Purchaing and Sales Data tab.
    Faisal Baloch

    This message is not related to any weight factors for your item master.  They refer to every row in your document must have a weight factor, not physical weight.
    Thanks,
    Gordon

  • HT201407 After doing so, re-downloading the latest firmware 5.1 and extracting and verifying, it came to a point on iTunes where it could not at all, activate my iPhone. A message popped up on iTunes saying - "There is a problem with your iPhone"; We're s

    My iPhne is 4S, after I downloading the latest OS 5.1 and extracting and verifying, it came to a point on iTunes where it could not at all, activate my iPhone. A message popped up on iTunes saying - "There is a problem with your iPhone"; We're sorry, the iPhone you connected may be damaged and cannot be activated for service. We recommend that you visit your nearest Apple Store for more information. Please kindly suggest me how to do.

    Not surprised that you took a paragraph from my post to repost the same issue.
    It is a hardware/software fault which you'll have to get the iPhone replaced if you're under warranty.

Maybe you are looking for

  • Backing up - how to solve after copying whole system - login incorrect

    Hello, I have done an script to backup the whole filesystem and restore it. I am making tests before using forever. For Windows I use ntfsclone and it works perfect, but for ArchLinux I am doing: I use Knoppix cd-live to manage everything. I load the

  • Thunderbolt to Gigabit Ethernet Adaptor and iPad 4

    Is there a way to connect the Thunderbolt to Gigabit Ethernet Adaptor to an iPad 4?

  • Com.collaxa.cube.i18n.exception_cube, locale en_US

    Hi, I am using BPEL 10.1.3.1. Now i have sent in errornious data when acquiring a task by providing an in-correct taskID. So i should be getting a oracle.bpel.services.workflow.WorkflowException but then i am getting a <b> java.util.MissingResourceEx

  • ISync and Mac OS 10.8 (Mountain Lion)

    Another year, another cat (I'm still waiting for "Tabby"). Would greatly appreciate anyone that has installed, or is planning to install Mac OS X Mountain Lion (10.8) trying out iSync, and letting us know whether it still functions in the limited "no

  • FAQ with Answers for all forums (To Moderators)

    Hi, Looking at many of the forum messages I felt that few of them are repititive in nature. If the moderator can send the Important messages(Q & A) of a particular forum to somebody in oracle and if they can maintain that as FAQ for each forum on OTN