Is there a way to save a variable-length list in a database in SQL or any other database engine?
Here the list means no. elements in the array. E.g. array of numbers.
But in my actual application, the things to be saved are objects and therefore cannot be saved simply as a comma-separated list.
Some SQL databases support the ARRAY type as a column type. ARRAY is a variable length and may contain objects of the same type. See Details below that apply to databases that support the SQL standard:
http://hsqldb.org/doc/2.0/guide/sqlgeneral-chapt.html#N106FE
. .
:
Id (PK), ListItem varchar (255), ListId (int) - ListId , , , .
() -ListId (pk) -ListTitle varchar (255)
() -ItemId (pk) -ListId (fk → List.ListId) -ItemName varchar (255) -Order (int) -
1 ?
, , () ?
You can use the length function to calculate the length of a variable, and when you insert this variable, Insert the length with it ... This is it.
DOWNLOAD ENCODING ...
Source: https://habr.com/ru/post/1781601/More articles:Отображение списка пользователей приложения facebook - facebookCan I publicly publish the full name and profile of a user signed in through the Facebook API? - facebookRedirect faster with Greasemonkey (or a similar usercript mechanism)? - javascriptСтатические страницы в проблеме Yii - yiiUsing a macro in Objective-C to register a function name and line number - c ++Sql server error - exceeding lock timeout - sqlHow to split a sentence into two separate arrays - javaJQuery: function call dynamically - javascriptOSX application shortcut folder in the dock and updating icons after installation - iconsHow to distinguish between Task Scheduler 1.0 and Task Scheduler 2.0? - c #All Articles