Ask a Question related to ASP Database, Design and Development.
-
Cecil Westerhof #1
Problem with execute to make a stored procedure
I have to maintain a piece of code. One of the things that is done is a
create procedure:
CREATE PROCEDURE PROC_22_
RETURNS(IEXTENSION INTEGER,CNTICALLINGNBR INTEGER,CNTIDIALEDNBR
INTEGER,TOTAL INTEGER) AS
DECLARE VARIABLE SORTORDER INTEGER;
BEGIN
SORTORDER = 0;
FOR SELECT ICALLINGNBR AS IEXTENSION
, SUM(CNTICALLINGNBR) AS CNTICALLINGNBR
, SUM(CNTIDIALEDNBR) AS CNTIDIALEDNBR
, (SUM(CNTICALLINGNBR) + SUM(CNTIDIALEDNBR)) AS TOTAL
FROM SV_22_
GROUP BY ICALLINGNBR
ORDER BY 4 DESC
INTO :IEXTENSION ,:CNTICALLINGNBR ,:CNTIDIALEDNBR ,:TOTAL
DO
BEGIN
IF((SORTORDER >= 0) AND (SORTORDER < 10)) THEN
BEGIN
SUSPEND;
END
SORTORDER = SORTORDER + 1;
END
END
When this code is execute, I get an error.
Number -2147217904
HelpContext 0
Description The command required parameters
I tried it with:
oDbConn.Execute strStoredProc, adExecuteNoRecords
and
oDbConn.Execute strStoredProc, , adExecuteNoRecords
Anybody an idea what could be the problem?
Cecil Westerhof Guest
-
execute stored procedure
Does anybody know how I can execute one of the system stored procedures from master database. for example this is throwing error: <cfquery... -
Execute permission denied on 'stored procedure' dbo
How to solve the problem from the above topic. I can execute the stored procedure through the web service. I am using Integrated Security connection... -
UNIX-Box slow down while execute stored procedure
Hi, Sorry for my "special english". We are on a DGUX-Box with IDS 7.31 ( 4 P3/700 / 2 GB Mem ) We have a problem with a stored procedure... -
Cannot execute dynamic query in stored procedure
Hi, I'm using ADO.NET to execute a stored proc. The stored proc contains a dynamic sql which will build the INSERT or UPDATE statement for... -
How can I execute a stored procedure in .net?
Hello all, Is there anyone who can tell me how to execute a stored procedure in .net. More detailed, I want to pass some parameters to the... -
Aaron Bertrand [MVP] #2
Re: Problem with execute to make a stored procedure
CREATE PROCEDURE PROC_22_
You seem to be confusing the functionality of procedures with that of> RETURNS
functions.
Aaron Bertrand [MVP] Guest
-
Cecil Westerhoff #3
Re: Problem with execute to make a stored procedure
On Fri, 27 Feb 2004 14:08:02 -0500, Aaron Bertrand [MVP] wrote:
As said, it is only code from someone else that I have to maintain. But> CREATE PROCEDURE PROC_22_>>> RETURNS
> You seem to be confusing the functionality of procedures with that of
> functions.
that is not the problem, because if I use the exact same code in IBConsole
it is executed without a problem. So there goes something wrong in
ASP/ADO.
Cecil Westerhoff Guest
-
Bob Barrows #4
Re: Problem with execute to make a stored procedure
Cecil Westerhoff wrote:
What is IBConsole? it sounds as if you are not dealing with a MS SQL Server> On Fri, 27 Feb 2004 14:08:02 -0500, Aaron Bertrand [MVP] wrote:
>>>> CREATE PROCEDURE PROC_22_>>>>> RETURNS
>> You seem to be confusing the functionality of procedures with that of
>> functions.
> As said, it is only code from someone else that I have to maintain.
> But that is not the problem, because if I use the exact same code in
> IBConsole it is executed without a problem. So there goes something
> wrong in ASP/ADO.
database.
Hmm, now that I look more closely at the code within the procedure, it is
obviously not Transact-SQL (the brand of SQL used by MS SQL Server). Always
tell us the type and version of database you are using. It is always
relevant.
As for your ADO code, this is the correct syntax:
Since it is saying a parameter is required, your strStoredProc variable may> oDbConn.Execute strStoredProc, , adExecuteNoRecords
not contain the the sql statement you think it contains. Do a:
Response.Write strStoredProc
and verify that the statement in the variable is correct when written to the
browser window.
If it is correct, you should be able to copy and paste it from the browser
window into IBConsole and execute it without modification.
If it is not what you expect it to be, then you need to look at the vbscript
code used to build the statement. If you can't figure out what is wrong with
the vbscript, post the result of the Response.Write and the vbscript code so
we can take a look at it.
If this does not provide your solution, you may need to ask this question on
a newsgroup devoted to whatever database you are using.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Bob Barrows #5
Re: Problem with execute to make a stored procedure
Cecil Westerhof wrote:
I don't know. Jet (Access) does not allow batched queries. Maybe Firebird> The statement I got from writing to the browser window. Executing into
> IBConsole works okay. So that is the problem. In the Console it
> executes without a problem, but not from ASP.
>
>
>
> The code first creates two views and then the stored procedure. It
> creates the views with two seperate executes and with the thirth the
> stored procedure should be created. When I copy paste the code it
> goes allright. Could the problem be that it is done in three steps?
> In IBConsole it is done in one step.
>
doesn't support them as well. Perhaps IBConsole is doing things behind the
scenes to allow you to batch your queries, things that ADO does not know to
do. Are you able to run other batched queries? Is this the only set of
queries that gives you a problem when run as a batch?
My next step in this debug process would be to run each query individually
in an attempt to discover which one was creating the problem. If they run
fine individually, then you have your answer: execute them individually.
Perhaps you need to get a different/newer OLEDB provider, or ODBC driver. A
Google search using the keywords Firebird and ADO reveals some links to
sites offering OLEDB providers for Firebird:
[url]http://groups.google.com/groups?q=ADO+Firebird&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=0&sa=N[/url]
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Cecil Westerhof #6
Re: Problem with execute to make a stored procedure
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:u07DjE3$DHA.3536@tk2msftngp13.phx.gbl...to> I don't know. Jet (Access) does not allow batched queries. Maybe Firebird
> doesn't support them as well. Perhaps IBConsole is doing things behind the
> scenes to allow you to batch your queries, things that ADO does not knowI checked the code and this is the only place where a stored procedure is> do. Are you able to run other batched queries? Is this the only set of
> queries that gives you a problem when run as a batch?
used. It looks like it that the original coder made something that he
thought would work, but never bothered to check it.
A> Perhaps you need to get a different/newer OLEDB provider, or ODBC driver.[url]http://groups.google.com/groups?q=ADO+Firebird&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=0&sa=N[/url]> Google search using the keywords Firebird and ADO reveals some links to
> sites offering OLEDB providers for Firebird:
>
Maybe that is the best idea. The only problem could be that the application
has to be installed by many customberes and this would increase the price.
But that is someone's else decision.
Thanks for the help.
Cecil Westerhof Guest
-
Cecil Westerhof #7
Re: Problem with execute to make a stored procedure
"Bob Barrows" <reb01501@NOyahoo.SPAMcom> wrote in message
news:u07DjE3$DHA.3536@tk2msftngp13.phx.gbl...A> Perhaps you need to get a different/newer OLEDB provider, or ODBC driver.[url]http://groups.google.com/groups?q=ADO+Firebird&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=0&sa=N[/url]> Google search using the keywords Firebird and ADO reveals some links to
> sites offering OLEDB providers for Firebird:
>
We installed another driver and now it works.
Thanks.
Cecil Westerhof Guest



Reply With Quote

