Click here to Skip to main content
15,895,538 members
Home / Discussions / Database
   

Database

 
GeneralRe: Stupid INSERT question for PL-SQL Pin
Wendelius16-Dec-08 11:27
mentorWendelius16-Dec-08 11:27 
GeneralRe: Stupid INSERT question for PL-SQL Pin
Nostrom016-Dec-08 11:53
Nostrom016-Dec-08 11:53 
GeneralRe: Stupid INSERT question for PL-SQL Pin
Wendelius16-Dec-08 12:05
mentorWendelius16-Dec-08 12:05 
AnswerRe: Stupid INSERT question for PL-SQL Pin
Chris Meech16-Dec-08 10:56
Chris Meech16-Dec-08 10:56 
QuestionSelect After Update Pin
Sunset Towers16-Dec-08 3:54
Sunset Towers16-Dec-08 3:54 
AnswerRe: Select After Update Pin
Sunset Towers16-Dec-08 5:17
Sunset Towers16-Dec-08 5:17 
GeneralRe: Select After Update [modified] Pin
Wendelius16-Dec-08 6:04
mentorWendelius16-Dec-08 6:04 
GeneralRe: Select After Update [modified] Pin
Syed Mehroz Alam16-Dec-08 7:24
Syed Mehroz Alam16-Dec-08 7:24 
Let me add more to supplement Mika's response:
Looks like you are expecting the CTE to behave like a single scalar value, however, your defined CTE actually returns a result set with one row and one column. A correct approach would be to use a variable instead of CTE like this:

Declare @RecordIDToUpdate int
Set @RecordIDToUpdate = 
 (
      SELECT     TOP (1) RecordID
      FROM         [{0}]
      WHERE     (Completed = 'false') AND (CheckedOut = 'false')
 )

 UPDATE [{0}] 
      SET CheckedOut = 'true', CheckedOutBy = '{1}', CheckedOutDateTime = {2}
      WHERE (RecordID = @RecordIDToUpdate)


Hope that helps.

Regards,
Syed Mehroz Alam

My Blog
My Articles

Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination. - Albert Einstein

modified on Wednesday, December 17, 2008 12:06 AM

GeneralRe: Select After Update Pin
Wendelius16-Dec-08 8:14
mentorWendelius16-Dec-08 8:14 
GeneralRe: Select After Update Pin
Syed Mehroz Alam16-Dec-08 18:02
Syed Mehroz Alam16-Dec-08 18:02 
GeneralRe: Select After Update Pin
Wendelius17-Dec-08 6:02
mentorWendelius17-Dec-08 6:02 
QuestionHow can i extract numeric values from varchar Pin
snehasish15-Dec-08 19:57
snehasish15-Dec-08 19:57 
AnswerRe: How can i extract numeric values from varchar Pin
Blue_Boy15-Dec-08 23:11
Blue_Boy15-Dec-08 23:11 
GeneralRe: How can i extract numeric values from varchar Pin
snehasish16-Dec-08 2:26
snehasish16-Dec-08 2:26 
GeneralRe: How can i extract numeric values from varchar Pin
Blue_Boy16-Dec-08 5:18
Blue_Boy16-Dec-08 5:18 
GeneralRe: How can i extract numeric values from varchar Pin
snehasish16-Dec-08 8:31
snehasish16-Dec-08 8:31 
GeneralRe: How can i extract numeric values from varchar Pin
Blue_Boy16-Dec-08 11:12
Blue_Boy16-Dec-08 11:12 
QuestionSplit the Delimiters Pin
cbe_pav15-Dec-08 18:39
cbe_pav15-Dec-08 18:39 
AnswerRe: Split the Delimiters Pin
Ashfield15-Dec-08 21:05
Ashfield15-Dec-08 21:05 
QuestionGet the following query down to one execution Pin
Sunset Towers15-Dec-08 11:03
Sunset Towers15-Dec-08 11:03 
AnswerRe: Get the following query down to one execution Pin
Wendelius15-Dec-08 11:16
mentorWendelius15-Dec-08 11:16 
GeneralRe: Get the following query down to one execution Pin
Sunset Towers15-Dec-08 12:00
Sunset Towers15-Dec-08 12:00 
GeneralRe: Get the following query down to one execution Pin
Wendelius16-Dec-08 5:51
mentorWendelius16-Dec-08 5:51 
QuestionQuestion about "stalled" snapshot in an Oracle database Pin
Nostrom015-Dec-08 9:46
Nostrom015-Dec-08 9:46 
AnswerRe: Question about "stalled" snapshot in an Oracle database Pin
Wendelius15-Dec-08 10:31
mentorWendelius15-Dec-08 10:31 

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.