Jahia Dev Forum > How to write query...

0 (0 Good)
0 (0 Bad)

How to write query jahia Sql query ?

by  bhadreshshiroya »  2014/02/18 14:05

 
 [testjwnt:faq] > jnt:content, testwmix:testContent
 - nodename(string) i18n
 - question (string) i18n
 - answer (string, richtext) i18n
 
 
 
I have to write query  
SELECT * FROM [testjwnt:faq] as faq  where  faq.[jcr:nodename]='Passwort'  not work
 
How to write query jahia Sql ?
 
And using distnict keyword query syntax and where clouse ?
  • How to write query jahia Sql query ?
    2014/02/19 07:06

    bhadreshshiroya <div> &nbsp;</div> <div> &nbsp;[testjwnt:faq] &gt; jnt:content, testwmix:testContent</div> <div> &nbsp;- nodename(string) i18n</div> <div> &nbsp;- question (string) i18n</div> <div> &nbsp;- answer (string, richtext) i18n</div> <div> &nbsp;</div> <div> &nbsp;</div> <div> &nbsp;</div> <div> I have to write query &nbsp;</div> <div> SELECT * FROM [testjwnt:faq] as faq &nbsp;where &nbsp;faq.[jcr:nodename]=&#39;Passwort&#39; &nbsp;not work</div> <div> &nbsp;</div> <div> How to write query jahia Sql ?</div> <div> &nbsp;</div> <div> And using distnict keyword query syntax and where clouse ?</div>

  • Number of messages  18
    Registration date Feb 18, 2014
    0 (0 Good)
    0 (0 Bad)

    Re: How to write query jahia Sql query ?

    by  shyrkov »  2014/02/18 14:42

    Hello Bhadresh,

    would you like to query on node name or on the value of the "nodename" property, you have in your testjwnt:faq node type definition?

    if you would like to query on property value, than it should be:

    select * from [testjwnt:faq] where [nodename] = 'Paswort'

    if it is on the node name, it should be:

    select * from [testjwnt:faq] where localname() = 'Paswort'

     

    Kind regards

    Sergiy

     

    P.S. By the way, the "nodename" property is a bit confusing, especially as internationalized one (i18n).

  • Re: How to write query jahia Sql query ?
    2014/02/18 14:42

    shyrkov <p> Hello Bhadresh,</p> <p> would you like to query on node name or on the value of the &quot;nodename&quot; property, you have in your testjwnt:faq node type definition?</p> <p> if you would like to query on property value, than it should be:</p> <p> select * from [testjwnt:faq] where [nodename] = &#39;Paswort&#39;</p> <p> if it is on the node name, it should be:</p> <p> select * from [testjwnt:faq] where localname() = &#39;Paswort&#39;</p> <p> &nbsp;</p> <p> Kind regards</p> <p> Sergiy</p> <p> &nbsp;</p> <p> P.S. By the way, the &quot;nodename&quot; property is a bit confusing, especially as internationalized one (i18n).</p>

  • Number of messages  407
    Registration date Feb 18, 2014
    Contact
    Share
    Feedback

    Get in touch

    Whether you are a current user or if you are just evaluating Jahia, we are here to help.

    Contact us

    Share this page