SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL 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 ASP Free Forums Sponsor:
  #1  
Old February 5th, 2001, 02:48 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
SQL statement that doesn't work

<i><b>Originally posted by : Nicolas (pub@nicolasbillaude.com)</b></i><br /><br />Hi,<br /><br />Usually, to find a recordset on databases I use a "SQL - LIKE" statement like this :<br /><br />mysql = "SELECT * FROM [abonnement] WHERE theme LIKE " & guil & pad & oForm("domaine") & pad & guil & ";"<br /><br />with : <br /> guil = Chr(39) ie ' <br /> pad = "%%"<br /><br />and it works very well. But now, I would like to change the statement like this :<br /><br />mysql = "SELECT * FROM [abonnement] WHERE theme = '" & oForm("domaine") "';"<br /><br />and the statement doesn't work at all.<br /><br />Is there someone than can help me ?<br /><br />Thanx in advance<br /><br />Nicolas<br />------------------------------<br />Nicolas Billaudé<br />http://www.nicolasbillaude.com

Reply With Quote
  #2  
Old February 9th, 2001, 01:52 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 23
<i><b>Originally posted by : Ajit Anand (ajitanand@usa.net)</b></i><br />Hi!<br /><br />What you have done is, that you have restricted the resultset only to those that exactly match the search criteria. In the prev. query you were using a like clause, which says :<br /><br /> select * from table where name like '%%value%%';<br /><br />It would fetch records like '12value12', '01value10', 'abvalueaa', 'value', 'novalue',<br />and many permutaions and combinations, i.e. replacing the '%' signs with all possible characters(including empty character '' and blank spaces ' '). This means if your db has records which are at 5 - 9 characters <br />(length('value') + 4 '%' signs = 9 characters) and has the string 'value' in between the records are selected.<br /><br />Now your query is something like :<br /><br /> select * from table where name = 'value';<br /><br />It will fetch only one record that will match the strings with an exact value of 'value'.<br /><br />If my point is not clear you may E-mail me so that I can elaborate more on this...<br />Bye!<br />-Ajit<br /><br /><br /><br /><br /><br /><br />------------<br />Nicolas at 2/5/2001 11:48:10 AM<br /><br /><br />Hi,<br /><br />Usually, to find a recordset on databases I use a "SQL - LIKE" statement like this :<br /><br />mysql = "SELECT * FROM [abonnement] WHERE theme LIKE " & guil & pad & oForm("domaine") & pad & guil & ";"<br /><br />with : <br /> guil = Chr(39) ie ' <br /> pad = "%%"<br /><br />and it works very well. But now, I would like to change the statement like this :<br /><br />mysql = "SELECT * FROM [abonnement] WHERE theme = '" & oForm("domaine") "';"<br /><br />and the statement doesn't work at all.<br /><br />Is there someone than can help me ?<br /><br />Thanx in advance<br /><br />Nicolas<br />------------------------------<br />Nicolas Billaudé<br />http://www.nicolasbillaude.com

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > SQL statement that doesn't work


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 6 hosted by Hostway
Stay green...Green IT