Use BasePeer.createQueryString(criteriaA)

-----Original Message-----
From: sbelt [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 1:32 PM
To: Turbine Users List
Subject: [Torque] Still trying to nest a select statement in a query


I am really stuck on this. ANY help would be appreciated.

My plan was to:
1- create criteriaA which select a single colum from my table
    (~SELECT table4.col1 FROM table4 where table4.col3 = 'findme')
2- create String myIn = "IN(" + criteriaA.toString() +")"
3- create criteriaB
4- criteriaB.add(table1.col1, (Object)myIn, Criteria.CUSTOM);

My current problem is that my criteriaA.toString() in step2 includes a bunch
of non SQL information as well. How can I fetch the String representation of
my query?

TIA,

Steve B.


----- Original Message -----
From: "sbelt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 10:44 AM
Subject: [Torque] How to nest a select statement in a query


> I am trying to create the following sql:
>
> SELECT * FROM table3
>     WHERE table3.colum1 IN
>     ( SELECT table4.column1 FROM table4
>         WHERE table4.column3 LIKE '%find-me%')
>
> [forgive any typos in the above example, but I hope it expresses the
gist -
> I am trying to nest my selects so I can get my records in a single call. I
> see the .addIn() methods, but they all use java objects as parameters. Is
> there a version of the .addIn which accepts a criteria object?
>
> If I were to add this functionality myself, would you suggest using the
> torque-generated extension to the BasePeer classes? I considered using the
> util class that allows me to simply pass a select String, but I fear this
> approach runs the risk of limiting me to a single database, true?
>
> Has anyone implemented this? Is it already there and I am just not seeing
> it?
>
> TIA,
>
> Steve B.
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to