>Another quick question...I've noticed elsewhere, that it is common to set a
>value to NULL.
Technically, nulls in a relational database are a sign of badly
designed database.
(an 'optional' value should be represented with a 0..1 join to a
separate table, or similar).
In practise, especially wi
That totally depends on your DB setup.
If you have a column that does not allow NULL, then you have have send the
empty string ('') if there's no value. If you have SQL code that tests
Country IS NULL, then you may want to send NULL for that value in place of
the empty string.
Again, dependi
-
From: Jason Fisher [mailto:ja...@wanax.com]
Sent: Tuesday, June 16, 2009 2:56 PM
To: cf-talk
Subject: Re: insert trouble...zero length
Actually, empty string simply breaks the Boolean check, it's the primary
exception.
cfif isBoolean(stringVar) ...
will at least let it through only if it
Boughton"
Sent: Tuesday, June 16, 2009 2:48 PM
To: "cf-talk"
Subject: Re: insert trouble...zero length
Nothing wrong with your mailing list ettiquette - I had to post
manually (hof broke) and just got the subject wrong the first time,
and posted again so it was correctly threaded.
Anyh
Nothing wrong with your mailing list ettiquette - I had to post
manually (hof broke) and just got the subject wrong the first time,
and posted again so it was correctly threaded.
Anyhow, I'd still recommend adding a check against it being missing -
unless you're 300% certain it will always be the
ect: Re: insert trouble...zero length
Your problem there is the numeric ContactType field - if it is
missing, you get an empty item between the two commas, which is
invalid SQL syntax.
You can solve it with cfqueryparam by setting the null property based
on whether it contains a numeric value or not:
Mark Fuqua MdProfinish wrote:
> Sorry to ask, but does actually
> suffice as a check for length or do I have to add = 0... LEN(TRIM(myquery.MyFieldName)) = 0>
It does suffice do to the loosely typed nature of ColdFusion. Basically
anything the evaluates to a ZERO can be considered false and a
The exception is blank, which cannot be resolved as Boolean.
So, will truly resolve
either true or false.
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lis
Yes,
ColdFusion will implicitly treat anything as a boolean. As long as the it's
not 0 it's considered true.
=]
--
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org
Your problem there is the numeric ContactType field - if it is
missing, you get an empty item between the two commas, which is
invalid SQL syntax.
You can solve it with cfqueryparam by setting the null property based
on whether it contains a numeric value or not:
--
Peter Boughton
//hybridc
ration?
>
> -Original Message-
> From: Rob Parkhill [mailto:robert.parkh...@gmail.com]
> Sent: Tuesday, June 16, 2009 1:42 PM
> To: cf-talk
> Subject: Re: insert trouble...zero length
>
>
> You will have to make sure that the table you are inserting into can have a
On Tue, Jun 16, 2009 at 11:16 AM, Mark Fuqua MdProfinish <
m...@mdprofinish.com> wrote:
>
> Sorry to ask, but does actually
> suffice as a check for length or do I have to add = 0... LEN(TRIM(myquery.MyFieldName)) = 0>
>
actually that'd be (note the 'eq'
not '=') :)
Seems like you're saying
lto:alan.rot...@gmail.com]
Sent: Tuesday, June 16, 2009 1:44 PM
To: cf-talk
Subject: Re: insert trouble...zero length
There are several valid ways to handle this.
In your destination table you can define a default value if none is
provided, this of course does require you to do a CFIF around eac
Your problem there is the numeric ContactType field - if it is
missing, you get an empty item between the two commas, which is
invalid SQL syntax.
You can solve it with cfqueryparam by setting the null property based
on whether it contains a numeric value or not:
~~
ubject: Re: insert trouble...zero length
You will have to make sure that the table you are inserting into can have a
NULL as a value, or you will need to modify your code to look at each value
and change any NULLs to either a space or a zero depending on the datatype
you are inserting.
HTH
Rob
O
There are several valid ways to handle this.
In your destination table you can define a default value if none
is provided, this of course does require you to do a CFIF around each item
in your insert and you will need to check to see if the value
you are about to insert has a length
Of course i
There are several valid ways to handle this.
In your destination table you can define a default value if none is
provided, this of course does require you to do a CFIF around each item in
your insert and you will need to check to see if the value you are about to
insert has a length
Of course if
You will have to make sure that the table you are inserting into can have a
NULL as a value, or you will need to modify your code to look at each value
and change any NULLs to either a space or a zero depending on the datatype
you are inserting.
HTH
Rob
On Tue, Jun 16, 2009 at 1:33 PM, Mark Fuqu
Having trouble with the following code.having trouble with "zero length"
values. The field in the database is empty and when it goes to insert it
into another table, it chokes. Is there a way to set a " " value as
default? Or do I have to do a cfif on each value? I'm sure I'm missing
something
19 matches
Mail list logo