Right you are Jochem!

Here is the stored proc code:

CREATE PROCEDURE Sp_Credential_Create
        @User_ID        INTEGER,
        @Username       VARCHAR(128),
        @Password       VARCHAR(128)
AS
SET NOCOUNT ON
INSERT INTO Credential (User_ID, Username, Password)
VALUES  (@User_ID, @Username, @Password)

And here is the function that fires the stored proc.

<!--- Create Record --->
<cffunction name="create" access="public" output="false" returntype="void"
hint="I create a record in persistance">
        <cfargument name="UserID" required="true" type="numeric" hint="I'm
the user id for the profile to be inserted" />
        <cfargument name="Username" required="true" type="string"
hint="Username" />
        <cfargument name="Password" required="true" type="string"
hint="Password" />
        
        <!--- Create Temporary Local Structure --->
        <cfset var LOCAL = structNew() />
        
        <!--- Query To Create Record --->
        <cfstoredproc procedure="Sp_Profile_Create"
datasource="#VARIABLES.Instance.Datasource.getDatasource()#"
username="#VARIABLES.Instance.Datasource.getUsername()#"
password="#VARIABLES.Instance.Datasource.getPassword()#">
                <cfprocparam value="#ARGUMENTS.UserID#" variable="User_ID"
cfsqltype="cf_sql_integer" maxlength="128" />
                <cfprocparam
value="#VARIABLES.Instance.Cryptographer.getEncrypted(ARGUMENTS.Username)#"
variable="Username" cfsqltype="cf_sql_varchar" maxlength="128" />

                <cfprocparam
value="#VARIABLES.Instance.Cryptographer.getEncrypted(ARGUMENTS.Password)#"
variable="Password" cfsqltype="cf_sql_varchar" maxlength="128" />
        </cfstoredproc>
        
        <cfreturn />
</cffunction>

And finally the code that triggers the function.

<cfset VARIABLES.DAO.create(1, 'TestUser, 'TestPassword') />

Hope that all makes sense to you, it would be great to figure out what's
causing this.

Thanks,

Rob

-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED] 
Sent: 14 June 2007 18:21
To: CF-Talk
Subject: Re: Error converting data type varchar to int.

Robert Rawlins - Think Blue wrote:
> 
> [Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type
> varchar to int.
> 
> This is a snippet of the query details thrown back in the error, it simple
> takes 3 parameters, the first is an integer and the second 2 are
> strings/varchar.
> 
> (param 1) = [type='IN', class='java.lang.Integer', value='1',
> sqltype='cf_sql_integer'] , (param 2) = [type='IN',
> class='java.lang.String', value='07C67BA421500B791090E92F4C3D7032',
> sqltype='cf_sql_varchar'] , (param 3) = [type='IN',
> class='java.lang.String', value='D5534BDE55CAB29E3932D6CE4F211C34',
> sqltype='cf_sql_varchar']
> 
> The param java types appear to match the cf_sql_type. These types also
match
> those defined inside the stored proc and the table columns, I can't see
> what's causing this issue.

If you don't include the stored procedure and CFML code neither can we :)

Jochem



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:281239
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to