We are currently doing migration from vision file to maridb.
we are facing some issue is how to create the table contain array field.
For example, we have many SKU, each SKU is having 10 color.
So we want to create the table where having the SKU ID, SKU NAME and color.
where the color is in array that can store 10 color,
so you want to migrate from .txt file?
do you use HeidiSQL or something like that?
which framework do you use?
or you want to save it manually?
tell me more about your position.
We will using the mariadb & SQL to store the data.
We will using the text file to dump the data from vision file to database.
Now we are having a table where we will need to contain some array in the table.
For example, we have many SKU, each SKU is having 10 color.
So we want to create the table where having the SKU ID, SKU NAME and color.
where the color is in array that can store 10 color,
We are using COBOL + SQL to access the database.
Appreciate you can give the sample on how to use the json in SQL. so we can have a try.
Because i had try to create using standard SQL way where create the SKU_COLOR_1, SKU_COLOR_2. But we still need to look into the array method, due to we have many data is in array in the same table.
This is the data structure we have currently.
01 MC-REC.
03 MC-KEY.
05 MC-CT-KEY PIC X(15).
05 MC-CARD-SEQ PIC X(15).
05 MC-SPECIFICATIONS OCCURS 10 TIMES.
07 MC-DESIGN PIC X(10).
07 MC-EXT-MEASUREMENTS.
09 MC-EXT-LENGTH PIC 9(06).
09 MC-EXT-WIDTH PIC 9(06).
09 MC-EXT-HEIGHT PIC 9(06).
07 MC-COLOR OCCURS 08.
09 MC-INK-KEY PIC X(10).
09 MC-INK-PERCENT PIC 9(03)V99.
09 MC-INK-PADDING PIC X(07).
We are using the above data structure and create the table called ‘MC’ and create each field above as a columns. For example MC-SPECIFICATIONS OCCURS 10 TIMES. we will have all the item below this repeat 10 columns.
So total column create based on above data structure will be 300 columns.
Due to we have more than 1 array part of the MC-SPECIFICATIONS array, so when we create the table, we hit the max columns. That why we want to know isn’t the way we use is wrong.