0

I know there are a lot examples out there. But I couldn't really find a complete one. Here's my question: how to code this when there is a dynamic array parameter to be sent into a stored procedure?

For example:

CASE A: String fruits = "Orange,Apple,Banana,Papaya";
CASE B: String fruits = "Mango,Orange,Apple,Pineapple,Watermelon,Grapes";
munsifali
  • 1,732
  • 2
  • 24
  • 43
lannyboy
  • 843
  • 1
  • 12
  • 22

1 Answers1

0

Your database should have two tables. One called 'fruits' and the other called 'fruitItems'.

You have to add fruits to the first table, like fruits1. Then, you add all the items in the other table, with a reference to the id of fruit1.

So, this could be the first table (fruits):

ID NAME

And this could be the second table (fruitItems):

ID NAME FRUITID

Now, you can add as much fruits as you want. If you need the fruitItems from the database, you have to select all fruitItems from the second table where the FRUITID is X

Marten
  • 1,376
  • 5
  • 28
  • 49