Coldfusion error executing sql statement

I keep getting the error message,

Replace function argument 2 cannot be empty

I cannot understand what I am doing wrong.

The code:

local.drafts.setSQL( "INSERT messages (tm, draft, linkA, linkB) values (:tm:, :draft:, :linkA:, :linkB:"); local.drafts.addParam(name="tm",value=s,CFSQLTYPE="CF_SQL_TIMESTAMP"); local.drafts.addParam(name="draft",value=1, CFSQLTYPE="CF_SQL_BIT"); local.drafts.addParam(name="linkA",value=h,CFSQLTYPE="CF_SQL_SMALLINT"); local.drafts.addParam(name="linkB",value=b,CFSQLTYPE="CF_SQL_SMALLINT"); local.drafts.execute(); 
+4
source share
2 answers

This sounds like a problem with the Mura Search Engine Safe (SES) URLs.

This is a replacement function error, see the hasbro example! http://webcache.googleusercontent.com/search?q=cache:a0Dxwwp5iPsJ:www.hasbro.com/games/en_US/clue/virtual-mansion/fileSizes.cfm%3Ffn0%3D%26fn1%3Dclue.swf%26&hl= en & gl = us & strip = 1

0
source

Are you sure the syntax is correct? I donโ€™t remember the ending: so try (keeping a note about trailing spaces)

 local.drafts.setSQL("INSERT INTO messages (tm, draft, linkA, linkB) VALUES ( :tm , :draft , :linkA , :linkB )"); 

It is only possible that your final bracket on VALUES is on the wrong side of the quote, of course.

A similar problem was found in this error using request parameters with cfscript request

If, of course, this is due to a C + P error, please reinstall the source

+3
source

Source: https://habr.com/ru/post/1396930/


All Articles