I would modify the code to eliminate evaludate
function sqlValueFormat(field) {
if (isNumeric(field)) {
field = trim(field);
} else {
field = "'" & trim(field) & "'";
}
return field;
}
SELECT *
FROM#trim(i)#
INSERT INTO #trim(i)#
#j# ,
VALUES
(
#sqlValueFormat( getall[j][currentrow] )#
,
)
On 3/19/07, Mik Muller <[EMAIL PROTECTED]> wrote:
>
> You want to evaluate field to its value
>
> >if (isNumeric(field)) {
> >field = trim(evaluate(field));
> >} else {
> >field = "'" & trim(evaluate(field)) & "'";
> >}
> >return field;
>
> Mik
>
>
> At 09:21 AM 3/19/2007, Pete Ruckelshaus wrote:
> >Hi All,
> >
> >I have a data import project that I am trying to simplify, mainly
> >because of the number of tables and amount of data involved. I'm
> >importing a number of tables from a MySQL database to an MS SQL Server
> >database with an identical structure, except for datatypes being
> >changed where appropriate.
> >
> >The problem is, in my code I am ending up passing in the column name
> >rather than the actual column value. Can anyone tell me what I'm
> >doing wrong? Here's my code:
> >
> >
> >
> >function sqlValueFormat(field) {
> >if (isNumeric(field)) {
> >field = trim(field);
> >} else {
> >field = "'" & trim(field) & "'";
> >}
> >return field;
> >}
> >
> >
> >
> >
> >SELECT *
> >FROM#trim(i)#
> >
> >
> >
> >INSERT INTO
> #trim(i)#(#getall.columnlist#)
> >VALUES ( list="#getall.columnlist#" index="j"
> >delimiters=",">#sqlValueFormat(evaluate(j))# >listLast(getall.columnlist, ",")>,);
> >
> >
> >
> >
> >
> >The error that I'm getting is "cannot convert the value "STAMP" to a
> >boolean" -- "STAMP" is a column name in the table, not the actual
> >chunk of data, which is what I want.
> >
> >Thanks!
> >
> >Pete
> >
> >
>
>
~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:272993
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4