Coldfusion MySQL, FUNCTION personalwebsitecoldfusion.AddUser does not exist

129 Views Asked by At

Think it's time to ask for some help with this error since I've tried everything I know how to do. Basically I created a stored procedure in MySQL called AddUser, and the database name is PersonalWebsiteColdfusion. I can guarantee you that it does exist. If it's helpful I'm using Windows IIS 7.5 and OpenBD for Coldfusion. Also just to clarify that I have created and verified the datasource in the OpenBD web administrator. MySQL is version 5.6 and it's a x64 bit envirnoment. The thing is, it works with cfquery but I'd prefer to use cfstoredproc if possible. The error is basically what it says in the title. Hope someone can help.

Updated to give relevant procedure code.

<cfstoredproc datasource="PersonalWebsiteCF" procedure="AddUser" returnCode="yes">
    <cfprocparam cfsqltype="cf_sql_varchar" value="#form.txtFirstName#" type="in" variable="strFirstName" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="#form.txtLastName#" type="in" variable="strLastName" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="#form.txtEmail#" type="in" variable="strEmail" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="#form.txtUsername#" type="in" variable="strUsername" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="#form.txtPassword#" type="in" variable="strPassword" />
    <cfprocparam cfsqltype="cf_sql_timestamp" value="#Now()#" type="in" variable="strDateJoined" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="#cgi.remote_addr#" type="in" variable="strIP" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="Member" type="in" variable="strMembershipStatus" />
    <cfprocparam cfsqltype="cf_sql_varchar" value="No" type="in" variable="strActive" />
    <cfprocparam cfsqltype="cf_sql_integer" value="0" type="out" variable="strUserID" />
</cfstoredproc>

Maybe the stored procedure itself would be useful as well:

DELIMITER //
CREATE PROCEDURE AddUser (

IN strFirstName varchar(50), 
IN strLastName varchar(50),
IN strEmail varchar(50),
IN strUsername varchar(50),
IN strPassword varchar(150),
IN strDateJoined datetime,
IN strIP varchar(50),
IN strMembershipStatus varchar(50),
IN strActive varchar(50),
OUT strUserID int

) 

BEGIN

INSERT INTO tblUsers (FirstName, LastName, Email, Username, Password, DateJoined, IP,  MembershipStatus, Active) VALUES (strFirstName, strLastName, strEmail, strUsername, strPassword, strDateJoined, strIP, strMembershipStatus, strActive);

SET strUserID = LAST_INSERT_ID();

END//;

I've been trying various things since I first posted but I still haven't found a solution.

Thank you

Douglas

1

There are 1 best solutions below

0
On

Verify that in Advance Settings in Admin section where you have created the DSN, Stored Procedure option is selected.

Also, a workaround, though it does not address your original problem, is to call SP through a query.

<cfquery name="SomeName" dataSource="SOME_DSN">
    call Your_SP #Arg_1#,#Arg_2#
</cfquery>