Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Queries "00904. 00000 - "%s: invalid identifier"

Hi I have the following code

SELECT  entertainer_id,
        entertainer_groupname
FROM    casestudy_entertainer
INNER JOIN casestudy_availability ON 
casestudy_entertainer.entertainer_id 
     = CASESTUDY_AVAILABILITY.AVAILABILITY_ENTERTAINERID
INNER JOIN casestudy_calendardates ON 
CASESTUDY_AVAILABILITY.AVAILIBILITY_CALENDARDATEID 
     =  casestudy_calendardates.calendar_Id
WHERE   entertainer_type = '&Entertainer_TYPE' 
AND     casestudy_calendardates.calendar_date = '&Event_date'

And I don't seem to be able to figure out what its not liking when I run this. It gives me the following error

ORA-00904: "CASESTUDY_AVAILIBILITY"."AVAILIBILITY_CALENDARDATEID": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause:
*Action: Error at Line: 7 Column: 4

I do have all the tables in place with all the correct rows. The only thing is I have no data as of yet, Could this possibly be the issue?

like image 681
Jonathan Steward Avatar asked Mar 20 '26 08:03

Jonathan Steward


1 Answers

You should try the lower case for the table/column identifiers(like in from/inner join clauses):

SELECT  entertainer_id,
        entertainer_groupname
FROM    casestudy_entertainer
INNER JOIN casestudy_availability ON casestudy_entertainer.entertainer_id = casestudy_availability.availability_entertainerid
INNER JOIN casestudy_calendardates ON casestudy_availability.availibility_calendardateid = casestudy_calendardates.calendar_id
WHERE entertainer_type = '&Entertainer_TYPE'
  AND casestudy_calendardates.calendar_date = '&Event_date'
like image 188
potashin Avatar answered Mar 23 '26 02:03

potashin