db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Allen <...@mojavelinux.com>
Subject Re: modified column
Date Fri, 14 Mar 2003 18:57:58 GMT
> I'm pretty sure you'll have to use a CUSTOM Criteria, unless you'd like 
> to add this feature to Torque, which is always welcome! The other option 
> I've seen is to create the SQL statement and execute it as a prepared 
> statement; this is sometimes easier with complex queries.
> 
> It would *really* help if you could give a simple example that would 
> actually require this.

Okay, I did it using the CUSTOM Criteria.  I will post some code in
a bit, but right now I have to stay on task.  Basically, all I
wanted to know is if you could treat the column as a modified column
instead of just raw.  It is a pretty basic concept.  For instance,
you might want to know if the value of two columns concated together
equalled some string.  All I want to do is basically

crit.add("CONCAT('" + SomePeer.SOME_COLUMN + "', '" + SomePeer.OTHER_COLUMN + "')", "a string");

In short, I want to wrap the column in a function or anything really
that modifies its value before doing the comparison.  I was able to
work out my min, max thing using some creative math, but I am sure
that something more difficult will come along.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <dan@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"I am the GOD.....the GOD...of house!" 
 -- Leeloo
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Mime
View raw message