Forums Register Login

Extracting One record

+Pie Number of slices to send: Send
Hi all,

I need to insert a new record and need to have the next primary key in the table.

So I use
SELECT Max(prikey) FROM table

* @ejb.findersignature="java.lang.String findAccId()"
* query = "SELECT MAX(acc.accId)
FROM Account acc"

How can I return a string?

Please advise. Thanks

[Novice.. starting learning EJB]
+Pie Number of slices to send: Send
I'm not sure how you would cast a number to a string through an EJB QL. However, you could always implement the same thing as a home method, and use an ejbSelect that does the same thing that returns the number. Afterwards, just have your home method cast it to a string. Just my 2 cents.
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 427 times.
Similar Threads
Use sequence or select max(field) from table to get next id?
Lates Timestamp record from 3 tables.
Insert with a select on the same table.
Table mutating error in Oracle
how to pick the max field in cmp
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:04:24.