troubleshooting Question

Cannot save cfoutput query to database or save using cffile

Avatar of Qsorb
QsorbFlag for United States of America asked on
Microsoft SQL ServerJavaScriptColdFusion Language
6 Comments2 Solutions820 ViewsLast Modified:
I cannot seem to save this mixed text to my sql 2000 database:

This is what I'm trying to save:
// -----------------------------------------------------------------------------------
{src:"./313.jpg",title:"Justices toss out government fines ",href:"/bnews/story.htm?id=313"}, {src:"./312.jpg",title:"Aimee Copeland leaves Ga. hospital ",href:"/bnews/story.htm?id=312"}, {src:"./311.jpg",title:"grandma steals $97,000 From Grands",href:"/bnews/story.htm?id=311"}, {src:"./310.jpg",title:"Tom Cruise, Scientology And The Odd",href:"/bnews/story.htm?id=310"}, {src:"./309.jpg",title:"California Homeless Man Gets Shelte",href:"/bnews/story.htm?id=309"}, {src:"./308.jpg",title:"7-year-old girl, Heaven, shot dead ",href:"/bnews/story.htm?id=308"}, {src:"./307.jpg",title:"Valerie Bruno Cuts Off Daughter Kay",href:"/bnews/story.htm?id=307"}, {src:"./306.jpg",title:"Adam Longoria, Alicia DeBolts Murde",href:"/bnews/story.htm?id=306"}, {src:"./305.jpg",title:"Cadaver dogs join search for 4-year",href:"/bnews/story.htm?id=305"}, {src:"./304.jpg",title:"Police Rescue Severely Malnourished",href:"/bnews/story.htm?id=304"}
// -----------------------------------------------------------------------------------
Data type varchar length 7000. I've tried every data type I can think of and when attempting to manually insert into the sql table, I get the error:

"The value you entered is not consistant with the data type or length of the column, or over grid buffer limit."

So, I tried to save the text to my hard drive via CFFILE, but also got an error:

"Invalid CFML construct ..."

All I want to do is save the file as it is. I understand it has lot of non-standard characters but what's the  problem? Do I need to use some kind of binary type or what? This is all  pretty frustrating.

BACKGROUND:
I'm using the WOWSLIDER carousel program. The idea is to show an image associated with the news, show the title of the story, and provide a link to the story. Most of these are from news feeds,  and everything,  including images, are saved on our server. So, I thought it best to use my database and cfquery to insert which images to display so that the carousel is self perpetuating as the news changes. That  means I need to change the script.js file, on the fly, and cfinsert parts into the middle of the file and write it to the database or to hard drive so it can be used again.

fyi, here's the script I need to modify:

// -----------------------------------------------------------------------------------
// http://wowslider.com/ - WOW Slider 2.3
function ws_fade(c,a,b){var e=jQuery;var d=e("ul",b);var f={position:"absolute",left:0,top:0,width:"100%",height:"100%"};this.go=function(g,h){var i=e(a.get(g)).clone().css(f).hide().appendTo(b);if(!c.noCross){var j=e(a.get(h)).clone().css(f).appendTo(b);d.hide();j.fadeOut(c.duration,function(){j.remove()})}i.fadeIn(c.duration,function(){d.css({left:-g+"00%"}).show();i.remove()});return g}};// -----------------------------------------------------------------------------------

jQuery("#wowslider-container1").wowSlider({effect:"fade",prev:"",next:"",duration:20*100,delay:20*100,width:400,height:250,autoPlay:true,stopOnHover:false,loop:false,bullets:0,caption:false,controls:true,logo:"engine1/loading.gif",images:[{src:"./312.jpg",title:"312",href:"/news/main/national/312"},{src:"./311.jpg",title:"311",href:"/news/main/national/311"},{src:"./310.jpg",title:"310",href:"/news/main/national/310"}]});
// -----------------------------------------------------------------------------------

I asum can can break this  up into three pieces, the image numbers, titles, and links will be replaced by my database coldfusion variables.

Maybe I'm looking at this in the wrong manner so could use some fresh ideas, and if not, let me know why I cannot save this to my database or using cffile to hard drive.


Suggestions?
{src:"./313.jpg",title:"Justices toss out government fines ",href:"/bnews/story.htm?id=313"}, {src:"./312.jpg",title:"Aimee Copeland leaves Ga. hospital ",href:"/bnews/story.htm?id=312"}, {src:"./311.jpg",title:"grandma steals $97,000 From Grands",href:"/bnews/story.htm?id=311"}, {src:"./310.jpg",title:"Tom Cruise, Scientology And The Odd",href:"/bnews/story.htm?id=310"}, {src:"./309.jpg",title:"California Homeless Man Gets Shelte",href:"/bnews/story.htm?id=309"}, {src:"./308.jpg",title:"7-year-old girl, Heaven, shot dead ",href:"/bnews/story.htm?id=308"}, {src:"./307.jpg",title:"Valerie Bruno Cuts Off Daughter Kay",href:"/bnews/story.htm?id=307"}, {src:"./306.jpg",title:"Adam Longoria, Alicia DeBolts Murde",href:"/bnews/story.htm?id=306"}, {src:"./305.jpg",title:"Cadaver dogs join search for 4-year",href:"/bnews/story.htm?id=305"}, {src:"./304.jpg",title:"Police Rescue Severely Malnourished",href:"/bnews/story.htm?id=304"}
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros