Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto-checking data types and sizes in a DW to the DB.

Status
Not open for further replies.

chris284

Programmer
Oct 9, 2007
2
US
Does anyone know if there is a program out there which will run through a given directory, go through each pibble, and pull all the data types/sizes from a datawindow, and compare the types/sizes to the corresponding table in the database? I'm wondering if there is some third party software out there, or if I will have to write this myself?
 
I don't know of anything off the top of my head, but writing this shouldn't be too hard.

You should be able to write something of your own fairly simply. To loop through the dw's columns, use something like:

FOR ll_cnt = 1 TO Long( dw_example.Object.DataWindow.Column.Count )

Then, to get the column type, use something like:

ls_type = dw_example.Describe( '#' + String( ll_cnt ) + '.ColType' )

That should give you the types for the DataWindow. Now, the database structure may be a little different. You might look into the CreateFromSQL( ) function for DataWindows, and then use the same type of function as above.
 
Remember that PB datatypes don't always correspond to the DB datatypes.

Matt

"Nature forges everything on the anvil of time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top