Hello Eduardo,

I am glad it worked. In this case, I don't think this will put a heavy load on the database. Oracle should have little trouble with concatenating two short text strings.

Regards,
Frans

On 2013-11-14 21:30, Eduardo Fernandez wrote:
Hi Frans,

Thanks for your reply. I used a CONCAT function (actually the CONCAT with ||) and It worked! I'm fairly new to D2R so it never ocurred to me that I could use a sqlExpression.

Should I be worried about the performance on the DB? According to the D2R docs:

    "
    Note that querying for such a computed value might put a heavy
    load on the database.
    "


Regards,
Eduardo Fernandez



2013/11/14 Frans Knibbe | Geodan <frans.kni...@geodan.nl <mailto:frans.kni...@geodan.nl>>

    Hello Eduardo,

    Here <http://d2rq.org/d2rq-language#example-uri-sql-expression> is
    an example from the documentation that uses a SQL function to
    concatenate column values. Would that work in your case?

    Regards,
    Frans


    On 2013-11-14 0:38, Eduardo Fernandez wrote:
    Hi,

    Suppose I have a table PERSONS like this:


    ID   |   FIRST_NAME  |
    LAST_NAME   |  SECOND_LAST_NAME
    --------------------------------------------------------
    1
      |   Pedro |      Martinez   |             Perez
    2   |    John   |       Smith
     |             NULL


    It's an Oracle DB.
    The column SECOND_LAST_NAME represents a second column for those
    people who have more than one last name as used in many
    Spanish-speaking countries.

    I'm trying to create a d2rq:pattern on a PropertyBridge that
    "joins" the LAST_NAME and SECOND_LAST_NAME, i.e.:

    "@@PERSONS.LAST_NAME@@ @@PERSONS.SECOND_LAST_NAME@@"
    <mailto:@@PERSONS.LAST_NAME@@@@PERSONS.SECOND_LAST_NAME@@>

    The property will be created correctly for the ID=1, "Martinez
    Perez", but for those people who have a NULL value on the
    second_last_name it will fail miserably.

    I believe this is because the way Oracle handles the empty value
    as a NULL value instead of an empty string.

    Any workaround?

    Regards,
    Eduardo


    
------------------------------------------------------------------------------
    DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
    OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
    Free app hosting. Or install the open source package on any LAMP server.
    Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
    http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk


    _______________________________________________
    d2rq-map-devel mailing list
    d2rq-map-devel@lists.sourceforge.net  
<mailto:d2rq-map-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


-- --------------------------------------
    *Geodan*
    President Kennedylaan 1
    1079 MB Amsterdam (NL)

    T +31 (0)20 - 5711 347
    E frans.kni...@geodan.nl <mailto:frans.kni...@geodan.nl>
    www.geodan.nl <http://www.geodan.nl> | disclaimer
    <http://www.geodan.nl/disclaimer>
    --------------------------------------

    
------------------------------------------------------------------------------
    DreamFactory - Open Source REST & JSON Services for HTML5 & Native
    Apps
    OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
    Free app hosting. Or install the open source package on any LAMP
    server.
    Sign up and see examples for AngularJS, jQuery, Sencha Touch and
    Native!
    http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
    _______________________________________________
    d2rq-map-devel mailing list
    d2rq-map-devel@lists.sourceforge.net
    <mailto:d2rq-map-devel@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel




--
--------------------------------------
*Geodan*
President Kennedylaan 1
1079 MB Amsterdam (NL)

T +31 (0)20 - 5711 347
E frans.kni...@geodan.nl
www.geodan.nl <http://www.geodan.nl> | disclaimer <http://www.geodan.nl/disclaimer>
--------------------------------------
------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
d2rq-map-devel mailing list
d2rq-map-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to