SQL Stored procedure to insert records from form

I am using CF to enter data from a form.  Can the same be done with a stored procedure?

Here is the coldfusion form

<cfquery name="AddVideo" datasource="#datasource#">
                INSERT INTO VideoList
                (CategoryID, Video_Name, Length, Production_Company, Credits, Availability, NumTests)
                VALUES (<cfqueryparam cfsqltype="CF_SQL_INteger"  value="#FORM.CategoryID#">,
                        <cfqueryparam cfsqltype="CF_SQL_VARCHAR"  value="#FORM.Video_Name#">,
                        <cfqueryparam cfsqltype="CF_SQL_VARCHAR"  value="#FORM.Length#">,
                        <cfqueryparam cfsqltype="CF_SQL_VARCHAR"  value="#FORM.Production_Company#">,
                        <cfqueryparam cfsqltype="CF_SQL_INteger"  value="#FORM.Credits#">,
                        <cfqueryparam cfsqltype="CF_SQL_INteger"  value="#FORM.Availability#">,
                         <cfqueryparam cfsqltype="CF_SQL_INteger"  value="#FORM.NumTests#">)
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

erikTsomikSystem Architect, CF programmer Commented:
Yes it can. You would need to pass the parameters to the stored procedure , You will need to adjust the data types according to your database hierarchy

Call A stored procedure

<cfstoredproc procedure="spINSERT_dbo_VideoList " datasource="#request.datasource#">
	<cfprocparam value="#FORM.CategoryID#" cfsqltype="CF_SQL_INTEGER" type="In">
<cfprocparam value="#FORM.Video_Name#" cfsqltype="CF_SQL_VARCHAR " type="In">

and SO ON  .......

	<cfprocparam variable="isEmployeeReal" cfsqltype="CF_SQL_INTEGER" type="Out">

Open in new window

CREATE PROCEDURE dbo.spINSERT_dbo_VideoList @CategoryID int, @Video_Name varchar(250), 
@Length INT, @Production_Company varchar(255), @Credits int, @Availability bit,@NumTests INT

           ,@Availability ,

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohnMac328Author Commented:
Great - that does make sense now.
JohnMac328Author Commented:
Great job
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.