Hello folks,

Drat.  I mean Nikolay Zavaritsky's PHP API by way of my inability to
cross reference columns in a table.

The PHP code is very short:

        sedna_connect('localhost','auction','samjones','password');
        sedna_execute(<<<EOM
for \$p in document("auction")/site/people/person
let \$l := for \$i in
document("auction")/site/open_auctions/open_auction/initial
          where \$p/profile/@income > (5000 * \$i/text())
          return \$i
where  \$p/profile/@income > 50000
return <person>
    <name>{\$p/name/text()}</name>
    <items>{\$l}</items>
</person>
EOM
);
        print "<pre>\n"; var_dump(sedna_result_array());

And to recap, what I want is a more structured response -- XML or nested
arrays.

-Sam

> Hi Sam,
> 
> 
> Do you mean Alexander's Delphi API?
> 
> Please, post there also an example of code you run.
> 
> Ivan Shcheklein,
> Sedna Team
> 
> On Wed, Mar 24, 2010 at 8:05 PM, Sam Jones <[email protected]>
> wrote:
>         Hello Everyone,
>         
>         I'm new to Sedna and new to Xquery, so I'll have to ask some
>         patience.
>         I'm using Alexander Kardailsky's PHP API for Sedna.  I'm
>         executing
>         commands that se_terms return as multi-level XML, but the API
>         returns an
>         indexed array of strings.
>         
>         Here's an example which is a slightly modified version of
>         sample07.xquery on the auction database shipped with the Sedna
>         binary:
>         
>         for $p in document("auction")/site/people/person
>         let $l := for $i in
>         document("auction")/site/open_auctions/open_auction/initial
>                  where $p/profile/@income > (5000 * $i/text())
>                  return $i
>         where  $p/profile/@income > 50000
>         return <items>{attribute person {$p/name/text()},
>                       count($l)}</items>
>         
>         In se_term, this query returns this XML:
>         
>         <person>
>          <name>Huei Demke</name>
>          <items>
>            <initial>9.88</initial>
>            <initial>4.12</initial>
>          </items>
>         </person>
>         <person>
>          <name>Jarkko Nozawa</name>
>          <items>
>            <initial>9.88</initial>
>            <initial>4.12</initial>
>          </items>
>         </person>
>         <person>
>          <name>Laurian Grass</name>
>          <items>
>            <initial>9.88</initial>
>            <initial>4.12</initial>
>          </items>
>         </person>
>         
>         Here's the PHP results of the same query.
>         
>         array(3) {
>          [0]=>
>          string(121) "
>          Huei Demke
>         
>            9.88
>            4.12
>         
>         "
>          [1]=>
>          string(125) "
>         
>          Jarkko Nozawa
>         
>            9.88
>            4.12
>         
>         "
>          [2]=>
>          string(125) "
>         
>          Laurian Grass
>         
>            9.88
>            4.12
>         
>         "
>         }
>         
>         It seems that a lot of the structure is lost in the
>         translation.  Is
>         there a way I can get the XML result set in PHP?  Does the C
>         API do the
>         same thing?  Is this even the right place to ask?  I thought
>         some
>         version of the query produced a nested array, which would be a
>         good
>         alternative.
>         
>         -Sam
>         
>         
>         
> ------------------------------------------------------------------------------
>         Download Intel&#174; Parallel Studio Eval
>         Try the new software tools for yourself. Speed compiling, find
>         bugs
>         proactively, and fine-tune applications for parallel
>         performance.
>         See why Intel Parallel Studio got high marks during beta.
>         http://p.sf.net/sfu/intel-sw-dev
>         _______________________________________________
>         Sedna-discussion mailing list
>         [email protected]
>         https://lists.sourceforge.net/lists/listinfo/sedna-discussion
> 


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to