El Viernes, 4 de Septiembre de 2009, Iñaki Baz Castillo escribió:
> Hi, I'm trying (with no succes) to create a SQL stament containing a
> CONCAT. The final "PREPARE" queyr I want to generate is this:
>
> PREPARE get_doc_2 FROM
> "SELECT `doc` FROM `storage` WHERE (CONCAT(user, '@', domain) = ?) LIMIT
> 1"
>
> And later use it as usual:
>
> SET @arg = '#{us...@#{domain}'
> EXECUTE get_doc USING @arg
>
>
> I'm trying to figure how to do the PREPARE query using Squel syntax, this
> is, something as:
>
> ds = DB[:storage].filter(___NO_IDEA___).limit(1).select(:doc)
> ps = ds.prepare(:select, :get_doc)
> ps.call(:n => "#{us...@#{domain}"
Done:
ds = DB[:storage].filter([:user, :domain].sql_string_join("@") => :
$n1).limit(1).select(:doc)
:)
--
Iñaki Baz Castillo <[email protected]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---