Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 March 13th, 2005, 10:20 AM
paulh1983 paulh1983 is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2004
Posts: 1,249 paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 14 h 18 m 20 sec
Reputation Power: 17
select query, an error!

Code:
Declare
	Cursor c_sales is
Select ol.product_id, quantity, unit_cost, unit_price, client_id, sr_id, order_date 
From ord1 o,orderline ol,product2 p,salesrep sr
Where ol.product_id = p.product_id
 And    ol.order_id = o.order_id//error 1
 And    o.client_id = sr.sr_id;
	Cursor c_rec is
		  Select quantity, unitprice, clientid, product_id,sr_id
  From orderline ol, product2 p, client_visit cv,   
  salesrep sr, ord1
		  Where p.product_id = ol.product_id
     		  And    ol.order_id=ord1.order_id
		  And    ord1.sales_rep_id =  sr.sr_id;

unless i am blind, i cannot see an error on here can you? error at line 6 and 17!
line 17 = from keyword not found where expected!

does having tabs between words effect the outcome?

Reply With Quote
  #2  
Old March 14th, 2005, 01:35 AM
suresh1977 suresh1977 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 13 suresh1977 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 16 m 57 sec
Reputation Power: 0
No problems with the syntax, check the datatypes of columns you are trying to join... if they are different then that might be giving you the error.

Reply With Quote
  #3  
Old March 15th, 2005, 08:38 PM
merl merl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 51 merl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 34 sec
Reputation Power: 7
Quote:
Originally Posted by paulh1983
Code:
Declare
	Cursor c_sales is
Select ol.product_id, quantity, unit_cost, unit_price, client_id, sr_id, order_date 
From ord1 o,orderline ol,product2 p,salesrep sr
Where ol.product_id = p.product_id
 And    ol.order_id = o.order_id//error 1
 And    o.client_id = sr.sr_id;
	Cursor c_rec is
		  Select quantity, unitprice, clientid, product_id,sr_id
  From orderline ol, product2 p, client_visit cv,   
  salesrep sr, ord1
		  Where p.product_id = ol.product_id
     		  And    ol.order_id=ord1.order_id
		  And    ord1.sales_rep_id =  sr.sr_id;

unless i am blind, i cannot see an error on here can you? error at line 6 and 17!
line 17 = from keyword not found where expected!

does having tabs between words effect the outcome?


Try to isolate the problem by just running the query that appears to be erroring.

Also, when listing some columns with aliases, I usually try to list all columns that way. e.g.

Code:
Select ol.product_id, o.quantity, o.unit_cost, o.unit_price, o.client_id, sr.sr_id, o.order_date 
From product2 p, orderline ol,ord1 o,salesrep sr
Where ol.product_id = p.product_id
 And    o.order_id = ol.order_id
 And    sr.sr_id = o.client_id;

Reply With Quote
  #4  
Old March 16th, 2005, 11:33 AM
paulh1983 paulh1983 is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Dec 2004
Posts: 1,249 paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level)paulh1983 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 14 h 18 m 20 sec
Reputation Power: 17
cheers it was my probelm actually if i hd just given you all of the trigger you/someone would have spotted the answer straight away!

the actual trigger was:
for C_rec in C_sales.

and i thought C_REC was another cursor when it was the record/result gottn from c_sales!

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > select query, an error!


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