473,573 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP/ Stored Procedure Query

Hi!

I'm not sure if you can do this but what I want to do it execute a
stored procedure but query it with dynamic ASP data. Basically,

exex StoredProc where id = 2

I am using a set of dynamic data and I truly belive looping trought the
dataset would be too much overhead on the server.

Any ideas?

Thanks,
Andrew J Durstewitz

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB. NET,PHP,Java,an d SQL Support, all in one place.
Jul 19 '05 #1
4 1541
What does your SP look like? Doesn't it allow you to pass an argument to
it?

create proc YourStoredProc @theID int AS...

Ray at work

"Andrew J Durstewitz" <ad*********@mo reheadassociate s.com> wrote in message
news:3f******** *************@n ews.frii.net...
Hi!

I'm not sure if you can do this but what I want to do it execute a
stored procedure but query it with dynamic ASP data. Basically,

exex StoredProc where id = 2

I am using a set of dynamic data and I truly belive looping trought the
dataset would be too much overhead on the server.

Any ideas?

Thanks,
Andrew J Durstewitz

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB. NET,PHP,Java,an d SQL Support, all in one place.

Jul 19 '05 #2
The problem with that is I'm using a dynamic where statement. Basically
I have a loop like so...

Do While Not blah.Eof
sqlStatment = " or id=" & blah("id")
blah.MoveNext
Loop

Otherwise I could use that idea, unless there is something I am missing
about getting dynamic information into SQL.

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB. NET,PHP,Java,an d SQL Support, all in one place.
Jul 19 '05 #3
I don't understand. You already have your recordset in the code you posted
below. You aren't doing anything with the ID at that point other than
concatenating some strings.

create theStoredProc @theArg int as
select whatever from wherever where id=@theArg
<%
theID = [your source for the ID]
Set rs = yourADOConnecti on.Execute("exe c theStoredProc " & theID)
'...
%>

Ray at work

"Andrew J Durstewitz" <ad*********@mo reheadassociate s.com> wrote in message
news:3f******** *************@n ews.frii.net...
The problem with that is I'm using a dynamic where statement. Basically
I have a loop like so...

Do While Not blah.Eof
sqlStatment = " or id=" & blah("id")
blah.MoveNext
Loop

Otherwise I could use that idea, unless there is something I am missing
about getting dynamic information into SQL.

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB. NET,PHP,Java,an d SQL Support, all in one place.

Jul 19 '05 #4
Ok, I actually figured it out.

Thanks,
Andrew J Durstewitz

DEVBuilder.org, http://www.DEVBuilder.org
ASP,ASP.NET,VB. NET,PHP,Java,an d SQL Support, all in one place.
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
22115
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my application server can talk to the database. I've determined the failure occurs when the the following statement is executed: cstmt.execute(); (due...
5
7275
by: Warren Wright | last post by:
Hi group, I have a select statement that if run against a 1 million record database directly in query analyzer takes less than 1 second. However, if I execute the select statement in a stored procedure instead, calling the stored proc from query analyzer, then it takes 12-17 seconds. Here is what I execute in Query Analyzer when...
0
6689
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft Visual Basic .NET version of this article, see 308049. For a Microsoft Visual C++ .NET version of this article, see 310071. For a Microsoft Visual J#...
7
1604
by: Douglas Buchanan | last post by:
I can't seem to open SQLS2k Stored Procedures in the IDE I am running MDE 2003 Version 7.1.3088 I have a MSDN professional subscription and did a complete install of vs.net Help explains how to do it: 1. In Server Explorer, expand the Stored Procedures folder. 2. Double-click the name of the stored procedure you want to open.
10
3721
by: Thomas R. Hummel | last post by:
I have a stored procedure that suddenly started performing horribly. The query plan didn't look right to me, so I copy/pasted the code and ran it (it's a single SELECT statement). That ran pretty well and used a query plan that made sense. Now, I know what you're all thinking... stored procedures have to optimize for variable parameters, etc....
1
2561
by: Raquel | last post by:
Have a question on the Stored procedure method code generated by DB2 development center for Java stored procedures. Suppose I have a requirement to return the resultset consisting of FIRSTNME, LASTNAME of all employees belonging to a particular department, following is the stored procedure method code generated by "DB2 development center":...
2
5444
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
5
2350
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored Procedures with a data reader to add various parameters. However, if I have a stored procedure such as CREATE usp_SelectfromJobNumbers (@par1...
7
5836
by: eholz1 | last post by:
Hello PHP group, Could someone help me out? I have PHP 5.2, Apache 2.0, and MySQL 5.0 running on Linux (Redhat Fedora Core 6). All that works fine. I would like to be able to "call" a stored procedure from a PHP program, and run a stored procedure. I have yet to figure out the proper way to do this. My stored procedures work fine...
4
3373
by: aCe | last post by:
hi all, i need to convert these simple PHP code into stored procedure : <?php $result = mssql_query( "SELECT whid, whcode FROM warehouse" ); while( $wh = mssql_fetch_object( $result ) ) { $result = mssql_query( "SELECT plid, nopl FROM packlist WHERE whid = '" . $wh->whid . "'"; while( $pl = mssql_fetch_object( $result ) ) {
0
7747
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7987
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8180
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6363
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5263
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3706
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3703
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2167
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.