Re: Simple: ? sql add value to column

2009-10-01 Thread Dave Watts

> these are not thing mortals should question. the data which is the word, is
> infallible and has come down from on high.
> it proceeds us by generations and we shall not question it validity,
> integrity or reliability.

Your god is a false god. Otherwise, it would have perfect datatypes.
Repent before it's too late, idolator, or burn forever in the fires of
poorly structured data!

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326818
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple: ? sql add value to column

2009-10-01 Thread Dave Watts

> ok so looks like the column cat_pg is a varchar.
> so that's why the statement wouldn't work.
> so i need to what, cast it as a numeric to update it?
> UPDATE   x_cat
> SET              cat_pg = CAST(cat_pg AS NUMERIC) + 6
> WHERE     (x_cat_id= 632)

I recommend that you change the datatype of the column.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more in

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326816
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple: ? sql add value to column

2009-10-01 Thread Paul Ihrig

Y...
these are not thing mortals should question. the data which is the word, is
infallible and has come down from on high.
it proceeds us by generations and we shall not question it validity,
integrity or reliability.

On Thu, Oct 1, 2009 at 11:26 AM, Yuliang Ruan wrote:

>
> yea u'd cast it...but the real question you have to ask...why is that field
> a varchar if it's meant to be used as a numeric?
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326815
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Simple: ? sql add value to column

2009-10-01 Thread Yuliang Ruan

yea u'd cast it...but the real question you have to ask...why is that field a 
varchar if it's meant to be used as a numeric? 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326814
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Simple: ? sql add value to column

2009-10-01 Thread Paul Ihrig

ok so looks like the column cat_pg is a varchar.
so that's why the statement wouldn't work.
so i need to what, cast it as a numeric to update it?
UPDATE   x_cat
SET  cat_pg = CAST(cat_pg AS NUMERIC) + 6
WHERE (x_cat_id= 632)


On Thu, Oct 1, 2009 at 10:45 AM, Paul Ihrig  wrote:

> ok i have a bunch of page numbers that need changed.
> they
> are like 10, 14 et..
> i need to add 6 to the value
>
> i tried a sql stament of
>
> UPDATE   x_cat
> SET  cat_pg = cat_pg + 6
> WHERE (x_cat_id= 632)
>
> but my values goto 106, 146, et..
>
>
>


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:326810
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4