ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

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 Dev Shed Forums Sponsor:
  #1  
Old July 13th, 2005, 03:50 PM
chasAFD chasAFD is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Location: Austin, Texas, USA
Posts: 4 chasAFD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 8 m 19 sec
Reputation Power: 0
Stored Proc only returns 1 record

My stored procedure selects many records, but my <cfstoredproc> only returns 1 row (and dataset.recordcount = 1).

Here's the CF
Code:
 

<cfstoredproc datasource="myDataSource" procedure="P_AllActive" returnCode="No">
<cfprocresult name = "P_All" maxrows="-1">
</cfstoredproc> 

<html>
<head>
<title>SP Test</title>
</head>

<cfoutput>
<p>Record Count: #P_All.recordCount# <p>Columns: #P_All.columnList#
<hr>
</cfoutput>

<table border=1 width=80% aligh=center>
<cfoutput query="P_All">
<tr>
<td width=30%>#P_All.PRSN_Full_Name#</td>
<td width=30%>#P_All.RANK_ID#</td>
<td width=15%>#P_All.PERS_ID#</td>
<td width=15%>#P_All.BSUN_ID#</td>
<td width=10%>#P_All.SHFT_ID#</td>
</tr>
</cfoutput> (Only 1 result row gets displayed)
</table>
</body>
</html>

===================================================
Here's the stored proc (Firebird 1.0.x, / Interbase)
Code:

CREATE PROCEDURE P_ALLACTIVE returns (
PRSN_FULL_NAME VarChar(35),
RANK_ID VarChar(12),
SHFT_ID VarChar(1),
BSUN_ID VarChar(15),
PERS_ID Integer)
AS

begin
FOR
  SELECT
  R.COMMON_NAME as PRSN_Full_Name,
  R.RANK as RANK_ID,
  R.SHIFT as SHFT_ID,
  R.COMPANY as BSUN_ID,
  R.TXFIR_ID as PERS_ID
  FROM PERSONNEL R
  JOIN COMPANIES R1 on (R1.COMPANY = R.COMPANY)
  JOIN RANKS R2 on (R2.RANK = R.RANK)
  WHERE (R.STATUS = 'A')
  ORDER BY R.COMMON_NAME
  INTO RSN_FULL_NAME,:RANK_ID,:SHFT_ID,:BSUN_ID,ERS_ID
DO
BEGIN
  SUSPEND;
END
end
======================================================
Version Info:

CFMX 6.1 (Same results with CFMX 7)
Firebird 1.0.x SuperServer (working solid for 2 yr)
JDBC driver: Jaybird (v1.5.5.Release, Class 4 JCA-JDBC)
JDK 1.4
Win XP Pro

The stored proc returns about 1000 records when executed in database admin tool (DBworkbench)
Could it be a problem with the JDBC driver? I have stored procs that return 1 value (such as a count) that work fine, I'm just having problems with returning a dataset. Any help is greatly appreciated.

Reply With Quote
  #2  
Old July 13th, 2005, 04:13 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
hmmm, not sure what to tell you because it certainly works correctly calling a SQL Server stored procedure. Maybe it is a JDBC driver issue, or an issue with the way the datasource in configured?


<cfstoredproc procedure="proc_List_t_Employer" datasource="#Application.dbDSN#" username="#Application.dbUsername#" password="#Application.dbPassword#">

<cfprocresult name="List_t_Employer" resultset="1">

</cfstoredproc>

(works fine for a SQL Server proc)
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Stored Proc only returns 1 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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT