Wrox Programmer Forums
|
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 October 26th, 2003, 07:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default Sql Query in ASP

How can use following query in ASP ?
This query run properly on sql query analyzer but When I use this query on asp it give following error.

Error Type:
Microsoft VBScript compilation (0x800A0409)
Unterminated string constant
/mtp/xl_data2a.asp, line 80, column 57
ssql="select fromnode,tonode,volume,IP,fromnode2,tonode2,
--------------------------------------------------------^

Query is:

ssql="select fromnode,tonode,volume,IP,fromnode2,tonode2, // line 80
case BOND when 'SBU' then 'SBU' else Null end as SBU,
case BOND when 'IP-1' then 'IP-1' else Null end as [IP-1],
case BOND when 'EXITSOUTHBOND' then 'EXITSOUTHBOND'
else Null end
from
(select fromnode,tonode,volume,substring(fromnode,3,2) IP,
fromnode % 10 fromnode2, tonode % 10 tonode2,
case
when FromNode%10=1 and ToNode%10=2 then 'SBU'
when substring(fromnode,3,2)=01 then 'IP-1'
when FromNode%10=7 then 'Eastbound in Excluding Right'
end BOND
from emme) emme2
ORDER BY IP"

set rs=cn.Execute(ssql)


Datatype is varchar

Mateen
 
Old October 26th, 2003, 07:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Jonax
Default

You need to have all of the sql-string on one line - is that the case?

The unterminated-error means that it can't find the closing quote, so I guess you have some line breaks - right?

 
Old October 29th, 2003, 12:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks.

Quote:
quote:Originally posted by Jonax
 You need to have all of the sql-string on one line - is that the case?

The unterminated-error means that it can't find the closing quote, so I guess you have some line breaks - right?

 
Old October 29th, 2003, 12:16 AM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Put all code in one line

What is

// line 80
 doing in there anyway?



Sal





Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP to query a SQL recursive tree chame Classic ASP Basics 4 April 10th, 2012 07:59 PM
Using ORDER BY in SQL query in ASP page saifi4u Classic ASP Databases 1 February 29th, 2008 09:19 AM
sql query in asp graph mateenmohd Classic ASP Professional 6 August 6th, 2007 01:14 AM
ASP- SQL Server..Query help.... cancer10 Classic ASP Databases 5 February 1st, 2007 06:26 AM
Sql Query Help - ASP cancer10 Classic ASP Databases 8 November 7th, 2006 03:19 PM





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