Link to home
Start Free TrialLog in
Avatar of Panos
PanosFlag for Germany

asked on

Invalid data '' for CFSQLTYPE CF_SQL_INTEGER

Hello experts.
Using my query i have the error :Invalid data '' for CFSQLTYPE CF_SQL_INTEGER
I get this error for a value with cfparam:
<cfparam name="Form.TUVmonth" default="">
The query is like:
<cfquery name="InsertArtikel" datasource="#dsn#">
INSERT INTO ARTIKEL (.........TUVmonth)
Values (............,<cfqueryparam value="#Form.TUVmonth#" cfsqltype="cf_sql_integer">)
</cfquery>
The type in DB is int.
(i have this problem only when i don't put any value in the formfield Tuvmonth.)
Any help?
ASKER CERTIFIED SOLUTION
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

Hi
If i use the cfprocparam in the query must i use the cfparam too?
(<cfparam name="Form.TUVmonth" default="">
<cfquery name="InsertArtikel" datasource="#dsn#">
INSERT INTO ARTIKEL (.........TUVmonth)
Values (............,<cfprocparam type="in" cfsqltype="cf_sql_integer" value="#val( FORM.TUVmonth)#">)
</cfquery>)
try not to use it
Avatar of Panos

ASKER

I have this error:
 Context validation error for tag cfprocparam.
The tag must be nested inside a cfstoredproc tag
use cfqueryparam
Avatar of Panos

ASKER

Hi
This is working without cfparam.
Is this OK?
(<cfqueryparam cfsqltype="cf_sql_integer" value="#val(FORM.TUVmonth)#">)
yes that is perfect
Avatar of Panos

ASKER

And something else.
If i want to have default values f.e for checkboxes the value 0,is this wrong to use the cfparam tag?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Panos

ASKER

Hi
Thank you for your help
regards
panos