|
-
Apr 7th, 2006, 06:25 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] A small translation (cant put a more precise title,ill explain)
Hello everyone...
I have a problem here..ill explain...
I have a column in my database which contains data about mainframe's datatypes.. like this...
pix x
pix xx
pix x(5)
pic 9
pic 9(4)
Thats how the data exists in the column.
Now I need to retrieve that data and convert them and store them into 2 columns in another database like this....This is the translated form of the example shown above...
DATA TYPE COLUMN . DATA LENGTH COLUMN
Alpha numeric . 1
Alpha numeric . 2
Alpha numeric . 5
Numeric . 1
Numeric . 1
Im trying to make my program to do this...Can you all give me your ideas?
My idea is to check with many if statements? well,sounds long code...anything else I can do?
Any ideas? help..Thanks
Thanks
Godwin
Help someone else with what someone helped you! 
-
Apr 7th, 2006, 09:43 AM
#2
Frenzied Member
Re: [2005] A small translation (cant put a more precise title,ill explain)
To me it looks like you really only need to check the digits after the space.
Loop through each row of the column, place it into a string
Split the string on the space.
If the first item in the string array is pix the data type is Alph/Num
if second string contains ( the legngth is what is between ()
else the length is the length of the second string.
Else if the first item is pic data type is Num and length is 1
I think this would work. There may be a better way to do it, but I don't know it. This also assumes your example is an accurate representation of the actual data. So that is not many if statements at all.
-
Apr 13th, 2006, 02:54 AM
#3
Thread Starter
Fanatic Member
Re: [2005] A small translation (cant put a more precise title,ill explain)
Thanks Bud
Godwin
Help someone else with what someone helped you! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|