• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stored procedures and arrays/lists

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This isn't strictly speaking a Java issue, but I'm writing an application
using stored procedures to access a SQL Server database, and I have a
situation where I need to add multiple rows to a table (it's coming from a
multi-select list box). I'm wondering is there any other way of doing it other
that repeatedly calling the same stored proc to add them one at a time. Since
the values from the multi-select are part of a record, I'd like to be able to
insert/update the record in one go, rather than having to break it up into
multiple steps and then having to write a back-out procedure should any of
the steps fail.

Thanks for you help,

Kev
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kev,
You could write a stored proc that takes a list. Or you could make the calls to all the stored procs part of a single transaction so it commits/rollsback together.
 
Kev D'Arcy
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne

How do I write a stored proc that takes a list?

Kev
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kev D'Arcy:
Hi Jeanne

How do I write a stored proc that takes a list?

Kev


Looking for it on the internet, it seems I was using a database specific feature. (This was a number of years ago.) Your best bet would be searching for "array stored procedure __your_db_name__"
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic