[ic] SQL update problems

Scott Underwood interchange-users@interchange.redhat.com
Tue Feb 5 18:53:01 2002


Scott,
	If this is postgresql then it doesn't like the backtick 
characters surrounding the date it only likes the single qoute. If this 
postgresql and the field your trying to update is a date field use 'now'. 
This converts to the date, will also work with the date/time fields.

On Tue, 5 Feb 2002, Scott Andreas wrote:

> Hello list
> We're using Interchange as a catalog mail order clearing house and contact
> management
> Which so far is work excellently
> 
> 
> I'm trying to update certain records based on where criteria. Here is what I
> have
> 
> [query list=1
> 	table=catalogs
> 	st=db
> 	sql="UPDATE catalogs
> 		SET shipmode = 0, catdropdate = `$tag->time{%Y%M%d}`
> 		WHERE country = 'US' AND show_qty = '1' AND shipmode = '1' AND completed
> != '1'
> 
> "]
> 
> In my error log...
> 
> /admin/update_contacts.html Bad SQL statement: Parse error near
> `$tag->time{%Y%M%d}`
> > 		WHERE country = 'US' AND show_qty = '1' AND mv_shipmode = '1' AND
> completed != '1'
> 
> It appears that the problem is $tag... but how can I put an update time
> stamp on the row?
> 
> Also how can I display the rows effected by the UPDATE
> 
> J. Scott Andreas :)
> IS/Programmer/WebDevelopement
> Learning Services, Inc.
> e-mail: sandreas@learningservicesinc.com
> phone: 1-800-877-9378 ext. 146
> fax: (541) 744-2056
> 
>        ---    __o
>      ---   _-\<,_
>       --- (_)/ (_)
> 
> 
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users
> 

-- 
Scott Underwood

"-- challenging authority and insisting that it justify itself -- 
    are appropriate at all levels."

	--Noam Chomsky