Advertisement

05.05.2008 at 05:12PM PDT, ID: 23378171
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Update Statement - Field Case When... error in syntax

Asked by mkrumpe in MySQL Server, Databases Miscellaneous, SQL Query Syntax

Tags:

In the attached code snippet, is an example of a Stored Procedure that I am creating in MySQL. In the procedure, I am doing an update to a table, on which it is left joined to itself so that I can do a comparision to what the value was, to what we are updating it to, then for each field has a case statement that if it is different it fires off a function. The function's parameters are parameters that are needed to log any update to the field, and the return of the function is the new value back to it to update the field appropriately.

All that aside... its really a basic Update statement with a case... but I am getting the error

Script line: 4      You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'END' at line 436

There are over 50 fields in the update statement, but I have only included 2 in the example below... its all of the same thing for each field. These are the last two fields in the statement, which the last one is the line number that the syntax is yelling at.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
UPDATE primShipment ps1 Left Join primShipment ps2 on ps1.primShipmentID = ps2.primShipmentID
  SET
      ps1.Waiting_Time_Info_Input = Case When fWaiting_Time_Info_Input <> ps2.Waiting_Time_Info_Input Then
                        fn_UpdateFieldLog(fShipping_Status, strIP, intUID, fprimShipmentID, 'Waiting_Time_Info_Input', ps2.Waiting_Time_Info_Input, fWaiting_Time_Info_Input)
                      Else ps2.Waiting_Time_Info_Input End,
 
      ps1.Waiting_Time_Charge_Input = Case When fWaiting_Time_Charge_Input <> ps2.Waiting_Time_Charge_Input Then
                        Cast(fn_UpdateFieldLog(fShipping_Status, strIP, intUID, fprimShipmentID, 'Waiting_Time_Charge_Input', ps2.Waiting_Time_Charge_Input, fWaiting_Time_Charge_Input) As decimal)
                      Else ps2.Waiting_Time_Charge_Input End
 
  WHERE ps1.primShipmentID = fprimShipmentID
[+][-]05.05.2008 at 05:17PM PDT, ID: 21503967

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 05:20PM PDT, ID: 21503972

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 05:22PM PDT, ID: 21503977

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 05:24PM PDT, ID: 21503983

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 05:38PM PDT, ID: 21504027

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 05:46PM PDT, ID: 21504056

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 05:57PM PDT, ID: 21504099

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:00PM PDT, ID: 21504108

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:06PM PDT, ID: 21504128

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:09PM PDT, ID: 21504143

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:11PM PDT, ID: 21504151

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:14PM PDT, ID: 21504159

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:14PM PDT, ID: 21504160

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:16PM PDT, ID: 21504166

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:17PM PDT, ID: 21504167

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:18PM PDT, ID: 21504168

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:18PM PDT, ID: 21504171

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:20PM PDT, ID: 21504175

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:31PM PDT, ID: 21504210

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:37PM PDT, ID: 21504230

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:47PM PDT, ID: 21504262

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:49PM PDT, ID: 21504268

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MySQL Server, Databases Miscellaneous, SQL Query Syntax
Tags: MySQL
Sign Up Now!
Solution Provided By: RQuadling
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.05.2008 at 06:53PM PDT, ID: 21504274

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 07:04PM PDT, ID: 21504307

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080924-EE-VQP-38 / EE_QW_2_20070628