Ask a Question related to Coldfusion Database Access, Design and Development.
-
dj shane #1
SPROC Question, what am I doing wrong?
Here's my SPROC.
CREATE PROCEDURE UpdateHits
AS
DECLARE @Result AS int
DECLARE @ResultDate AS datetime
SET @Result = (SELECT HitCount FROM v2_hit WHERE Hitdate = @ResultDate)
IF @Result <> ''
BEGIN
UPDATE v2_hit
SET HitCount = HitCount + 1
WHERE HitDate = @ResultDate
END
ELSE
BEGIN
INSERT INTO v2_hit
(HitCount, HitDate)
VALUES(1, @ResultDate)
END
GO
And here's how Im calling it.
<cfstoredproc procedure="UpdateHits" datasource="cart">
<cfprocparam type="In" cfsqltype="CF_SQL_DATE" dbvarname="ResultDate"
value="#createODBCDateTime(now())#">
</cfstoredproc>
I don't need any vars back, just trying to pass it a date.
dj shane Guest
-
SPROC vs Inline Times.
Hey guys. I have a page which is generating fairly lengthly reports. I understand most of the parsing time is being created from the many tr and... -
sproc in DW asp.net
I am trying to create a dataset from a stored procedure. I am using the stored procedure dialog box but when I put in the values I get an... -
Passing in SubReport Sproc Parameters using ASP
The following code works fine when previewing a Crystal report using ASP, EXCEPT when it gets to a report using a SubReport and its associated... -
Double Select after Insert in SPROC?
Hi, What I want to do in my SPROC is to insert values into a table that are selected by a select statement. Like this: INSERT INTO dbo.tbl1... -
SPROC parameters
Hi, I'm putting together a Stored Procedure. I need to build a select statement that grabs two column values from a table (single row) and then... -
philh #2
Re: SPROC Question, what am I doing wrong?
Hi Shane,
The error says you're supplying a parameter to an SP that doesn't require one.
It's correct.
Change
CREATE PROCEDURE UpdateHits
AS
DECLARE @Result AS int
DECLARE @ResultDate AS datetime
SET @Result = (SELECT HitCount FROM v2_hit WHERE Hitdate = @ResultDate)
to
CREATE PROCEDURE UpdateHits
@ResultDate datetime
AS
DECLARE @Result AS int
SET @Result = (SELECT HitCount FROM v2_hit WHERE Hitdate = @ResultDate)
Params have to be declared before the AS word.
HTH,
philh Guest
-
dj shane #3
Re: SPROC Question, what am I doing wrong?
I knew it was something simple, thanks a million
dj shane Guest



Reply With Quote

