Handling property name with spaces in SQL query

Hello,
I have some JSON that looks like this:
    "SystemId": "112234",
    "Parameter": {
        "Total Hours": [
                "timestamp": "2015-03-15T15:20:00Z",
                "itemValue": "0"
                "timestamp": "2015-03-15T15:15:00Z",
                "itemValue": "296"
..and am having trouble with the space in the "Total Hours" property name.  When executing a SQL query, I have tried to reference it as ["Total Hours"], [Total Hours], and "Total Hours", but none of these works.  I
have also reviewed the "Querying DocumentDB" and "DocumentDB SQL Query Language" documents, but am unclear on how to escape this space.  As this is valid JSON, I would expect to be able to handle it via DocumentDB SQL query, but am
not certain what I am missing.  
Thanks for your help.
Please remember to mark replies as answers if they help you.

Given that the property with the name with the space contains an array, I attempted to query using:
 SELECT * FROM c WHERE c.Parameter.c["Total Hours"][0].timestamp = "2015-03-15T15:15:00Z" and a few other permutations, but no luck.  Did I misunderstand?
Please remember to mark replies as answers if they help you.

Similar Messages

  • SQL Query not working for column names with spaces

    Hi People..
    We have a strange situation wherein, the column name in the database table has a space inbetween like "Constant Name". While we write a JDBC statement code with the select query we get an exception for invalid syntax. It will help us in a great way if you have anything to inform us on this..
    Thanks
    Prabz

    Using case sensitive names and names with spaces in it is not a good practice.
    However, I believe the SQL standard accounts for this with quoted identifiers. I believe the syntax is
    . select "My Field1", "My Field2"
    . from "My Table'
    Have also seen the following although it might be MS Access specific.
    . select [My Field1], [My Field2]
    . from [My Table]

  • How to handle large result set of a SQL query

    Hi,
    I have a question about how to handle large result set of a SQL query.
    My query returns more than a million records. However, the Query Template has a "row count" parameter. If I don't specify it, it by default returns only 100 lines of records in the query result. If I specify it, then it's limited to a specific number.
    Is there any way to get around of this row count issue? I don't want any restriction on the number of records returned by a query.
    Thanks a lot!

    No human can manage that much data...in a grid, a chart, or a direct-connected link to the brain. 
    What you want to implement (much like other customers with similar requirements) is a drill-in and filtering model that helps the user identify and zoom in on data of relevance, not forcing them to scroll through thousands or millions of records.
    You can also use a time-based paging model so that you only deal with a time "slice" at one request (e.g. an hour, day, etc...) and provide a scrolling window.  This is commonly how large datasets are also dealt with in applications.
    I would suggest describing your application in more detail, and we can offer design recommendations and ideas.
    - Rick

  • With clause in SQL query data model

    Hello!
    isn't it possible to use the with clause in sql query data models?
    for example following query:
    WITH
    a_test as (
    select dummy from dual
    select *
    from a_test
    brings up a "XML Parsing Error: no element found"-error...
    BR Paul

    I tried a slightly different query (see below) and the query worked fine and retrieved data.. I did not get any errors.
    WITH
    a_test as (
    select 'dummy' from dual
    select *
    from a_test
    This works as well.. retrieving the value of the parameter
    WITH
    a_test as (
    select :Test_ID from dual
    select *
    from a_test
    thanks,
    BIPuser

  • Executiong prepared statement with Like% in SQL Query?

    Hi,
    We are developing GUI project.In which we need to retrieve the contract details based on the Name which we enter in eVision page.Here we will not enter the whole name,we will enter only the part of the name,for example if the actual name is Sun Seebeyond,I will enter only Su.So if there are five records in data base which starts the name with Su.Then it should return the five names..
    For this I am using the prepared statement as
    select name,contractid from table1 where name Like '?%'.
    Here my runtime input value will set to this parameter ?.When I execute this qry in my project I am getting error as "Unable to set parameters on the Object: Invalid parameter index 1".
    If I replace the ? with Su in query itself ,then it works fine..
    Please let me know is there any effective way,using which I can solve..
    Thanks,
    Renga.S.

    Hi,
    This option I already tried and it work fine too.
    I am looking for an option ,where we can handle with in the Query,so we dont need to write any code appending % into the actual valus.
    Thanks,
    Renga.S.

  • Adding h:dataTable with parameters in SQL query

    Hi,
    I've added a h:datatable to my web app in netbeans. I need this table to display records based on a sql query that contains a WHERE clause that has the currently logged-in user's id.
    Further I need a column with buttons that each perform an operation based on the primary key of the selected row.
    I have no Idea how to do any of this.
    Could anyone please help where to start or point me to a good tutorial.
    Thanks

    Hi BalusC.
    Thanks for the reply.
    Coincidentally I discovered your blog shortly after posting this question, and it has been a great help, thanks!
    I have another related problem now however. I am trying to display messages from the database, and then to allow a user to reply to these messages.
    Everything displays correctly and when I click on the reply link the right text area becomes visible, but for some reason, the action event of the last command button does not fire.
    Could you please help me figure out why it doesn't work.
    I also don't know how to retrieve the message from the right text area input.
    Thanks
    Here's the code in my Home.jsp
    <h:dataTable binding="#{Home.messageTable}" id="messageTable" value="#{Home.messages}" var="dataItem">
                                                                <h:column>
                                                                    <f:facet name="header">
                                                                        <h:outputText value=""/>
                                                                    </f:facet>
                                                                    <h:panelGroup layout="block" styleClass="message_main">
                                                                        <h:outputText styleClass="message_label" value="FROM :"/>
                                                                        <h:outputText styleClass="message_data" value="#{dataItem.sender}"/>
                                                                        <h:outputText styleClass="message_label" value="DATE :"/>
                                                                        <h:outputText styleClass="message_data" value="#{dataItem.dateString}"/>
                                                                        <h:outputText styleClass="message_label" value="SUBJECT :"/>
                                                                        <h:outputText styleClass="message_data" value="#{dataItem.subject}"/>
                                                                        <h:outputText styleClass="message_label" value="MESSAGE :"/>
                                                                        <h:outputText styleClass="message_body" value="#{dataItem.message}"/>
                                                                        <h:commandLink styleClass="message_label" action="#{Home.selectMessage}" value="Reply" />
                                                                        <h:panelGroup rendered="#{dataItem.selected}" layout="block" styleClass="reply_panel">
                                                                            <h:outputText styleClass="message_label" value="Enter reply:"/>
                                                                            <h:inputTextarea styleClass="message_body" />
                                                                            <h:commandButton action="#{Home.sendReply}" styleClass="message_label" value="Send Reply" />
                                                                        </h:panelGroup>
                                                                    </h:panelGroup>
                                                                </h:column>
                                                            </h:dataTable>And the related methods
    public String sendReply()
            Message msg = (Message)messageTable.getRowData();       
            msg.sendReply(?);// Needs the string value of the correct text area
            msg.setSelected(!msg.isSelected());       
            return null;
        public String selectMessage()
            Message msg = (Message)messageTable.getRowData();
            msg.setSelected(!msg.isSelected());
            return null;
        }

  • Combine multiple web services with the same SQL query into one

    Hello,
    I would like to ask a question regarding combine multiple similar web services into one. Can you please tell me if it is possible to combine 4-5 web services into one since they built on the same SQL query with 5 different criterias or condition so that the user can enter any of the 5 criterias to populate the data on the form instead of having 5 different web services?
    e.g Query: Select appName, permit#, address, phone, description, type, section, from table where appName = can be 'appName, permit#, address, phone, or description' to populate the rest of the data to the form.
    Does any one have ever done some thing like this in Workbench ES? If so please assist. I know it can be easier to build it in Visual Basic, C#, or dot.net but the requirement is to build it in workbench ES.
    Thanks in advance,
    Han Dao

    If you are querying for Name, PhoneNumber, and SSN, and you queried for all people with a phone number that started with 867, you would have a potentially long list of people.  So to keep track of all of the people, we store each record in XML complex elements.  The root node is just any name you want, and the repeating element is the complex element name. 
    So using the example from above, I'm going to specify the following:
         Root Node: Result
         Repeating Element: Person
    So now when I do a query, my resultXML will look like:
    <Result>
          <Person>
                 <Name>Alex</Name>
                 <PhoneNumber>867-5309</PhoneNumber>
                 <SSN>111-11-1111</SSN>
          </Person>
    </Result>
    If your query returned multiple results (like ours would probably), it would look like:
    <Result>
          <Person>
                 <Name>Alex</Name>
                 <PhoneNumber>867-5309</PhoneNumber>
                 <SSN>111-11-1111</SSN>
          </Person>
          <Person>
                 <Name>Han</Name>
                 <PhoneNumber>867-2169</PhoneNumber>
                 <SSN>222-22-2222</SSN>
          </Person>
    </Result>
    So Result and Person is just to give a little bit of structure to the xml result (containers really).  So you can name them whatever is helpful for you.
    The column name mappings map the query columns (Name, PhoneNumber, SSN) to some node in the XML (Name, PhoneNumber, SSN).  So you don't need to specify which field maps to what in the form.  Just copy the column names to the element name so you have a 1-to-1 naming.  If you want to manipulate the XML a bit though, you could do:
    Column Name               Element
    Name                            YourName
    PhoneNumber                Phone
    SSN                              Secret
    which would then make your xml look like:
    <Result>
          <Person>
                 <YourName>Alex</YourName>
                 <Phone>867-5309</Phone>
                 <Secret>111-11-1111</Secret>
          </Person>
    </Result>
    It lets you change the XML element names to whatever you want. Otherwise by default they take on their column names.
    In your form, you could bind to the WSDL through the Data Connections pane and point it to your web service.  This will then create form elements that you can just drag and drop allowing you to have the information available when the service gets ran.  Once the service is called, you can modify the field's data to get whatever information you need in order to populate other form fields. 
    If that is too confusing, feel free to send me your form (e-mail is on profile page) and I'll add comments to it to show you how to set up the form for the web service call (and also give me the link to your webservice)

  • Bug in the copy cluster roles wizard - CSV reparse points cannot have names with spaces

    Hi All,
    I have identified a bug in the copy cluster roles wizard in 2012 R2, which is preventing me from migrating my clusters from 2008 R2 & 2012 to 2012 R2.
    The bug surfaces when you attempt to copy a VM role from a 2008 R2 or 2012 cluster that has a CSV reparse point name that contains spaces as follows:
    The role appears to copy across fine, but once you've migrated the CSV and brought it online followed by starting the VM, the VM configuration resource promptly fails along with the VM.
    The issue can be spotted inside the copy cluster roles wizard, where it presents itself by removing all text after the first space in the name to read "C:\ClusterStorage\CSV" rather than "C:\ClusterStorage\CSV
    Test Disk 3" as follows:
    The bug only appears for VMs on CSVs with a reparse point name containing spaces - all other scenarios succeed.
    After searching through the registry on the new cluster, you can clearly see that the VM role hasn't been correctly copied.
    It shows a value called SharedVolumeMappings with the data C:\ClusterStorage\CSV|<guid>|<integer>
    Whereas it should show the data C:\ClusterStorage\CSV Test Disk 3|<guid>|<integer>
    If you modify the data in the SharedVolumeMappings value in both
    0.Cluster\Resources\<VM guid> and Cluster\Resources\<VM guid> keys, the VM will start and work correctly.
    The problem for me is that I have many VMs on many different CSVs all with spaces in the names of the reparse point! Its not feasible for me to go through the registry for every copied VM on every node of the new cluster, as this would take a very long time
    and would be prone to errors that could cause further problems.
    Can anyone provide any help on this? A hotfix for the issue would be great, if anyone from Microsoft is reading :-)
    My deadline to get the VMs migrated to the new cluster is the 21st February, so I would really like to have a solution to the problem before then if at all possible.
    Many thanks in advance,
    Tom

    Hi Subhasish,
    Thanks for the reply, glad that its something that is reproducible!
    Do you have any idea of timescale? Or is it likely that I will have to modify the registry as above to get this working?
    If I am going to have to modify the registry, please can you let me know if the resolution I have tested above is safe and viable? Or are there other settings that I will need to change to make the cluster fully aware of the proper path to the CSVs for its
    VMs?
    Also, is there a known procedure for renaming the reparse point whilst VMs are running on it? This would allow me to negate the issue before copying the roles to the new cluster :-)
    Thanks again,
    Tom

  • How to Handle Dynamic Pivoting with a single SQL?

    I was searching for a single SQL who can dynamically understands the pivoting members in the data, I saw several ways of doing Pivoting depending on the version, some are really hard to understand but just two options upto now seams to be flexable enough to do dynamic pivoting, right?
    1- For this option you have to write PL/SQL block to build up the dynamic single SQL query, I also find this approach very easy to understand. :)
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:766825833740
    2- 11.1 's PIVOT new feature with PIVOT XML and ANY clause, a SINGLE SQL and easy to understand but returns XMLTYPE data, another step to parse to produce the report is needed.
    http://www.oracle-developer.net/display.php?id=506
    Below is a 10g Model Clause example, but here instead of pivoting by A1-A2-A3 staticly I want to have these values by a distinc subquery for example;
    create table test(id varchar2(2), des varchar2(4), t number);
    INSERT INTO test values('A','a1',12);
    INSERT INTO test values('A','a2',3);
    INSERT INTO test values('A','a3',1);
    INSERT INTO test values('B','a1',10);
    INSERT INTO test values('B','a2',23);
    INSERT INTO test values('C','a3',45);
    commit;
    SELECT * FROM test;
    ID DES T
    A a1 12
    A a2 3
    A a3 1
    B a1 10
    B a2 23
    C a3 45
    select distinct i, A1, A2, A3
    from test c
    model
    ignore nav
    dimension by(c.id i,c.des d)
    measures(c.t t, 0 A1, 0 A2, 0 A3)
    rules(
    A1[any,any] = t[cv(i),d = 'a1'],
    A2[any,any] = t[cv(i),d = 'a2'],
    A3[any,any] = t[cv(i),d = 'a3']
    I A1 A2 A3
    C 0 0 45
    B 10 23 0
    A 12 3 1 Any advice is appreciated, thank you.

    Hi,
    You can do dynamic SQL in SQL*Plus, also.
    [Thid thread|http://forums.oracle.com/forums/thread.jspa?messageID=2744039&#2744039] shows how to pivot a table with a dynamic number of columns.

  • Document library: File name with spaces at EOF

    I noticed a strange issue with uploading files with space at end of file (example "ABC  .xlsx"). Such files are allowed to be uploaded for the first time but when the end user (with contribute permission) tries to upload the same file again
    (overwrite) then it uploads the file and goes to the next dialog box where properties for the form is collected (EditForm) and then when user tries to hit save, he gets "Sorry this site is not shared with you" error. The owners (with Full control
    permission) get the error message that the file needs to be renamed. 
    This does not happen with files having proper names. The files are automatically overwritten as expected.
    Is it a SharePoint bug or am I missing something ?

    Hi Prakash,
    When we upload a document which contains spaces at the end of the file name, then SharePoint will trim out the spaces in the Edit Item Form, so the name for this document should be “ABC.xlsx”.
    When we re-upload the document to SharePoint, because of that extra space it sees the filename(ABC  .xlsx) as different to the existing document (ABC.xlsx) so it adds it as a new document.
    And in the edit item form, the space has been trimmed out. Because there is already a document with that filename in the document library, it throws the error.
    So this issue is by design that SharePoint uploads the document first and then edit the properties of the document.
    For more details, please refer to the link below:
    https://discoverlars.wordpress.com/2012/10/27/sharepoint-doesnt-overwrite-a-document-with-the-same-name-but-creates-duplicates/
    Thanks,
    Victoria
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Victoria Xia
    TechNet Community Support

  • Field names with spaces in target file using fcc

    Hello Friends,
    My target structure fields:
    MT_Target
    ItemNo, ItemName, ItemQuantity, AmountValue, TotalAmount
    My requirement here is - In the target file - these fields should be generated with space. Shown as below:
    Item No, Item Name, Item Quantity, Amount Value, Total Amount
    How can i achieve this.
    Thanx
    S.

    if i understood u correctly u want to have a header line in ut target file same as that ur field names but with a space in between??
    if yes  the use :
    NameA.addHeaderLine=3
    NameA.headerLine =Item No, Item Name, Item Quantity, Amount Value, Total Amount
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

  • File download - file name with spaces

    I use the resp.setHeader("Content-disposition", "attachment; filename="+filename) method. it works. However, when the file name contains spaces the dowloaded file's name is only the part of the string up to the space, nothing more. Is there a way to deal with it? I'm replacing spaces for '_' at the moment but that's not exactly what I want.
    Thanks.

    Is the filename put in between quotes?
    resp.setHeader("Content-disposition", "attachment; filename=\"" + filename + "\"")

  • File name with spaces

    Hi,
      I am unable to upload files with file name having blank spaces to cFolders 4.0.
    Kindly help me to resolve this issue.
    Regards,
    Shynu John

    Hi Shynu,
    Please refer the following note.
    Note 959280 - File names with special characters are uploaded incorrectly.
    Regards,
    Pavan

  • Need Help with Creating the SQl query

    Hi,
    SQL query gurus...
    INFORMATION:
    I have two table, CURRENT and PREVIOUS.(Table Defs below).
    CURRENT:
    Column1 - CURR_PARENT
    Column2 - CURR_CHILD
    Column3 - CURR_CHILD_ATTRIBUTE 1
    Column4 - CURR_CHILD_ATTRIBUTE 2
    Column5 - CURR_CHILD_ATTRIBUTE 3
    PREVIOUS:
    Column1 - PREV_PARENT
    Column2 - PREV_CHILD
    Column3 - PREV_CHILD_ATTRIBUTE 1
    Column4 - PREV_CHILD_ATTRIBUTE 2
    Column5 - PREV_CHILD_ATTRIBUTE 3
    PROBLEM STATEMENT
    Here the columns 3 to 5 are the attributes of the Child. Lets assume that I have two loads, One Today which goes to the CURRENT table and one yesterday which goes to the PREVIOUS table. Between these two loads there is a CHANGE in the value for Columns either 3/4/5 or all of them(doesnt matter if one or all).
    I want to determine what properties for the child have changed with the help of a MOST efficient SQL query.(PARENT+CHILD is unique key). The Database is ofcourse ORACLE.
    Please help.
    Regards,
    Parag

    Hi,
    The last message was not posted by the same user_name that started the thread.
    Please don't do that: it's confusing.
    Earlier replies give you the information you want, with one row of output (maximum) per row in current_tbl. There may be 1, 2 or 3 changes on a row.
    You just have to unpivot that data to get one row for every change, like this:
    WITH     single_row  AS
         SELECT     c.curr_parent
         ,     c.curr_child
         ,     c.curr_child_attribute1
         ,     c.curr_child_attribute2
         ,     c.curr_child_attribute3
         ,     DECODE (c.curr_child_attribute1, p.prev_child_attribute1, 0, 1) AS diff1
         ,     DECODE (c.curr_child_attribute2, p.prev_child_attribute2, 0, 2) AS diff2
         ,     DECODE (c.curr_child_attribute3, p.prev_child_attribute3, 0, 3) AS diff3
         FROM     current_tbl    c
         JOIN     previous_tbl   p     ON  c.curr_parent     = p.prev_parent
                                AND c.curr_child     = p.prev_child
         WHERE     c.curr_child_attribute1     != p.prev_child_attribute1
         OR     c.curr_child_attribute2     != p.prev_child_attribute2
         OR     c.curr_child_attribute3     != p.prev_child_attribute3
    ,     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= 3
    SELECT     s.curr_parent     AS parent
    ,     s.curr_child     AS child
    ,     CASE     c.n
              WHEN  1  THEN  s.curr_child_attribute1
              WHEN  2  THEN  s.curr_child_attribute2
              WHEN  3  THEN  s.curr_child_attribute3
         END          AS attribute
    ,     c.n          AS attribute_value
    FROM     single_row     s
    JOIN     cntr          c     ON     c.n IN ( s.diff1
                                    , s.diff2
                                    , s.diff3
    ORDER BY  attribute_value
    ,            parent
    ,            child
    ;

  • Help with APP_USER in SQL query

    Hi,
    I would like to extract a user details in one Item of DML form based on the Logged user and standard authentication schema.
    I have this query in the Item:
    select ANALYST_FIRST_NAME ||' '|| ANALYST_LAST_NAME d, ANALYST_ID r from QTMT_ANALYST where EMAIL = :APP_USER The User in the session is equal to the EMAIL value. In fact, the value in the session is upper case and the other in the database is lower case. I believe that that is not relevant anyway.
    The query do not bring any value. Could you please let me know what I have got wrong?
    APEX: 4.2
    Item Source Type: SQL Query (return single value)
    Thank you and best regards,
    Vladimir

    To be on the safe side you should uppercase both sides of the equation. It could be that the username is entered in lower case.
    But if you think that your query is correct, test it by using a literal instead of the user name.
    select ANALYST_FIRST_NAME ||' '|| ANALYST_LAST_NAME d
    from QTMT_ANALYST
    where upper(EMAIL) = upper(:APP_USER);for testing purposes use something like this:
    select ANALYST_FIRST_NAME ||' '|| ANALYST_LAST_NAME d
    from QTMT_ANALYST
    where upper(EMAIL) = upper('[email protected]');Edited by: Sven W. on Oct 23, 2012 1:30 PM
    APEX: 4.2
    Item Source Type: SQL Query ( return single value )I just noticed that you use an item which has this as the SQL source. This works only if the sql returns one row and one column only. Therefore I removed the second column from your query.
    Edited by: Sven W. on Oct 23, 2012 1:33 PM

Maybe you are looking for

  • Workflow - I am not able to recieve the Deadline notification in my Inbox?

    Hi, I have a workflow wich checks the Incoming invoice against a PO and then I post the Invoice. If no action is taken on the Invoice then a deadline notification is sent to my Inbox. There is no agent assignment and all the process is done in the ba

  • How do you close the stock chart but not the stock widget ?

    I have clicked on a stock and get the stock chart but now I don't want the chart, just the stock price widget. The prices were originally there without the chart and that's the way I would like it. Thanks for any advice. iMac Mountain Lion-Dashboard

  • Essbase and Planning Down.

    Hello All, I have a problem every day in development environment. My Essbase, Shared services, Planning services go down. I really dont understand the problem. These are the logs: Essbase Log: [Thu Dec 01 23:27:19 2011]Local/ESSBASE0///Error(1051429)

  • Problem in joining.

    hi all,        i m selecting hkont (gl no) ,gsber ( business area) from table bseg.    e.g. select hkont gsber from bseg into table ibseg.    now i m selecting subclass(orgz unit) , set name (set id) , valfrom (from value) from table setleaf.      eg

  • Is anyone here fluent in the Controller Assignments window?

    I have a Mackie C4 Pro and I built a rather complex environment layer of virtual sliders (that works) for controlling parameters of an external synth not supported by the C4. I would like to control all the knobs in this particular environment via th