MySQL

-----Original Message-----
From: twolf...@rochester.rr.com [mailto:twolf...@rochester.rr.com]
Sent: Friday, July 29, 2011 8:36 AM
To: Witango-Talk@witango.com
Cc: Fogelson, Steve
Subject: Re: Witango-Talk: Update Prices

what database are you using?  different syntax for depending on database.

Ted

---- "Fogelson wrote:
> Good Morning,
>
>
>
> I am trying to use SQL to update a Product table with current prices.
> I thought the following would work to do that. For test purposes, I
> have only one product code (PCCode) in the PriceUpdate table. What
> happened when I ran the code was that all the Prices (P_Price1) were set to 
> NULL.
> I guess this makes sense in that if a matching row in PriceUpdate is
> not found it would set it to NULL.
>
>
>
> UPDATE Products p1
>
> SET p1.P_Price1 = (SELECT p2.PCPrice FROM PriceUpdate p2
>
> WHERE ((p1.P_Part_Number = p2.PCCode) AND (p2.PCCode IS NOT NULL)));
>
>
>
> Is there a way to change this SQL to accomplish what I want to do
>
> 1)      Or am I going to have to read the PriceUpdate table and use a
> loop in Witango to update the Product table
>
> 2)      Or maybe a stored procedure to accomplish this
>
> Thanks in advance
>
>
>
> Steve Fogelson
>
> Internet Commerce Solutions
>
>
>
> ----------------------------------------
>
> To unsubscribe from this list, please send an email to lists...@witango.com 
> with "unsubscribe witango-talk" in the body.



----------------------------------------

To unsubscribe from this list, please send an email to lists...@witango.com 
with "unsubscribe witango-talk" in the body.


----------------------------------------

To unsubscribe from this list, please send an email to lists...@witango.com 
with "unsubscribe witango-talk" in the body.

Reply via email to