[JDEV] MORE EXAMPLES! - FW: [jadmin] Complex DTD=2 SQL

Bernino Lind lind at hlgroup.dk
Thu Jun 26 13:07:29 CDT 2003


Dear Wan et. al.

I have previously mailed an example to jadmin list.

I do not mind setting it up nicer, html'ing it and committing it to
jabber.org free for use - but I do not have access to this.

Our company is programming a set of games in flash which uses sockets,
and sice flash is oop xml is perfect for the job. Falsh has a built in
xml to object interpreter - nice.

So next is to expand jabber server to give access to whatever game data
we need, and it is in this context I can give you the examples.

I will mail you one personally.

Best regards, Bernino

-----Original Message-----
From: jadmin-admin at jabber.org [mailto:jadmin-admin at jabber.org] On Behalf
Of Wan Chan Kein
Sent: Friday, June 27, 2003 1:43 AM
To: jdev at jabber.org
Cc: Jadmin at Jabber. Org
Subject: RE: [JDEV] MORE EXAMPLES! - FW: [jadmin] Complex DTD=2 SQL 


Dear Berlino,
Maybe its true what you say .. but why can you how us how you do it ..
and help other pple ? thanks in advice Wan


-----Mensaje original-----
De: jdev-admin at jabber.org [mailto:jdev-admin at jabber.org]En nombre de
Bernino Lind Enviado el: jueves, 26 de junio de 2003 11:10
Para: jadmin at jabber.org; jdev at jabber.org
Asunto: [JDEV] MORE EXAMPLES! - FW: [jadmin] Complex DTD=2 SQL


Dear Sirs,

A little criticism...

I have been flooded with emails to me directly with people asking for my
code in how I do what ever special twists with the Jabber server.

That should be a clear indication to the developers and the
documentation facilitators that a lot of documentation in examples is
necessary when it comes to simple standard manipulation of server side
jabber.

Here is an example of my point, being that like myself 3 weeks ago, I
did not know what the actual iq packets should look like...

Names have been foo'ed out.

Best regards, Bernino



-----Original Message-----
From: John Doe [mailto:john at doe.gov]
Sent: Thursday, June 26, 2003 5:51 PM
To: Bernino Lind
Subject: RE: [jadmin] Complex DTD=2 SQL


yes i check it out..
what do you send to jabber to make that query ?
hope you can explain it a little bit more.
Doe


-----Mensaje original-----
De: Bernino Lind [mailto:lind at hlgroup.dk]
Enviado el: miércoles, 25 de junio de 2003 15:46
Para: 'John Doe'
Asunto: RE: [jadmin] Complex DTD=2 SQL


Dear Doe,

Check out my example in a previous mail in the mail list.

Reply me if you cant find it, I shall dig in my sent folder...

Best, Bernino



-----Original Message-----
From: John Doe [mailto:john at doe.gov]
Sent: Thursday, June 26, 2003 3:32 AM
To: lind at hlgroup.dk
Subject: RE: [jadmin] Complex DTD=2 SQL
Importance: High


hi bernino !
can i ask you something .. did you have to code something or just you
add the querydeff and then u can use it on jabber.. can u guide me on
this ? thanks ! Doe


-----Mensaje original-----
De: jadmin-admin at jabber.org [mailto:jadmin-admin at jabber.org]En nombre de
Bernino Lind Enviado el: miércoles, 25 de junio de 2003 9:29
Para: jdev at jabber.org; jadmin at jabber.org
Asunto: [jadmin] Complex DTD=2 SQL


Dear all,

I need a bit of adwise.

I have a working simple dtd="2" sql set/get pair with my own namespace.

I need to make these more sql queries more complex by adding more
variables in my select statements.

I can do this no problem with my update/insert with bindvar tag=... but
with select I hit problems, which I cant resolve...:

My select in xdb_sql.xml / queredef:

     <querydef name="score-get" dtd="2" type="get"
namespace="lind:score">
        <text>SELECT * FROM score WHERE gameid = '$$gameid$$' AND
username = '$$user$$'</text>
        <user>$$user$$</user>
        <bindvar tag="gameid">$$gameid$$</bindvar>
        <top-result>
          <x xmlns='lind:score'/>
        </top-result>
          <tuple-node><item/></tuple-node>
            <bindcol tag="sid" offset="0"/>
            <bindcol tag="username" offset="1"/>
            <bindcol tag="gameid" offset="2"/>
            <bindcol tag="score" offset="3"/>
            <bindcol tag="date" offset="4"/>
        </querydef>
    </queries>


What happens when I fire off my xml is that the type="set" works just
fine, but firing off a gives a warning:

WARNING:  pg_atoi: zero-length string

Which I guess means that gameid is null, even though my iq packet is
good:

<iq type="get">
  <query xmlns='lind:score'>
    <gameid>123</gameid>
  </query>
</iq>

And theres something in it:
jdb=# SELECT * FROM score WHERE gameid = '123' AND username =
'psi at 192.168.0.166';
 sid |     username      | gameid | score  |            date
-----+-------------------+--------+--------+----------------------------
  10 | psi at 192.168.0.166 |    123 | 234234 | 2003-06-17 15:42:41.611469
  12 | psi at 192.168.0.166 |    123 | 234234 | 2003-06-17 16:12:12.182216
  13 | psi at 192.168.0.166 |    123 | 234234 | 2003-06-25 15:31:02.446713
  14 | psi at 192.168.0.166 |    123 | 234234 | 2003-06-25 15:31:11.871944
  15 | psi at 192.168.0.166 |    123 | 234234 | 2003-06-25 16:02:51.309132
(5 rows)

When I change the querydef to have just say username - no problem, it
selects and outputs the way I want it...

Help,
Best Regards Bernino Lind


_______________________________________________
jadmin mailing list
jadmin at jabber.org
http://mailman.jabber.org/listinfo/jadmin



_______________________________________________
jdev mailing list
jdev at jabber.org
http://mailman.jabber.org/listinfo/jdev

_______________________________________________
jadmin mailing list
jadmin at jabber.org
http://mailman.jabber.org/listinfo/jadmin




More information about the JDev mailing list