jakeyoung Posted December 7, 2005 Share Posted December 7, 2005 Please Help.I am trying to create a view in SQL but when I execute it I get the following message ORA-00904: "INTEREST": invalid identifier I have put my code in below, maybe someone could point me in the right direction.Enter statements:create view InterestForm (Property, Address, Type, Price, aDate, SalesPerson, InterestLevel, Vendor) asselect Property_Number, vAddress_Line1, Type, Price, Appt_Date, sName, interest, vSurnamefrom Property, Sales_Staff, Vendor; select Property_Number, vAddress_Line1, Type, Price, Appt_Date, sName, interest, vSurname *ERROR at line 2: ORA-00904: "INTEREST": invalid identifier Link to comment Share on other sites More sharing options...
maelstorm Posted December 7, 2005 Share Posted December 7, 2005 The error ORA-00904 means that there is no such field "INTEREST", just check ur tables if it has any field by that name. Link to comment Share on other sites More sharing options...
maelstorm Posted December 7, 2005 Share Posted December 7, 2005 The error ORA-00904 means that there is no such field "INTEREST", just check ur tables if it has any field by that name. Link to comment Share on other sites More sharing options...
Kcarson Posted December 8, 2005 Share Posted December 8, 2005 Out of curiosity, are you not joining on a particular field? As of right now, you are doing a join with a number of rows equal to (rows in Property) x (Rows in Sales_Staff) x (rows in Vendor), which unless all three tables are very small means your view is going to return a lot of rows. Just noticed and thought I would mention it. Link to comment Share on other sites More sharing options...
Kcarson Posted December 8, 2005 Share Posted December 8, 2005 I am trying to create a view in SQL but when I execute it I get the following message ORA-00904: "INTEREST": invalid identifier ...select Property_Number, vAddress_Line1, Type, Price, Appt_Date, sName, interest, vSurname *ERROR at line 2: ORA-00904: "INTEREST": invalid identifier<{POST_SNAPBACK}> By the way, try this:SELECT *FROM InterestForm When you are trying to execute the view, you are not calling it properly. A view is essentially a new table as far as you are concerned (for querying purposes). The columns are: Property, Address, Type, Price, aDate, SalesPerson, InterestLevel, Vendorand the view is named InterestFormIn your query to execute the view, you did not list a FROM and you listed columns that are not in your view (at least not with those labels).I am not sure why it picked INTEREST to makr as invalid identifier, but oh well. Let me know if the above works and if you have any questions about it. Link to comment Share on other sites More sharing options...
jakeyoung Posted December 8, 2005 Author Share Posted December 8, 2005 By the way, try this:SELECT *FROM InterestForm When you are trying to execute the view, you are not calling it properly. A view is essentially a new table as far as you are concerned (for querying purposes). The columns are: Property, Address, Type, Price, aDate, SalesPerson, InterestLevel, Vendorand the view is named InterestFormIn your query to execute the view, you did not list a FROM and you listed columns that are not in your view (at least not with those labels).I am not sure why it picked INTEREST to makr as invalid identifier, but oh well. Let me know if the above works and if you have any questions about it. <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
jakeyoung Posted December 8, 2005 Author Share Posted December 8, 2005 <{POST_SNAPBACK}> Thanks very much, I'll give that a go.CheersJake Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now