Jump to content

Inserting an array into a DB


Recommended Posts

howdy -

I am using LV7.1 DB tools and I am trying to build a DB of different types of data.

Example data format

post-4247-1147733659.jpg?width=400

I have no idea how to insert the arrays into their respective field in the table. Would I decompose each 1D array into one long binary value and insert that into the field?

Thanks

David

Link to comment
What you probably want to do is create a seperate table for the large array sets. This way you can perform searches and potential analysis on the data. Each element in the array will be a record consisting of the value and a key which will reference your single TblData entry.

Agreed. However, it really depends on what you intend to do with the array. If you think you ever will want to search for or analyze individual elements in the array, Michael's suggestion is the best one. An alternative is to convert it to a "spreadsheet string" or some other format that can be parsed back into an array, and store that string in the field. This, however, makes it impossible to search or analyze the data in the array using SQL. I generally use both techniques in one project depending what I need to do with the data in the array.

Link to comment
I'm not sure you're using PK in the right context. PK stands for Primary Key. I don't see how you can have data in there.

My 'misteak'....I guess it would be a ?foreign key?. I ran into a problem with the method mentioned above last night while trying to create the tables with the DB toolkit. Unfortunately MS Access does not allow tables with more than 255 fields and one of my tables would have 1024 fields. I am looking at different DB's but everyone here has Access...ugh! Can LV DB toolkit tie into other DB's like PostGRE or MySQL? It would be great to be able to search on individual elements of that 1024 table!

THanks

David

Link to comment
My 'misteak'....I guess it would be a ?foreign key?. I ran into a problem with the method mentioned above last night while trying to create the tables with the DB toolkit. Unfortunately MS Access does not allow tables with more than 255 fields and one of my tables would have 1024 fields. I am looking at different DB's but everyone here has Access...ugh! Can LV DB toolkit tie into other DB's like PostGRE or MySQL? It would be great to be able to search on individual elements of that 1024 table!

THanks

David

Well, ya. You don't want to create fields. You want to create records (rows instead of columns). You probably only need 4 fields. Primary Key (autoincrement), Testrecord key (Tbldata entry key), Timestamp (if available) and datapoint value.
Link to comment
Well, ya. You don't want to create fields. You want to create records (rows instead of columns). You probably only need 4 fields. Primary Key (autoincrement), Testrecord key (Tbldata entry key), Timestamp (if available) and datapoint value.

THanks Michael...my bad....i don't have a very good understanding of DB's

Again Thank You,

David

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.