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}"

The idea is that using this CONTACT I avoid using two "SET" queries (one for 
'user' and one more for 'domain'. Instead, it would generate just one "SET" 
query.

However, I don't know how to fill the text ___NO_IDEA___ which should 
generate:
  "CONCAT(user, '@', domain) = ?"

Is it possible? Thanks a lot.


-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to