How can I get the Primary Key from SQLContainer

Hi,

is there any chance to get the primary key of a Item from the SQLContainer, when I only have the value of the non primary Key Column?

like i have a Table which have only 2 Columns

ID, TEXT

and i only have the Text in sql it would be like

select id from table where text= ‘text’

Thank you in advance

The only ways would be to iterate over the container/table or to recreate the Container.
Iteration: for(Iterator i = container.getItemIds().iterator();i.hasnext();){ Item item = container.getItem(i.next); if(item.getItemProperty("TEXT").getValue.equals("text")) //Do something } Maybe you also could manually create a connection + statment and execute a query giving you the wanted resultset. Iterating over a resultset is quicker then iterating over a container or table.