Contents
How do you store multiple values in one field?
How to store multiple values in single field in SQL database?
- Add the table description and sample records to descript what you have and what you want..
- You can also define a text field and you will insert an array witch contains all your phones numbers.
How do you store a list of values in a database?
No, there is no “better” way to store a sequence of items in a single column. Relational databases are designed specifically to store one value per row/column combination. In order to store more than one value, you must serialize your list into a single value for storage, then deserialize it upon retrieval.
How to store multiple values in SQL database?
And then using joins simply you can do it. You can store multiple data as delimiter separated values. Use pipe (|) or tilt (~) as the delimiter. And when we are inserting new value or updating existing value, check if the phone number already exists.
Is there a way to store multiple data types in a single?
This gives you a map with keys of type String and values of type Object, which basically means any descendant of type Object (Date, Integer, String etc.). Other answers correctly point to the fact that instead of using primitives such as int, boolean it is required to use their counterparts Integer, Boolean etc.
How to store multiple data as a delimiter?
You can store multiple data as delimiter separated values. Use pipe (|) or tilt (~) as the delimiter. And when we are inserting new value or updating existing value, check if the phone number already exists. If there is already some data present in the phone number column, just append it with delimiter + new phone number.
Is there a way to store generic objects in Java?
The HashTable can be set to store generic Objects as opposed to specific class types, however the type conversion when retrieving them does not happen automatically. In order to get the object back out of the collection, some form of type checking routines will have to be developed.