Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2003, 02:15 PM
Authorized User
 
Join Date: Nov 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Records not returned with where clause

Hi,

I am creating a temporary table into which I am passing data from a table so as to page through the results, if I removed the where clause all values are returned but if I add a where clause then no records are returned?

I have run the query in sql and it works fine, I have done a response.write within the asp code so I know the value is being passed into the procedure parameter, the problem is it is as if it is getting lost somewhere during the procedure.

This is the stored procedure:

CREATE TABLE #CILTempItems
(
    myID INT IDENTITY,
    row_id INT,
    NETWORK_ID VARCHAR(3),
    NODE_ID VARCHAR(5),
    CORP_ID VARCHAR(10),
    EMP_ID VARCHAR(10),
    CIL_ID VARCHAR(20),
    CIL_TYPE VARCHAR(1),
    CIL_KEY VARCHAR(10),
    CIL_DESC VARCHAR(20),
    CIL_BILL_FLAG VARCHAR(1),
    RENTAL VARCHAR(1),
    START_DATE datetime,
    END_DATE datetime,
    username VARCHAR(50),
    action_date datetime,
    user_action CHAR(1)


)


-- Insert the rows from tblItems into the temp. table


INSERT INTO #CILTempItems (row_id,NETWORK_ID,NODE_ID,CORP_ID,EMP_ID,CIL_ID,C IL_TYPE,CIL_KEY,CIL_DESC,CIL_BILL_FLAG,RENTAL,STAR T_DATE,END_DATE,username,action_date,user_action)

SELECT* FROM Employee_CIL WHERE NETWORK_ID = @NID




and this is the code in the asp page:

strSQL = "dbo.employee_cil_page " & currentPage & "," & iRecordsPerPage & "," & request("nid") & "," & request("cid") & "," & request("emp")
objRS.Open strSQL, objConn

As I say it works fine without the where clause so maybe the problem lies in trying to use it on a temp table.

Thanks for any help

Peter


 
Old December 3rd, 2003, 09:55 AM
Registered User
 
Join Date: Nov 2003
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ramanuj Send a message via Yahoo to Ramanuj
Default

Quote:
quote:Originally posted by Ramanuj
 USE correct matches;
TRY "SELECT <<fieldname1, fieldName2> FROM
TABLENAME where <<condition>>"
 
Old December 4th, 2003, 10:03 AM
Authorized User
 
Join Date: Nov 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Ramanuj,

I did in fact work out what i was doing wrong, I was passing the values into the SP as integers not strings that is why it returned no records.

Thabks again
Peter






Similar Threads
Thread Thread Starter Forum Replies Last Post
no records returned when trying to insert data ronny Classic ASP Databases 1 February 2nd, 2006 12:22 PM
OCIEnvCreate returned -1 amagoosla ADO.NET 3 June 9th, 2005 06:27 AM
Returned Error chuck BOOK: Beginning VB.NET Databases 6 February 13th, 2005 04:07 PM
Inserting Returned Records hugh@kmcnetwork.com SQL Language 2 November 4th, 2003 01:05 PM
Limited 1000 records returned from Active Directoy LPetras .NET Web Services 0 July 30th, 2003 09:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.