Click here to Skip to main content
15,898,981 members
Home / Discussions / Database
   

Database

 
GeneralOn error resume next Pin
vanikanc2-Aug-12 4:44
vanikanc2-Aug-12 4:44 
GeneralRe: On error resume next Pin
Eddy Vluggen2-Aug-12 9:46
professionalEddy Vluggen2-Aug-12 9:46 
GeneralRe: On error resume next Pin
vanikanc2-Aug-12 9:50
vanikanc2-Aug-12 9:50 
GeneralRe: On error resume next Pin
Eddy Vluggen2-Aug-12 10:02
professionalEddy Vluggen2-Aug-12 10:02 
GeneralRe: On error resume next Pin
vanikanc2-Aug-12 10:14
vanikanc2-Aug-12 10:14 
QuestionRe: On error resume next Pin
Eddy Vluggen2-Aug-12 12:33
professionalEddy Vluggen2-Aug-12 12:33 
AnswerRe: On error resume next Pin
vanikanc3-Aug-12 3:05
vanikanc3-Aug-12 3:05 
GeneralRe: On error resume next Pin
Eddy Vluggen3-Aug-12 4:02
professionalEddy Vluggen3-Aug-12 4:02 
vanikanc wrote:
Thank you for all your suggestions!

My pleasure, hope I wasn't too rude.

vanikanc wrote:
It is just some inherited code,

Ah, that's always a good one to include on the first post. If we see code, we assume you wrote it, and partially understand it.

vanikanc wrote:
There was an error entering the value, it was supposed to be 50 and the user keyed in 500000. So, the business wants us to put aside such errors and continue processing the data.

On Error Resume Next indeed. That's not how engineers work; if it fails, it fails for a reason. It get's corrected or excluded beforehand, not ignored. It's how managers work; if it fails, and nothing is burning, it's not a problem. Just ship the damn product already, we'll fix the bugs later.

Perhaps this would be a good time to add a validator to the entry-field of that user, and sanitize his/her input before it gets into the system. Once the value has been entered, it should be treated as "correct".

You heard about Knight Capital? Seems they had an "On Error Resume Next" idea to, and the algo kept buying stocks in packages of 100 at a time, 20 to 25 times a second - for over an half hour! (Total >440 million* losses - let's just be glad they weren't a hospital and relying on that software)

Ignoring errors is the worst offence in IT; the system could have skipped customer 59 for all we know. The best approach is preached by (forgive me) PHP, and it's called "do or die". Either the app does what it should do, or there's an unexpected exception - and since we cannot guarantee that the we're still working with valid data (unexpected situation, who knows what variables are loaded and not?) we have only one realistic option; let the app die. Terminate.

That's always better than continuing and writing records with an outdated identity-value after an exception, and not nowing that you're corrupting a database that was still correct when the app died.

*) I checked this time whether I should use million or billion.
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

QuestionSQL Query - write all in one query Pin
Raman samineni1-Aug-12 6:30
Raman samineni1-Aug-12 6:30 
AnswerRe: SQL Query - write all in one query Pin
PIEBALDconsult1-Aug-12 8:42
mvePIEBALDconsult1-Aug-12 8:42 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni1-Aug-12 16:02
Raman samineni1-Aug-12 16:02 
GeneralRe: SQL Query - write all in one query Pin
PIEBALDconsult1-Aug-12 18:23
mvePIEBALDconsult1-Aug-12 18:23 
AnswerRe: SQL Query - write all in one query Pin
Mycroft Holmes1-Aug-12 13:17
professionalMycroft Holmes1-Aug-12 13:17 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni1-Aug-12 15:56
Raman samineni1-Aug-12 15:56 
GeneralRe: SQL Query - write all in one query Pin
Mycroft Holmes1-Aug-12 16:25
professionalMycroft Holmes1-Aug-12 16:25 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni2-Aug-12 8:22
Raman samineni2-Aug-12 8:22 
AnswerRe: SQL Query - write all in one query Pin
Eddy Vluggen1-Aug-12 22:34
professionalEddy Vluggen1-Aug-12 22:34 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni2-Aug-12 8:19
Raman samineni2-Aug-12 8:19 
GeneralRe: SQL Query - write all in one query Pin
Eddy Vluggen2-Aug-12 8:59
professionalEddy Vluggen2-Aug-12 8:59 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni6-Aug-12 8:37
Raman samineni6-Aug-12 8:37 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni6-Aug-12 8:39
Raman samineni6-Aug-12 8:39 
QuestionRe: SQL Query - write all in one query Pin
Eddy Vluggen6-Aug-12 8:50
professionalEddy Vluggen6-Aug-12 8:50 
AnswerRe: SQL Query - write all in one query Pin
Raman samineni6-Aug-12 11:11
Raman samineni6-Aug-12 11:11 
RantRe: SQL Query - write all in one query Pin
Eddy Vluggen6-Aug-12 11:30
professionalEddy Vluggen6-Aug-12 11:30 
GeneralRe: SQL Query - write all in one query Pin
Raman samineni8-Aug-12 5:30
Raman samineni8-Aug-12 5:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.