[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] SQL update problems
I think you may have some problems with your date stamp, I do something
similar with a time date stamp, and here is the formatting that I use:
[time]%Y-%m-%d %H:%M:%S[/time]
you used a %M (which is minutes) not an %m(wich is month)
You may also be interested is doing some reading on the [import] tag.
Steven Potter
Scott Andreas wrote:
> Hey thanks for everyones help with this I appreciate it very much
>
> I'm still running into problems with update. My code is
>
>
> [seti dropdate][tag op=time]%Y%M%d[/tag][/seti]
> [tag flag write]catalogs[/tag]
> [query list=1
> table=catalogs
> st=db
> sql="UPDATE catalogs
> SET shipmode = '0', catdropdate = '[scratch dropdate]'
> WHERE country = 'US' AND show_qty = '1' AND shipmode = '1' AND completed
> != '1'
> "]
> [/query]
> contacts data updated!
>
>
> I have my test data in a GDBM data file there are no errors yet when I parse
> this info it only wants to update one row of the table( it should be
> updating 8 records giving the constraints) And I think there is a bug with
> time... I'm getting all sort of different month outputs for instance the tag
> that I have in scratch space is giving me 20022206 as todays date.
>
> Also all of my date widgets on all of my catalogs are displaying March for
> February.(weird)
>
> I'm running IC ver. 4.8.1 on RH 7.0
>
> -----Original Message-----
> From: interchange-users-admin@interchange.redhat.com
> [mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of
> Scott Andreas
> Sent: Tuesday, February 05, 2002 3:07 PM
> To: 'IC mailing list'
> Subject: [ic] SQL update problems
>
>
> 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
>
> _______________________________________________
> interchange-users mailing list
> interchange-users@interchange.redhat.com
> http://interchange.redhat.com/mailman/listinfo/interchange-users
>
>