Click here to Skip to main content
15,897,187 members
Home / Discussions / Database
   

Database

 
GeneralRe: read & update using reader Pin
ShilpaKumari13-Dec-10 7:33
ShilpaKumari13-Dec-10 7:33 
AnswerRe: read & update using reader Pin
Not Active12-Dec-10 3:48
mentorNot Active12-Dec-10 3:48 
AnswerRe: read & update using reader Pin
PIEBALDconsult12-Dec-10 4:52
mvePIEBALDconsult12-Dec-10 4:52 
GeneralRe: read & update using reader Pin
Mycroft Holmes12-Dec-10 13:16
professionalMycroft Holmes12-Dec-10 13:16 
GeneralRe: read & update using reader Pin
PIEBALDconsult12-Dec-10 16:05
mvePIEBALDconsult12-Dec-10 16:05 
GeneralRe: read & update using reader Pin
Miroslav Bučko14-Dec-10 5:39
Miroslav Bučko14-Dec-10 5:39 
GeneralRe: read & update using reader Pin
Mycroft Holmes14-Dec-10 11:17
professionalMycroft Holmes14-Dec-10 11:17 
GeneralRe: read & update using reader Pin
Jassim Rahma13-Dec-10 2:41
Jassim Rahma13-Dec-10 2:41 
When I implement a system like that, sending email or whatever, I put a Status field in the table to indicate ( 0=New , 1=Sending , 2=Sent ). When I select the New rows, I also set the Status to Sending, then when I'm done I set the Sending rows to Sent.

"UPDATE Email SET Status=1 WHERE Status=0 ; SELECT * FROM Email WHERE Status=1"

Send the emails.

"UPDATE Email SET Status=2 WHERE Status=1"


yup but my question, is I am reading the pending SMSs using sql_reader1 then how can I execute the update status code? can I do it using the same sql_reader? it won't allow braces the sql reader is still open! should I have sql_reader1 for reading the pending sms and within the while (sql_reader1.Read()) I will have sql_reader2?

please advise..
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 2:56
mvePIEBALDconsult13-Dec-10 2:56 
GeneralRe: read & update using reader Pin
Mycroft Holmes13-Dec-10 10:33
professionalMycroft Holmes13-Dec-10 10:33 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 14:20
mvePIEBALDconsult13-Dec-10 14:20 
GeneralRe: read & update using reader Pin
Mycroft Holmes13-Dec-10 14:29
professionalMycroft Holmes13-Dec-10 14:29 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 14:57
mvePIEBALDconsult13-Dec-10 14:57 
GeneralRe: read & update using reader Pin
Mycroft Holmes13-Dec-10 15:14
professionalMycroft Holmes13-Dec-10 15:14 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 15:18
mvePIEBALDconsult13-Dec-10 15:18 
GeneralRe: read & update using reader Pin
Fabio Franco14-Dec-10 1:27
professionalFabio Franco14-Dec-10 1:27 
GeneralRe: read & update using reader Pin
Pete O'Hanlon13-Dec-10 11:15
mvePete O'Hanlon13-Dec-10 11:15 
GeneralRe: read & update using reader Pin
PIEBALDconsult13-Dec-10 13:53
mvePIEBALDconsult13-Dec-10 13:53 
GeneralRe: read & update using reader Pin
Gary Huck13-Dec-10 23:56
Gary Huck13-Dec-10 23:56 
GeneralRe: read & update using reader Pin
James Lonero15-Dec-10 14:00
James Lonero15-Dec-10 14:00 
AnswerRe: read & update using reader Pin
Brady Kelly13-Dec-10 23:24
Brady Kelly13-Dec-10 23:24 
AnswerRe: read & update using reader Pin
Gary Huck13-Dec-10 23:51
Gary Huck13-Dec-10 23:51 
GeneralRe: read & update using reader Pin
PIEBALDconsult15-Dec-10 2:20
mvePIEBALDconsult15-Dec-10 2:20 
AnswerRe: read & update using reader Pin
Spectre_00114-Dec-10 1:48
Spectre_00114-Dec-10 1:48 
GeneralRe: read & update using reader Pin
PIEBALDconsult15-Dec-10 2:22
mvePIEBALDconsult15-Dec-10 2:22 

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.