Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Need Help On MS SQL Stored Procedure


Message #1 by "Eduardo Bezerra" <edubez@v...> on Wed, 17 May 2000 21:50:16
No. It doesn't work.

I can create the parameters or use refresh and
the result still the same.


----- Original Message -----
From: "madhu_m m" <mmadhu_m@h...>
To: "sql language" <sql_language@p...>
Sent: Monday, May 22, 2000 8:03 AM
Subject: [sql_language] Re: Need Help On MS SQL Stored Procedure


> in the parameters collection append the outparameter and after execution
of
> the stored procedure. Access the value of the parameter
> It should work!
> madhu
>
> >From: "Eduardo Bezerra" <edubez@v...>
> >Reply-To: "sql language" <sql_language@p...>
> >To: "sql language" <sql_language@p...>
> >Subject: [sql_language] Re: Need Help On MS SQL Stored Procedure
> >Date: Sat, 20 May 2000 21:45:54 -0300
> >
> >Hi
> >
> >Take a look at the code below. I think I found the
> >problem. It seens to be ADO related.
> >
> ><%@ Language=VBScript %>
> ><%
> >Dim Cmd
> >Dim Rs
> >
> >Const adCmdStoredProc = 4
> >Set Cmd = Server.CreateObject("ADODB.Command")
> >
> >Cmd.ActiveConnection = strConn    'Connection string to SQL server
> >
> >Cmd.CommandText = "usp_SPWithOutputParameter"
> >Cmd.CommandType = adCmdStoredProc
> >
> >Cmd.Parameters.Refresh
> >
> >Set Rs = Cmd.Execute    ' This assignment is the problem
> >
> >Recs = Cmd.Parameters("@OutValue")
> >Set Cmd = Nothing
> >%>
> >
> >If I remove the { Set Rs = } assignment like this:
> >Cmd.Execute
> >
> >I can get the output value @OutValue.
> >
> >Do you have any uggestions ?
> >TIA, Eduardo
> >
> >
> >----- Original Message -----
> >From: "madhu_m m" <mmadhu_m@h...>
> >To: "sql language" <sql_language@p...>
> >Sent: Saturday, May 20, 2000 02:41 AM
> >Subject: [sql_language] Re: Need Help On MS SQL Stored Procedure
> >
> >
> > > in a stored procedure u can have as many sql queries as u want.
> > > In your jscript code, u must be using the ADO.command object to fire
the
> > > stored procedure, create the output parameter
> > > set obj=createboject(ado.command)
> > > obj.commanttext="Name"
> > >
> > > i am just mentioning the main parameters, not in exact sequence
> > > obj.parameters.append obj.createparameter 'RecordCount',adcmdoutput
> > > obj.commandtype=adcmdtext
> > > obj.execute
> > > RecCount=obj.parameters("RecordCount")
> > >
> > > In the Stored procedure, u can use the count(*) sql to get the record
> >count.
> > > This should work! or tell me your exact problem.
> > >
> > > Madhu
> > > >From: "Eduardo Bezerra" <edubez@v...>
> > > >Reply-To: "sql language" <sql_language@p...>
> > > >To: "sql language" <sql_language@p...>
> > > >Subject: [sql_language] Re: Need Help On MS SQL Stored Procedure
> > > >Date: Fri, 19 May 2000 13:37:28 -0300
> > > >
> > > >Hi,
> > > >
> > > >I tryied but it does not work from inside ASP and ADO
> > > >using JScript.
> > > >
> > > >It seens that I can't have more than one SELECT if I'm
> > > >going to return a value.
> > > >
> > > >
> > > >----- Original Message -----
> > > >From: "madhu_m m" <mmadhu_m@h...>
> > > >To: "sql language" <sql_language@p...>
> > > >Sent: Friday, May 19, 2000 01:02 AM
> > > >Subject: [sql_language] Re: Need Help On MS SQL Stored Procedure
> > > >
> > > >
> > > > > You can issue a
> > > > > select @RecordCount=count(*) from table where condition
> > > > > query and return the @RecordCount value as output parameter or
> >return
> > > >value.
> > > > >
> > > > >
> > > > >
> > > > > >From: "Eduardo Bezerra" <edubez@v...>
> > > > > >Reply-To: "sql language" <sql_language@p...>
> > > > > >To: "sql language" <sql_language@p...>
> > > > > >Subject: [sql_language] Need Help On MS SQL Stored Procedure
> > > > > >Date: Wed, 17 May 2000 21:50:16
> > > > > >
> > > > > >I need to create a Stored Procedure that executes a
> > > > > >SELECT statement and returns the @@ROWCOUNT value using
> > > > > >an OUTPUT parameter.
> > > > > >
> > > > > >I'm having an hard time trying to figure how to do it.
> > > > > >Can anyone give me some help ?
> > > > > >
> > > > > >TIA,
> > > > > >Eduardo
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
>
>
>

  Return to Index