473,410 Members | 1,937 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,410 software developers and data experts.

grab data from 1 column into different column

Dear all,

i need some help here. currently i have 1 table with multiple field.
1 of the field name PackSize contain data like ;;5000;ml;; or ;;;;60;Tablet etc.
So, i want to ask expert out there,how to grab the value inside PackSize into my other field such as field Vol,Volunit,VolDnm,VolDnmUnit,Package,PackageUnit.


here some example :


Let say ;;5000;ml;;
then the data should be like this :

Packsize | Vol | Volunit | VolDnm | VolDnmUnit | Package | PackageUnit

;;5000;ml;;| <null> | <null> | 5000 | ml | <null> | <null>


let say ;;;;60;Tablet

Packsize | Vol | Volunit | VolDnm | VolDnmUnit | Package | PackageUnit

;;;;60;Tablet | <null> | <null> | <null> | <null> | 60 | Tablet
Nov 27 '08 #1
6 1966
amitpatel66
2,367 Expert 2GB
Could you please let us know how many different types of units you have in the column data? For Eg: ml, tablets etc..?
Nov 27 '08 #2
for VolUnit there are 3 types (mg,kg,g)
for VolDnm there are 2 types (cubic inch,ml)
and for packagingUnit there are 3 types (tablets,capsule,units)

i'm a beginner for sql server. Hope all of you could help me on these.
Nov 27 '08 #3
and actually in my table contain 40K rows of data
Nov 27 '08 #4
amitpatel66
2,367 Expert 2GB
And in what format the data is stored in the column packsize?
I see for ml its 2 semi colons followed by a number and then a semicolon and a unit and for tablet I see 4 semicolons followed by a number and so on?...Can you post few more sample data for reference?
Nov 27 '08 #5
PackSize field format is varchar (50)

here are my other sample data :

1 ) ;;5000;ml;;
2 ) 65;gm;;;;
3 ) ;;;;120;Capsule
4 ) ;;;;24;Tablet

each semicolons will separate the data into 6 different column. if there is no value between semicolon like this (;;20)....then the data stored into the 1st field and 2nd field will be null but in 3rd field will be 20
Nov 27 '08 #6
ck9663
2,878 Expert 2GB
Read this and modify the code the suit your requirement.

-- CK
Nov 27 '08 #7

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

Similar topics

24
by: Ehud Shabtai | last post by:
Hi, I would like to store samples of data which are gathered from about 500 devices in mysql. Each device has its own data which changes over time. The data may be integer or float. The...
8
by: Ilan | last post by:
Hi all I need to add data from two Excel sheets (both on the same workbook) to an existing table in my SQL DB. The problem is that each sheet holds different fields for the same record, though...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
6
by: Mike Kirkpatrick | last post by:
I have this data grid which consists of 3 pick lists. The first pick list is to affect the data binding of the other two. I have figured out how to do the data binding by column. However, I do not...
5
by: Brian P. Hammer | last post by:
I have data from multiple SQL tables, some of the tables will only have one row, while others multiple rows. I load a bunch of data from the various tables and add them to a third party grid. With...
9
by: Suresh | last post by:
Hi All I have one column which has data type of varchar only. in this column i want to store some secured data (I want to store this data by encrpting using db2 encryption function).But along...
0
by: Christoph Haas | last post by:
Hi, list... I have written an application in Perl some time ago (I was young and needed the money) that parses multiple large text files containing nested data structures and allows the user to...
3
by: dragonfly8563 | last post by:
Hi all, I created a listbox with employees' names and email addresses in it, and a button which grabs email address once it's clicked. Currently I can only pick up one address at a time, but I...
19
by: JRough | last post by:
I have used this function to create a string called $headers: function GetHeaders($file_name){ return "<th><a href='".$file_name."&order_by=l_e'>L_E</a></th> <th><a href='"....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.