Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle 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 January 9th, 2004, 09:19 PM
weebeng weebeng is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 76 weebeng User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m
Reputation Power: 10
sql query

hi..i'm using the oracle db. The following sql quey can run in php(but returns the wrong result), but cannot run in oracle sql plus. Can someone tell me what's wrong?
Thank you!
Code:
SQL> select distinct( acav_cardno ), acch_icno, acch_accesscode, acav_cardholdername from ac_cardholder, ac_activity where trunc(acav_trxdatetime) between to_date('01-11-2003','dd-mm-yyyy') and to_date('30-11-2003','dd-mm-yyyy') and acch_cardno = acav_cardno and acav_readertype='I' order by acch_icno;
  2  ;
select distinct( acav_cardno ), acch_icno, acch_accesscode, acav_cardholdername from ac_cardholder, 
                                                                                                    
ERROR at line 1:
ORA-00933: SQL command not properly ended

Reply With Quote
  #2  
Old January 10th, 2004, 06:22 AM
shammat shammat is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Oct 2003
Location: Germany
Posts: 2,685 shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level)shammat User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Month 3 Weeks 3 Days 19 h 53 m 20 sec
Reputation Power: 284
Looks like you have two ; in your statement? Leave out the second one, or leave them out completely and try to terminate the query with / (in SQL*Plus)

Reply With Quote
  #3  
Old January 10th, 2004, 08:24 PM
weebeng weebeng is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 76 weebeng User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m
Reputation Power: 10
actually it cannot work. when i put first ";" and press enter, the oracle sql query seek waiting the input from me. so i put the second ";" and the error messages come out.
Here I have try the simply sql. and it can work.
Quote:
select acav_cardno, acav_cardholdername, acch_icno, acch_accesscode from ac_cardholder, ac_activity where acch_cardno = acav_cardno and trunc(acav_trxdatetime) between to_date('01-11-2003', 'dd-mm-yyyy') and to_date('30-11-2003', 'dd-mm-yyyy');


but when i try(as follow, i added the "acav_readertype = 'I'"), the error message come out said "ERROR at line 2:
ORA-00936: missing expression"
Quote:
select acav_cardno, acav_cardholdername, acch_icno, acch_accesscode from ac_cardholder, ac_activity where acch_cardno = acav_cardno and acav_readertype = 'I' and trunc(acav_trxdatetime) between to_date('01-11-2003', 'dd-mm-yyyy') and to_date('30-11-2003', 'dd-mm-yyyy');


hope that u can help me. Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > sql query

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap