• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to combine two arraylists into one arraylist and pass it to procedure  RSS feed

 
Omar Ali
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need your help and assistant in combining two arraylists into a new arraylist to be passed to a procedure. Once the user selected certificates from Type A list, they will be stored in:



And once the user selected certificates from Type B, they will be stored in:



Now in the procedure I need to pass only two String variables. One is the Staff Code and the other is the selectedTypes for both Types A & B.




Thanks for the help
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the addAll method.

But you'll have to do more than just use that method to add all elements in your list(s) to another list. What format does the called stored procedure expect for the second parameter? Is that supposed to have items separated by spaces or commas or whatever? What does the stored procedure do with that value, parse it back out into separate items? If so, that's a little convoluted. First, you'd have to write more code to generate a string in the expected format based on the contents of your combined list. Then in the stored procedure, you'd have to write more code to extract each list item out of the string.

Search for passing list of values to stored procedures and you may find better solutions.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!