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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing SQLs

Status
Not open for further replies.

nair666

Programmer
Joined
May 24, 2007
Messages
3
Location
US
Hi Group,

I have a bunch of SQL files and would like to check the insert statements if they're inserting the correct value in the correct column.

insert into table (col1, col2, ... target_col .. coln) values (col1, col2, ... target_col .. coln)
 
basically, i have these sql files in the file system, and i would like to recurse through them and check the insert statement if the correct value (let's say, deptA) is being inserted in the column (department).
 
Define 'correct'. Correct as in string, integer, decimal, etc., or correct as in 'know intuitively that deptA is the right value'?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::PerlDesignPatterns)[/small]
 
to explain further, i have a table with a column (created_by) which should be populated with the CURRENT USER, but there are some rows where the column's data is that of the CURRENT PUBLISHER instead of the CURRENT USER so i'm creating a script that'll traverse through the sql files that affected the table so i could find what's causing this one..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top