[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-dev
Subject:    Re: [Serdev] DD/Mysql modules
From:       Jan Janak <jan () iptel ! org>
Date:       2003-07-29 9:33:11
Message-ID: 20030729093311.GG772 () localhost ! localdomain
[Download RAW message or body]


Hello,

there is a fuction called db_raw_query which accepts a complete query as
a string and simply passes the string to the mysql library.

Drawback of the function (and this approach generally) is that it works
with mysql only and will not work with dbtext, for example.

Somebody asked me for unquoted strings already, so if you implemented
it, please send me a patch, we will include it into the main tree if it
is good.

 thanks, Jan.

On 28-07 16:22, Guilherme Dal Pizzol wrote:
> Hello guys,
> 
> I was developing a module that will query mysql, but I found a little
> problem (maybe a limitation) in the mysql module.
> 
> I need to do a query like this, for example:
> 
> select cc from exp where 12345 like concat(cc, '%')
> 
> In this case the key and op arrays are not a problem, the problem is the
> val array. I tried to use a DB_STRING but it always insert a quote (') in
> the string and the query was built as follows:
> 
> select cc from exp where 12345 like 'concat(cc, '%')'
> 
> So, is there any way to do such a query?
> 
> If there is no way to do so, I expanded the mysql module (as well as
> db_val.h) to support a new type of val, that I called DB_RAW. This new
> type is very similar to DB_STRING. The only difference is that it does not
> include the quote (') (in the val2str function).
> 
> Thanks and regards,
> 
> Guilherme.
> 
> 
> 
> _______________________________________________
> Serdev mailing list
> serdev@lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serdev

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic