|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
Quote:
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; |
|
#4
|
|||
|
|||
|
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! |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > select query, an error! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|