stored function, multiple queries, best practices
От | Ash Grove |
---|---|
Тема | stored function, multiple queries, best practices |
Дата | |
Msg-id | 20060414124834.63095.qmail@web52501.mail.yahoo.com обсуждение исходный текст |
Ответы |
Re: stored function, multiple queries, best practices
|
Список | pgsql-jdbc |
Hello, I'd like to learn how other people approach this kind of situation: Say you want to do an insert on three tables and all of your data is coming into the db from your application. You do the first insert and a primary key is generated. You grab that primary key and insert it (along with some other data) into the two other tables. Finally, you return the primary key to the application. If something goes wrong, you want to everything to rollback. I currently do this by building a delimited string in the application containing all data to be inserted and then sending it, via callablestatement, to a stored function. The function parses the string, does the inserts and returns the primary key via a registered out parameter. Are there glaring errors with this approach? How would you do this? Thanks in advance, Ash __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
В списке pgsql-jdbc по дате отправления: