db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keeney, Thomas" <Keen...@SEC.GOV>
Subject RE: How to select only one column thanks to Criteria
Date Tue, 20 May 2003 17:55:50 GMT
Sam,

You'd want to select the raw Village Records, like this:

Criteria crit = new Criteria()
crit.addSelectColumn(CONTACT.CONTACT_ID);
crit.add(CONTACT.LAST_NAME, "Smith");
List results = ContactPeer.doSelectVillageRecords(crit);

Then to view them, you'd do something like this:

Record[] records = (Record[])results.toArray(new Record[0]);

for (int i = 0; i < records.length; i++) {
  Record rec = records[i];
  System.out.println("Last Name: " + rec.getValue(1).asString());
}

Regards,

Tom


-----Original Message-----
From: Sam Le Berrigaud [mailto:sleberrig@dexem.com]
Sent: Monday, May 19, 2003 3:22 AM
To: Turbine Torque Users List
Subject: How to select only one column thanks to Criteria


Hi,

does anyone know how to select only one column of a table with criteria. 
I want to do something like that:

SELECT CONTACT.CONTACT_ID FROM CONTACT WHERE CONTACT.LAST_NAME = 'Smith'

for example and to get ids in an array...

Thanks for Help,

SaM


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

Mime
View raw message