RTOD: Sometimes you just need to not look so hard to see the problem…

No matter how much you stare at it,  glare, walk away in disgust…the following line will not alter your database

var strSQL = “Delete from SecondarySites where employee = ‘” + empID + “‘”);

without this bit: 

var result = dbConn.executeUpdate(strSQL);

this won’t work either:

var result = executeUpdate(strSQL);                   //oddly the program will want to know which database connection you’d like to send the command to


var result = dbConn.executeCachedQuery(strSQL)  //Queries pull data from the database, not the other way around

Those last two will at least throw errors.

Yeah, yeah…its been a long day 🙂

For non-programmers… The first line loads a command that tells my database to delete everything in the table SecondarySites that belongs to the employee contained inempID into the variable strSQL

That’s all it does.

The second line actually sends the command to the database.

Sort of like putting a letter in an envelope and forgetting to drop the envelope in the mail box.   It will do nothing but look pretty!

Yes, its a programming fail.

But look at it this way.   I am so freaking awesome that I can post my fails on my blog 😀


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s