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!

Comparing Data

Status
Not open for further replies.

PavanKumarU

Programmer
Jan 31, 2003
56
0
0
US
Hi,
I have a tricky(?) problem here......
I have a product, that writes out reports to tables. SO, the table is create dynamically. Columns are decided by me, the datatypes are decided by the product. I have no control on the data types. If the database has a double, the report writer create the table with a double column, based upon the data.
I need to move the data from this to table to a STATIC table which i created. It works fine, as long as there is no column in the source table that cant fit into the destination. For ex...a double in source to an int column in the destination table.
I need to compare these columns first and if there is a discripancy, i want to throw a custom error. Wondering if i could write a stored procedure that would check if the columns created in the sorce table 'can fit' into the columns in the destination table....
Solution One: Change the destination tables columns to hold max data...i.e change every numeric column to something like a float or double...
Cant do this we have more tables that follow and there is huge data.
Any help is much appreciated.
Thanks
Pavan

 
Make an inventory of the destination table datatypes. Scan the product for incoming datatypes. If the product has incompatible datatypes, throw an exception or adjust the destination table.

One thing is sure, you can't have it both ways.

__________________________________________
Try forum1391 for lively discussions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top