hellow mike
i am getting error in this line -------------------- <cfif
Evaluate("attributes.field_char#i#") EQ "0"> ----------------------
i think u r opend cfset tag but where u r ending whether after </cfif> na or
?
i used here and tried. still not coming.
one more thing mike i think u can find where is the getting problem na.
help me.
thanx
ramesh
Error Diagnostic Information
Just in time compilation error
Invalid token found on line 55 at position 30. ColdFusion was looking at the
following text:
<c
Invalid expression element. The usual cause of this error is a misspelling
in the expression text.
The last successfully parsed CFML construct was a CFSET tag occupying
document position (55:5) to (55:10).
The specific sequence of files included or processed is:
C:\INETPUB\WWWROOT\CUSTOMTAGS\LISTADDF.CFM
C:\CFUSION\CUSTOMTAGS\LISTADD.CFM Custom Tag
The error occurred while processing an element with a general identifier of
(CFMODULE), occupying document position (4:3) to (29:5) in the template file
C:\InetPub\wwwroot\customtags\listaddf.cfm.
-----Original Message-----
From: Mike Sheldon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 25, 2000 4:00 PM
To: [EMAIL PROTECTED]
Subject: RE: insert command with attributes
You end up with too many commas
Your query ends up looking like this:
INSERT INTO yada
(field1,field2,field3,)
VALUES
(value1,value2,value3,)
You can't have extraneous punctuation in the query. I'd suggest you build
the field and value strings BEFORE the query, so you have an opportunity to
hack off that last comma from the strings.
<CFSET fields = "">
<CFSET values = "">
<cfloop from ="1" to ="#ln#" index="i">
<CFSET fields = fields & evaluate("ATTRIBUTES.field#i#") & ",">
<CFSET values = values &
<cfif Evaluate("attributes.field_char#i#") EQ "0">
<CFSET values = values & evaluate("FORM.txta#i#") & ",">
<cfelse>
<CFSET values = values & "'" & evaluate("FORM.txta#i#") &
"',">
</cfif>
</cfloop>
<CFSET fields = left(fields, len(fields) - 1)>
<CFSET values = left(values, len(values) - 1)>
<cfquery name="queryac" datasource="#attributes.datasource#">
Insert into #ATTRIBUTES.tablename#
(#fields#)
VALUES
(#preservesinglequotes(values)#)
</cfquery>
Michael J. Sheldon
Internet Applications Developer
Phone: 480.699.1084
http://www.desertraven.com/
PGP Key Available on Request
-----Original Message-----
From: Deva Ramesh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 25, 2000 00:38
To: '[EMAIL PROTECTED]'
Subject: insert command with attributes
hai everybody
this is customtag related problem. i am trying to insert values from
attributes. so i have written following code.
here 1 st question is can i use loop with in the insert command? and
when u r passing the value can i check the condition whether
attributes.field_char#i# is char or numeric. (here 0 means numeric, > 0 is
char)
based on that one i am filtering with cfif condition.
but problem is while executing error is coming. that error i am pasting here
here we can use any alternative way to run this one.
<cfquery name="queryac" datasource="#attributes.datasource#">
Insert into #ATTRIBUTES.tablename#
<cfloop from ="1" to ="#ln#" index="i">
(#evaluate("ATTRIBUTES.field#i#")#)
VALUES(
<cfif #Evaluate("attributes.field_char#i#")# EQ "0">
#FORM.txta#i#,
<cfelse>
'#FORM.txta#i#',
</cfif>
)
</cfloop>
</cfquery>
ERROR here:
Error Diagnostic Information
Just in time compilation error
Invalid parser construct found on line 9 at position 17. ColdFusion was
looking at the following text:
,
Invalid expression format. The usual cause is an error in the expression
structure.
The last successfully parsed CFML construct was dynamic text (a CFML
expression) occupying document position (9:4) to (9:14).
The specific sequence of files included or processed is:
C:\INETPUB\WWWROOT\CUSTOMTAGS\LISTADDF.CFM
C:\CFUSION\CUSTOMTAGS\LISTADD.CFM Custom Tag
The error occurred while processing an element with a general identifier
of (CFMODULE), occupying document position (4:3) to (29:5) in the template
file C:\InetPub\wwwroot \customtags\listaddf.cfm.
Date/Time: 05/25/00 11:33:20
Browser: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
Remote Address: 127.0.0.1
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
----------------------------------------------------------------------------
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.