EasyCFM.COM ColdFusion Forums / Coding Help! / LISTGETAT AND NULLS!

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: LISTGETAT AND NULLS!

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

LOKINSELLA
01-26-2005 @ 3:11 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 12
Joined: May 2004

Hi guys,
Variations of the question that i am about to put have been asked
i have searched the forums and tutorials and really need some
help please.  
I have a CSV file.  I want to insert this file to my database.  
Problem is my CSV has some null values.  I am trying to use
LISTGETAT, but this ignores nulls and my data goes out of
sequence.  I know i want to try and force it to acknowledge the
null in some way.  Does any one have any ideas please ?
If this question is already out there somewhere i apologise but i
looked high and low!
  

newkirk
01-26-2005 @ 3:56 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 237
Joined: Oct 2004

You'll need to parse the comma seperated string with one of the available string functions using "," as the delimiters and remove the NULL or "" values.

Stay Classy Smile
http://photoshare.blueflydatadesign.com

LOKINSELLA
01-26-2005 @ 4:18 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 12
Joined: May 2004

Hi, i dont want to delete/remove them i want to keep and
insert them....

newkirk
01-26-2005 @ 4:21 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 237
Joined: Oct 2004

Here is a more helpful example:
The layout:

ReplaceNoCase(string, substring1, substring2 [, scope ])

A real world sample that looks for blank spaces and replaces them with the word NULL:
<CFSET editedString=ReplaceNoCase(CSVFileString," ",'NULL','ALL')>

The liveDocs Link to this function:
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa70.htm

Stay Classy Smile
http://photoshare.blueflydatadesign.com

This message was edited by newkirk on 1-26-05 @ 4:51 PM

newkirk
01-26-2005 @ 4:30 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 237
Joined: Oct 2004

AND then that should allow you to insert into the db without losing your order of data.  And when you query your db just check for the string "NULL" to know its empty.  Doing it that way will also elimnate the need for outer joins as all fields will contain values as opposed to empty cells.  Test like <CFIF qresult.picname IS "NULL">NO PICTURE FOUND FOR THIS FILE</CFIF>

Stay Classy Smile
http://photoshare.blueflydatadesign.com


Website Designed and Developed by Pablo Varando.