Retrive records using ODATA with SQL functions

Hi,
I want to use SQL functions (for instance replace function) while retrieving records using ODATA endpoint using javascript. Like this:
parent.SDK.REST.retrieveMultipleRecords(
"$select=AccountId,Name,Telephone1&$filter=" + "replace(Telephone1,'-','') eq '12345678'",
function (accountresults) {
errorHandler,
function () {
But this is ending up with 404 bad request. Is there any way to achieve the same using any other technique?
blog: <a href="http://technologynotesforyou.wordpress.com">http://technologynotesforyou.wordpress.com</a> | skype: ali.net.pk

ODATA only supports simple comparison operators, and startswith, endswith and substringof. There are 2 approaches you could use without modifying the data:
Have a less selective filter in ODATA, then filter the rest of the data in javascript. In this example, you could use ODATA to find all records where the telephone1 field has each of '1', '2', '3' etc, then use javascript to do the replace comparison. It
depends how many records you have as to whether this is practical
Write a plugin on RetrieveMultiple that applies the functions you want. This is not necessarily simple, and you'd need to determine how you identify in the query that you want to use a function like replace
Another option could be to use a plugin when data is saved to strip out the characters you don't want, and store the results in a different field that you could then query on
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

Similar Messages

  • Not able to copying files/folders from one Document Library to another Document Library using Open with Browser functionality

    Hi All, 
    We have SharePoint Production server 2013 where users are complaining that they are not able to copy or move files from one document library to another document library using “Open with Explorer” functionality.
    We tried to activate publishing features on production server but it did not work. We users reported following errors:  
    Copying files from one document library to another document library:
    Tried to map the document libraries and still not get the error to copy files: 
    In our UAT environment we are able to copy and move folders from using “Open with Explorer” though.
    We have tried to simulate in the UAT environment but could not reproduce the production environment.  
    Any pointers about this issue would be highly appertained.
    Thanks in advance
    Regards,
    Aroh  
    Aroh Shukla

    Hi John and all,
    One the newly created web applications that we created few days back and navigated to document library, clicked on “Open with Explorer”, we get this error.
    We're having a problem opening this location in file explorer. Add this website to your trusted and try again.
    We added to the trusted site in Internet Explorer for this web application, cleared the cache and open the site with same document library but still get the same above error.
    However, another existing web application (In same the Farm) that we are troubleshooting at the moment, we are able click on “Open with Explorer”,  login in credentials opens and we entered the details we are able to open the document
    library and tried to follow these steps:
    From Windows Explorer (using with Open with Explorer), tried to copy or move a files to
    source document library.
    From Windows Explorer moved this file to another destination document library and we got this error.
    What we have to achieve is users should be able to copy files and folders using
    Open with Explorer functionality. We don’t know why Open with Explorer
    functionality not work working for our environment.  
    Are we doing something wrong? 
    We have referred to following websites.
    we hope concepts of copying / Moving files are similar as SharePoint 2010. Our production environment is SharePoint 2013.   
    http://www.mcstech.net/blog/index.cfm/2012/1/4/SharePoint-2010-Moving-Documents-Between-Libraries https://andreakalli.wordpress.com/2014/01/28/moving-or-copying-files-and-folders-in-sharepoint/
    Please advise us. Thank you.
    Regards,
    Aroh
    Aroh Shukla

  • Can I use ajaxOnLoad with a function to which I give a parameter?

    I accidentaly posted this on the live docs... So here I go again:
    Can I use ajaxOnLoad with a function to which I give a parameter? 
    e.g.: 
    <cfset ajaxOnLoad("initCourses('#tmpUUID#')") /> 
    The JS function looks as following: 
    initCourses=function(tmpUUID){ 
         ColdFusion.Layout.collapseAccordion('awCourseList','awCourseList_1_'+tmpUUID); 
         // the _1_ in the name is set through the currentRow attribute while looping through a query
         setWinUnsaved; 
    I'm having the problem, that my first accordion panel doesn't initialize hidden, so I wrote this method. Later on I noticed, that the accordions were somehow cached, so the URL params given whithin the source weren't right anymore. This might be, because I gave name attributes to the layoutareas. I added an UUID to the name attribute so the source wasn't cached anymore. But now it doesn't seem to find the cflayout container anymore. (I checked the name of the layoutarea and the temporary saved uuid, they are the same.) 
    I tried using cfhtmlhead instead, but that didn't seem to work neither.

    So I've been searching the whole day yesterday and many hours today and this is what I got:
    <cfsavecontent variable="jsheadcont">
         <script type="text/javascript">
         <!--
              initCourses('#tmpUUID#');
         //-->
         </script>
    </cfsavecontent>
    <cfhtmlhead text="#jsheadcont#">
    And that's what my JavaScript function looks like:
    initCourses=function(tmpUUID){
         setTimeout("ColdFusion.Layout.collapseAccordion('awCourseList','awCourseList_1_"+tmpUUID+ "')",1);
         setWinUnsaved;
    So I'll have to write all that instead of a simple
    <cfset ajaxOnLoad("initCourses('#tmpUUID#')") /> ?
    Or am I completely wrong? I forgot to mention that the accordion is inside a tab-layout which is inside a border-layout.
    Cheers
    Boris

  • How to find listing of modules which has used xyz PL/SQL function?

    Hi,
    How I can find the list of forms/reports which has used xyz pl/sql function?
    I want to delete a pl/sql function but before that I would like to
    make sure this function is not being used by any forms/report.
    Thanks for your help!!
    D

    There are many tools available for finding out the particular string across many forms in one shot.
    One such utility is forms apimaster.
    You can download it's 30 days free trial from the internet.

  • Problem to create a link with parameters using a PL/SQL function body

    Hi everybody,
    I need some help to create a link on a SELECT statement.
    I have a region report with type "PL/SQL function body return SQL query".
    I would like to use a link using HTML tag <a href>.
    I know how to do the link, but I don't know to pass a parameters in <a href> statement.
    Always I tried it doesn't work well.
    My PL/SQL anonimous block is, (just with link) :
    DECLARE
    q vARCHAR2(4000);
    BEGIN
    q:='select     "INDICADOR"."NRINDICADOR" as "NRINDICADOR",';
    q:=q||'     "INDICADOR"."DSINDICADOR" as "DSINDICADOR",';
    q:=q||'''<span style="font-weight:bold;">';
    q:=q||'''||TO_CHAR("TOTAL_INDICADOR"."VL_INDICADOR", ''999G999G999G990D00'')||''</span>''';
    q:=q||' as "VL_INDICADOR",';
    q:=q||'     "TOTAL_INDICADOR"."VL_META" as "VL_META" ';
    q:=q||' from     "TOTAL_INDICADOR" "TOTAL_INDICADOR",';
    q:=q||'     "INDICADOR" "INDICADOR" ';
    q:=q||' where "INDICADOR"."NRINDICADOR"="TOTAL_INDICADOR"."NR_INDICADOR"';
    RETURN q;
    END;
    Thanks for any help,
    Alessandra

    Your code is in a default value for an item, right?
    You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
    How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
    Message was edited by:
    Bill Carlisle

  • EBS ISG using custom PL/SQL functions that return XMLType

    Hi,
    We have a custom PL/SQL package that we use for interfacing systems and some of the functions in this package ruturn an XMLType. We want to deploy the package functions as web services through the ISG, but it is not working as expected. When deployed through the ISG, the functions with XMLType return type produce a null response from the ISG (they work fine when called in SQL or PL/SQL; functions with non-XMLTypes work fine).
    If we change the return type to CLOB (and use getClobVal() on the XMLType) then we get a response from the ISG, but it changes all the angle-brackets in the CLOB (which is still arbitrary XML text) to &lt; &gt; ...
    What is the proper way to get the complex XMLType output through the ISG? Anyone have any more experience?
    Thanks,
    --Walt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Alex,
    For the predicate groups that are indexed/stored, the exact operator types (as in equality, inequality, like etc) that are indexed are specified while assigning the default index parameters. In the following example, exf$indexoper is used to specify the list of indexed operators.
    BEGIN
      DBMS_EXPFIL.DEFAULT_INDEX_PARAMETERS('Car4Sale',
        exf$attribute_list (
           exf$attribute (attr_name => 'HorsePower(Model, Year)',
                          attr_oper => exf$indexoper('=','<','>','>=','<='),
                          attr_indexed => 'FALSE')    --- stored predicate group
    END;
    /You can find more information about exf$indexoper at
    http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/t_expfilobj.htm#ARPLS153
    Could you confirm that you chose to index 'is null' and 'is not null' while assigning the default index parameters ? This information is available in OPERATOR_LIST column of the USER_EXPFIL_DEF_INDEX_PARAMS view.
    Hope this helps,
    -Aravind.

  • Using an Oracle SQL Function from JPA/TopLink

    How do I get the return value from a simple (one string input parameter, returns a string) Oracle SQL Function?
    Thanks!

    If you mean calling a stored function in Oracle, you might try something like:
        ValueReadQuery vrq = new ValueReadQuery();
        SQLCall call = new SQLCall("begin ###res := pkg.funcInp(#inp); end;");
        vrq.setCall(call);
        Query q = em.createNativeQuery("");   // we need a Query; any query would do; we replace its contents below
        ((EJBQuery)q).setDatabaseQuery(vrq);
        q.setParameter("inp", "paramValue");
        String result = (String)q.getSingleResult();
        // #=input; ###=output; ####=input/output;
        // if you want to explicitly specify the type of an output parameter, use #### instead of ###,
        // because pure "output" parameters are always treated as java.lang.StringThis will only work in TopLink Essentials, though. I don't know how to do it in Hibernate. I have dealt mainly with TopLink, and just a little with Hibernate.
    In my opinion, it's a HUGE omission not to have support for stored procedures in JPA. Virtually every project I have worked on (in two large companies) has consisted of a large portion of code in stored procedures (sometimes as much as 50% of the overall code). It's a pain to have to go through all that trouble to call the stored procedures.
    Also, pay special attention to TopLink's shared L2 cache. If a stored procedure changes something in the database, TopLink won't know about it and chances are that you will end up with stale objects in the cache which you will either have to refresh, or you'd have to invalidate TopLink's cache for these objects.
    Best regards,
    Bisser

  • Is it possible to use MERGE with sql*plus and if yes how?

    Hello everybody,
    I have an xls file and I have to load its data with sql*loader, but instead of "APPEND" operation stated in the control file I need MERGE operation.Here is what my control file contains:
    LOAD DATA
    INFILE 'C:\WORK\DSK_WH\LOAD_FIRST\sqlldr\data.csv'
    BADFILE 'C:\WORK\DSK_WH\LOAD_FIRST\sqlldr\p_badfile.txt'
    APPEND
    INTO TABLE D_ACCOUNT_NAMES_TMP
    FIELDS TERMINATED BY ";"
    TRAILING NULLCOLS
    (account_number , consignment, sub_consignment, consign_sub_consign, account_name_bg, account_number_2, consign_parent_2, account_name_bg_2, account_number_3, account_name_bg_3, account_number_4, account_name_bg_4, account_number_5 , ACCOUNT_NAME_BG_5 ).
    How can I use merge in this case , instead of insert ?
    Regards,
    Maria

    I'm not sure if there is any MERGE thing in SQL*Loader, but you can have a backup table which gets loaded by SQL*Loader and then use MERGE statement from backup to the original table, if your data is not huge to become a performance barrier. This is just a suggestion, may be you can try some reading of SQL*Loader here.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/part2.htm#436160
    Cheers
    Sarma.

  • Using Starts-with XSLT function with XI

    Hi All,
    Any help is apperciated. I am using the starts-with xslt function and when i do so the message gets stucks in the queue. If i run code without the starts-with then is works??
    <xsl:for-each select="receipt/prod">
         <xsl:for-each select="carrier/carrier_detail/carrier">
               <xsl:choose>
                   <xsl:when test="carrier_type='CASE'">
                        <xsl:choose>
                             <xsl:when test="starts-with(carrier_barcode, '00')">
                                                   do something
                                            </xsl:when>
                                           <otherwise>
                                                 do something
                                           </otherwise>
    so on..
    when i try to process messsage using this xslt format it gets sysfail in the queue, but without it, it works fine.
    I need to a special format if the condition of barcode starts with 00

    Chirag,
    Create xslt on abap mapping using transaction SXLT_TOOL on XI abap stack. Copy paste same xslt code and run with test file. You can debug code or most likely you can see error message too.
    Actually your mapping raising an exception which result in sys-fail.
    Hope this will help.
    Nilesh

  • Using blobs with SQL*Net 8

    Hello,
    Can someone please help me get oriented in the following:
    Clients have Oracle Forms Developer 6i installed on 100 machines. This is from 1996 I think. It comes with SQL*Net 8.
    They want a simple utility that uploads a file into a blob field on the remote database.
    I already developed the utility thinking that they have Oracle 9i2 installed - so I used OCCI. This is not a possibility with the old technology they are actually using..
    So what is the place to start?
    Thank you!!
    david

    You can try with PRO-C

  • Problem accessing Infosets using Query with SQL

    Hi,
    I have Lumira desktop version 1.18.0.
    Using the Query with SQL connection, I successfully connected to SAP R/3 6. I was able to view the User Groups under CATALOG_VIEW, but it seems I cannot go beyong this point and select an Infoset. When I click on an Infoset I expect the Query pane to be populated with the SQL statement but nothing happens.
    I attached a screenshot for clarification
    Thanks
    Dany

    Hi Dany,
    A suggestion for you would be to use another client tool & check if the behavior is the same. I suggest that you use Information Design Tool (from BOE 4.1), create a connection to your ERP, then a data foundation on top of that connection and check if the behavior is the same. This way we can isolate if the problem is caused by the client tool or by the backend.
    My 2 cents
    Antoine

  • How to find the records using contains with the word like this 'some text-some text'?

    Hi,
    How to find the records using the full text contains keyword and that column contains ‘some text-some text’
    In the above some text can be anything.
    Does anybody know please let me know.
    Thanks,

    Hello,
    You can try to create a Full Text Index on the table and use CONTAINS() to get the record which contains the specify words.
    For example:
    SELECT * FROM TABLE WHERE CONTAINS(column_name, 'some text')
    Reference:
    Full-Text Search (SQL Server)
    Creating Full Text Catalog and Full Text Search
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Polling for new Data in Tables with SQL-functions

    Hi
    In my table I have 2 columns:
    event_state : integer (0 = unread, 1 = read)
    min_process_time : date
    In the DB-Adapter-Wizard I can configure my event_state-Field for using as logical delete field. In the SQL-Query there is a
    ... WHERE event_state=0
    But, I only want to query all new entries in this table, where
    min_process_time > SYSDATE.
    How can I configure my toplink-mapping, that SYSDATE can be used in the polling-query? If I use plain-sql instead of the expression from the Wizard (last page), then this sql-statement is ignored. In an expression I only can use a constant-value.
    Any idea?
    Thanks
    Gregor

    Hi
    I am creating a database Polling (logical delete OPEN to CLOSED) adapter that polls a table for records which have a "SCHEDULED" date field.
    The Polling Adapter should pick up those records where the status is OPEN and SCHEDULED<=SYSDATE.
    DB Adapter wizard does not allows this where clause(SCHEDULED<=SYSDATE) to be set; so i tried modifying the Toplink SQL with custom SQL. But it does not works. Please suggest a workaround.
    Please help.
    Thanks
    Debashis

  • Using XPath with SQL to extract XML data

    Given data such as this one:
    <?xml version="1.0"?>
    <ExtendedData>
       <Parameter name="CALLHOLD"><BooleanValue>true</BooleanValue></Parameter>
      <Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BARRING_PASSWORD" xsi:nil="true"/>
      <Parameter name="ALLCF"><BooleanValue>true</BooleanValue></Parameter>
      <Parameter name="RealProv"><BooleanValue>false</BooleanValue></Parameter>
    </ExtendedData>I normally use extractValue function as shown below for example to extract the value for the last parameter in the data above, e.g:
    select extractValue(extended_data,'/ExtendedData/Parameter[@name="RealProv"]/BooleanValue') "my_column_alias" from tableAny ideas on how I may return the value of the parameter xsi:nil from this node:
    <Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BARRING_PASSWORD" xsi:nil="true"/>I'd like to extract the true in xsi:nil="true"...
    Thanks,
    Edited by: HouseofHunger on May 15, 2012 2:13 PM
    Edited by: HouseofHunger on May 15, 2012 2:13 PM

    Extractvalue() has a third parameter we can use to declare namespace mappings :
    SQL> with sample_data as (
      2    select xmltype('<?xml version="1.0"?>
      3  <ExtendedData>
      4    <Parameter name="CALLHOLD"><BooleanValue>true</BooleanValue></Parameter>
      5    <Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BARRING_PASSWORD" xsi:nil="true"/>
      6    <Parameter name="ALLCF"><BooleanValue>true</BooleanValue></Parameter>
      7    <Parameter name="RealProv"><BooleanValue>false</BooleanValue></Parameter>
      8  </ExtendedData>') doc
      9    from dual
    10  )
    11  select extractvalue(
    12           doc
    13         , '/ExtendedData/Parameter[@name="BARRING_PASSWORD"]/@xsi:nil'
    14         , 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
    15         )
    16  from sample_data
    17  ;
    EXTRACTVALUE(DOC,'/EXTENDEDDAT
    true
    If you're on 11.2.0.2 and up, extractvalue() is deprecated.
    One should use XMLCast/XMLQuery instead :
    SQL> with sample_data as (
      2    select xmltype('<?xml version="1.0"?>
      3  <ExtendedData>
      4    <Parameter name="CALLHOLD"><BooleanValue>true</BooleanValue></Parameter>
      5    <Parameter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="BARRING_PASSWORD" xsi:nil="true"/>
      6    <Parameter name="ALLCF"><BooleanValue>true</BooleanValue></Parameter>
      7    <Parameter name="RealProv"><BooleanValue>false</BooleanValue></Parameter>
      8  </ExtendedData>') doc
      9    from dual
    10  )
    11  select xmlcast(
    12           xmlquery('/ExtendedData/Parameter[@name="BARRING_PASSWORD"]/@xsi:nil'
    13            passing doc
    14            returning content
    15           ) as varchar2(5)
    16         )
    17  from sample_data
    18  ;
    XMLCAST(XMLQUERY('/EXTENDEDDAT
    true
    Note : the xsi prefix is predefined when using Oracle XQuery, so in this case we don't have to declare it explicitly.
    Edited by: odie_63 on 15 mai 2012 15:23

  • Using prompts with SQL query

    Post Author: wleonetti
    CA Forum: Crystal Reports
    Hello!
    I have acquired a report from our regional headquarters, and have been asked locally to add a prompt to one that already exists in the report.
    The report currently uses an SQL query, which in turn uses a single prompt to limit the data reported. However, the name of the parameter in the Field Explorer in Parameter Fields is "Facility", but, when I use the Database Expert and select edit for the query (under Selected Tables, right-click on "Command" under the database and click on "Edit Command"--is Command a default name?), under the Parameter List, the name of the parameter there is "Facility1" (?). The SQL references the parameter "Facility1" (...like '{?Facility1}'), but I cannot find any link/interface between the Parameter List "Facility1" to the Parameter Field "Facility", and I cannot find any other references to "Facility1" anywhere else in the report (sorry, I'm very new at CR, and am not sure how to do a global search of a desired text string in the reports).
    I have asked the author for an explanation, but he would only offer, after indicating that he ... was not obligated to help me in any way .., the following bone: "I just simply rename the parameter in Command from Facility1 to Facility which bears the same name as the parameter interface and it just works fine." This only served to confuse me more, since the parameter name currently in Command is  "Facility1" (and the report works the way it is)--when I change the name of the parameter in Parameter List (and the parameter name in the SQL query) to "Facility" (to match the Parameter Field's "Facility"?) ... the parameter in the Parameter Fields ... disappears?
    Can someone please instruct me how to, in whatever steps are necessary, add a parameter to the Parameter Fields and edit the SQL code to use that parameter? or point me to some documentation that will help me with this?
    Thanks in advance for any help offered.
    wleonetti

    Hi Eric,
    Try expressing the source as this:
    begin
       return functionname(to_date('30-sep-2010', 'dd-mon-yyyy'));
    end;That works fine for me, and if I take out the begin-end and the trailing semicolon from the return statement I get the same behavior as you.
    It does mention in the help for the source (only during the wizard though) that this source type has to be expressed that way, but I agree it would be helpful if the tool would validate for this format when 'Function Returning SQL Query' is used or give some sort of indication of the trouble. Anyway, this should get you going again.
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

Maybe you are looking for

  • What is the best way to add a blog to a flash site?

    I am just about wrapping up the construction of my site and I am left with my last small project--a blog.  I would like the site and the blog to run on the same parent site and to be as uniform as possible.  What would be the best way to do this?  I

  • How to create Journal Voucher ?

    I 've tried the sample codes from the SAP Help and other with the same result.  I can't create a Journal Voucher.  Either the errors "-5011 Error Msg:Tax account has not been defined for the selected tax", "-5002 Error Msg:Date deviates from permissi

  • Small fonts in JRE

    Hi I have netbeans 5, and im workin on jdk 6 beta (i want some new features), its workin very well, its even more stable than windows itself, but i have a small problem, all the fonts of the java components are very small, is there anyway to fix this

  • Current execution time of sql

    Hi Folk Have Oracle 9i2. How can i find out the current execution time of a running or an ended sql/query? is there any view like v$session_longops? i will see the query and the time of the query. Regards

  • Downloaded ringtones from iTunes need help

    I have just bought a iphone and downloaded 'The top 100" ringtones from the itunes store. The ringtones are in my library and I've synced my phone but the ringtones do not appear on my phone. Can anyone help before I have a major breakdown