473,382 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

database technique

1
I'm currently working with c++ code that stores strings to a LONG_VARCHAR in a db2 table. The strings contain different data at defined offsets within the string. A "type" value is stored in another column with each string entry. This "type" value is used to decode the string - the "type" value defines what data the string contains and ultimately the offset of the data in the strings. As an example:
A data string for a power supply might look like this:
"3 1.3 3.5 1.355 " - the first 3 indicates the number of outputs and the next values indicates the current reading of these outputs.
A data string for flow sensors might look like this:
"2 0 5.35 7 4.25 " - 2=number of sensors, 0 =location 0, 5.35 location 0 flow reading, 7=location 7, 4.25=location 7 flow reading.

A program displaying the results would get the string (the first string) along with the data type (and then know it's power supply data) then generate the following output:

"Power supply has 3 outputs - output 0=1.3/output1=3.5/output 2=1.355 "

This approach works, but it's prone to errors, inflexible ( can't readily add new data or increase the width of a value and it messes up external programs that parse these strings). I can understand the common LONG_VARCHAR column/string approach has some merit because the data stored contains different types and amounts (sometimes hundreds of values) of data, but is there a better approach to storing variable data/types in a database?
Apr 14 '10 #1
0 1354

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cocoalearner | last post by:
I am serving a website using apache. All the php and mysql code I have written works, except for one thing. When I try to create a database named M#2 using the following call, no database is...
16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
1
by: BillK | last post by:
Hi - I am looking for a solution to a clients requirement. They want to distribute a database of info on CD, which user can search on selected fields and results will be displayed. The data and...
2
by: Rosy Moss | last post by:
I am in the process of cleaning up a database that our company uses to track jobs, time and expense, and customer information. We are running Windows 2000 Server with approximately 20 terminals...
2
by: RC | last post by:
I am updating/improving a working database for a non-profit organization. I am thinking of making a copy of the database at the office, bringing the copy to my house, making the changes and then...
5
by: premmehrotra | last post by:
I am using Microsoft Access 2000 and Oracle 9.2.0.5 on Windows 2000. When I export a table from Access to Oracle using ODBC I get error: ORA 972 identifier too long I think the error is because...
6
by: SR | last post by:
As a starter project for learning Python/PostgreSQL, I am building a Books database that stores information on the books on my bookshelf. Say I have three tables. Table "books" contains rows...
10
by: Paul H | last post by:
I am trying to get the spec for a database. The trouble is the client frequently blurts out industry jargon, speaks insanely quickly and is easily sidetracked. They are currently using around 30...
4
realin
by: realin | last post by:
hiya all, i am going to develop a big bulky search engine for one of my client. I want your suggestions to pour into before i start. The search would be only through database and not pages....
2
by: Bob Alston | last post by:
Recently I have been helping a nonprofit modify a system built in Access, that they acquired from another nonprofit. I am doing this as a volunteer. I would like your perspective on two...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.