Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 13th, 2009, 11:33 AM
ArtJunky ArtJunky is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2006
Posts: 91 ArtJunky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 8 m 55 sec
Reputation Power: 4
Nested recordsets - Pulling in current record

Code:
<% Dim rsRecordset__name rsRecordset__name = "7-1203-4" 'default item If (Request.QueryString("current") <> "") Then    rsRecordset__name = Request.QueryString("current") End If %> <% Dim rsRecordset Dim rsRecordset_cmd Dim rsRecordset_numRows  Set rsRecordset_cmd = Server.CreateObject ("ADODB.Command") rsRecordset_cmd.ActiveConnection = MM_connShnta_STRING rsRecordset_cmd.CommandText = "{call changed.storedprocedurename(?)}"  rsRecordset_cmd.Prepared = true rsRecordset_cmd.Parameters.Append rsRecordset_cmd.CreateParameter("param1", 200, 1, 255, rsRecordset__name) ' adVarChar  Set rsRecordset = rsRecordset_cmd.Execute rsRecordset_numRows = 0 %>


The above is what is typically created when using Dreamweaver to pull in data (stored procedure).

I have one recordset that loops through a set of products.
The 2nd Recordset pulls in Product Warnings and loops through those results.

I need the 2nd to be nested inside each product.

What I don't understand is how to pull in the current record so that the 2nd recordset knows which product it's on.

EXAMPLE:
Product 1
Warning 1

Product2
no warning

Product 3
Warning 1
Warning 3
Warning 7

Reply With Quote
  #2  
Old October 25th, 2009, 11:49 PM
gregory.owen@hp gregory.owen@hp is offline
Maniac
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Location: Sweet Home, Oregon
Posts: 598 gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level)gregory.owen@hp User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 14 h 46 m 46 sec
Reputation Power: 37
Why don't you just return all of the data in a single recordset:

Product1 Warning1
Product2 NULL
Product3 Warning1
Product3 Warning3
Product3 Warning7


This would be simple to do with a left join.

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Nested recordsets - Pulling in current record


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek