Hi all...I have a stored procedure that works. I have modified it so it back
the identity of the column I just inserted. Unfortunately, I keep getting an
undefined error with my variable. newident is the variable name. Here is my SP
CREATE PROCEDURE sp_add_folder
@pid int,
@fname varchar(50),
@limit int,
@folder_path varchar(100),
@rootid int, @rstep int,
@newident int =null OUTPUT
as
DECLARE @right_most_sibling varchar(4)
SET @right_most_sibling
= (SELECT rgt
FROM folders
WHERE folder_id = @pid);
UPDATE folders
SET lft = CASE WHEN lft > @right_most_sibling
THEN lft + 2
ELSE lft END,
rgt = CASE WHEN rgt >= @right_most_sibling
THEN rgt + 2
ELSE rgt END
WHERE rgt >= @right_most_sibling;
INSERT INTO folders (folder_name, folder_parent, folder_path, limit_upload,
root_parent, root_step, lft, rgt)
VALUES (@fname, @pid, @folder_path, @limit, @rootid, @rstep,
@right_most_sibling ,
(@right_most_sibling + 1));
SET @newident = @@IDENTITY;
GO
Here is my CF code..
<cfoutput>
<CFSTOREDPROC PROCEDURE="sp_add_folder" DATASOURCE="#dsn#">
<CFPROCPARAM type="In"
CFSQLTYPE="CF_SQL_INTEGER"
VALUE="#form.pid#" null="no">
<CFPROCPARAM type="In"
CFSQLTYPE="CF_SQL_VARCHAR"
VALUE="#form.folder_name#" maxlength="50" null="no">
<cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#form.limit#"
null="no">
<cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" value="#thepath#"
maxlength="100" null="no">
<cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#form.rootid#"
null="no">
<cfprocparam type="In" cfsqltype="CF_SQL_INTEGER" value="#form.rstep#"
null="no">
<cfprocparam type="Out" cfsqltype="CF_SQL_NUMERIC" variable="newident"
null="yes">
<CFPROCRESULT
NAME="getnewrecord">
</CFSTOREDPROC>
</cfoutput>
<!---create the folder on the server--->
<cfdirectory directory="#all_docs_start#\#thepath#" action="create">
<cfoutput>
record number is #newindent#
</cfoutput>
Thanks for any help you can offer.
Brian
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267683
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4