[JDEV] Changing database structure in xdb_sql

raditha dissanayake jabber at raditha.com
Sat Sep 21 16:41:56 CDT 2002


certainly does not look as if there is an error in your xml
what you can do is to add something like this

<code>
    log_error(ZONE,"the query is: %s",query);
</code>

to your sqldb_query() function in xdb_sql_backend.c that will tell you 
what is the exact query that is being passed to the databse.

As for your second question you will be better off using a database that 
supports stored procedures rather than trying to use two separate queries.


Justin Georgeson wrote:

> You created your database with jid instead of username, right? Did you 
> create it manually or edit one of the sample configs and create off that?
>
> Bruce Heller wrote:
>
>> Hello. I wanted to use a slighty different database architecture with
>> xdb_sql, I modified the xdb_sql.xml according to the new layout of the
>> tables. But it doesn't work as it should.
>> For example the password changing was :
>> <!-- Authentication set query -->
>>       <querydef name="auth-set">
>>         <text>UPDATE users SET password = '$$p$$' WHERE username =
>> '$$username$$'</text>
>>         <bindvar name="user">$$username$$</bindvar>
>>         <bindvar name="password">$$p$$</bindvar>
>>       </querydef>
>>
>> And is now :
>> <!-- Authentication set query -->
>>       <querydef name="auth-set">
>>         <text>UPDATE users SET password = '$$p$$' WHERE jid =
>> '$$username$$'</text>
>>         <bindvar name="user">$$username$$</bindvar>
>>         <bindvar name="password">$$p$$</bindvar>
>>       </querydef>
>>
>> The only change here is that the username is now called "jid" in the
>> database... But it won't change the password right, it onyl returns 
>> "NULL"
>> into the database...
>>
>> Also, I would like to know if it's possible to excecute 2 SQL query 
>> for a
>> single querydef ?
>>
>> Thanks in advance !
>>
>> --------------------------------
>> Bruce Heller
>> Ligne Directe: 01.47.66.55.64
>> Fax: 01.47.66.55.54
>> Standard: 01.47.66.55.50
>> --------------------------------
>> TERRA VIRTUAL
>> 73, rue de Saussure
>> 75017 PARIS
>> -------------------------------
>>
>> _______________________________________________
>> jdev mailing list
>> jdev at jabber.org
>> http://mailman.jabber.org/listinfo/jdev
>
>





More information about the JDev mailing list