Just to chime in:

I recommend the use of assertions. Don't assume that any input is present and 
correct.

For example, my custom tag CF_ColumnList requires a CFML query as input, so I 
test that this input item is:
(a) provided, via <cfif not IsDefined("Attributes.Query")>
(b) a CFML query object, via <cfif not IsQuery(Attributes.Query)>

-David

On Sunday, April 01, 2001 9:47 AM, Patricia Lee [SMTP:[EMAIL PROTECTED]] wrote:
> Col2 might not contain a query.
>
> download one of the following tools from the taggallery:
>
> cf_dump
> cf_objectdump
>
> Then, select the wddx packets from the db as you have and use these tools to
> examine the columns.  These tools will let you visually see what information
> is in the columns and will tell you the datatype of the information.
>
> Col2 might hold a serialized array, or structure rather than a query.
>
> Besides, I think every developer should be using these tools.... it makes
> life SO MUCH EASIER!
>
> |-----Original Message-----
> |From: Evan Lavidor [mailto:[EMAIL PROTECTED]]
> |Sent: Sunday, April 01, 2001 12:36 AM
> |To: CF-Talk
> |Subject: <cfwddx action="wddx2cfml"> question
> |
> |
> |I have a table of data that was populated by an app not built
> |by me (so I'm
> |starting off at a disadvantage in terms of not knowing
> |everything about it -
> |I'm getting more info to help clear that up).
> |
> |In two of the columns in the table (SQL Server 7), the data
> |has been stored
> |as WDDX packets.
> |
> |So, I'm doing the following to get at them and have a look at
> |the data in a
> |more usable and understandable form:
> |
> || <cfquery datasource="#Request.DSN_OldData#" dbtype="ODBC"
> |name="getpacket"
> |maxrows="1">
> ||    SELECT T.Col1, T.Col2
> ||    FROM OldDataTable T
> || </cfquery>
> ||
> || <cfwddx action="WDDX2CFML" input="#getpacket.col1"
> |output="col1query">
> || <cfwddx action="WDDX2CFML" input="#getpacket.col2#"
> |output="col2query">
> ||
> || <cfoutput>
> ||    #col1query.recordcount#<br>
> ||    #col1query.columnlist#<br>
> ||    <br>
> ||    #col2query.recordcount#<br>
> ||    #col2query.columnlist#<br>
> || </cfoutput>
> |
> |All pretty straightforward, right?
> |
> |Both of the <cfwddx> tags execute fine and I see the recordcount and
> |columnlist from col1query.  However, when it gets to the
> |col2query outputs,
> |I get the following:
> |
> || Error Diagnostic Information
> || An error occurred while evaluating the expression:
> || #col2query.recordcount#
> ||
> || Error near line 26, column 2.
> ||
> |---------------------------------------------------------------
> |-----------
> |------
> || Error resolving parameter COL2QUERY.RECORDCOUNT
> ||
> || The object RECORDCOUNT is not present in the scope named
> |COL2QUERY. It is
> |likely that you
> || have misspelled the name of the object you are trying to access.
> |
> |
> |Now, if it was an invalid packet (which it doesn't look like
> |when I just
> |output it to the screen), it would fail the <cfwddx> call,
> |right?  Since it
> |passes it, why can't I access it like a query?
> |
> |Col1query works just fine.  Gives me a recordcount, a
> |columnlist, I can loop
> |over records, etc. etc. etc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to