1

I'm trying to create new view from 2 different table of same schema. This is my query, let me know if I'm missing anything. When I check the syntax it is fine and test it, throws 00933 error.

CREATE OR REPLACE FORCE VIEW "APDA"."countview" 
        (
        "dealidint", "companyidint", "nametxt", "county", "street", 
        "state", "city", "zip", "geocodelatdec", "geocodelongdec", 
        "volidint", "reportdate", "vehicletotalint", "salvagetotalint"
         )
AS 

SELECT a."dealidint",
          a."companyidint",
          a."nametxt",
          a."county",
          a."street",
          a."state",
          a."city",
          a."zip",
          a."geocodelatdec",
          a."geocodelongdec",
          c."dealervolumeidint",
          c."reportdate",
          c."vehicletotalint",
          c."salvagetotalint"

     FROM "APDA"."company" a
     JOIN
          "APDA"."volume" c
     ON   c."dealidint" = a."dealidint";
4
  • 2
    Are your table names and column names really specified in lower case with double-quotes? If yes, then yuck. If no, then try removing the double-quotes (preferred) or putting all names in upper case. Commented Jul 21, 2018 at 2:00
  • How is the CREATE OR REPLACE VIEW being executed? If you're using some kind of client-server connection, try getting rid of the trailing semicolon on the CREATE OR REPLACE VIEW. Commented Jul 21, 2018 at 2:53
  • 1
    Try running the SELECT query alone and see if it throws up any error Commented Jul 21, 2018 at 5:15
  • If you are using SQL*Plus, then the empty lines will act as a statement delimiter. Commented Jul 21, 2018 at 10:10

4 Answers 4

0

I don't see the reason. The only suspect thing I notice is the two blank lines. In SQLPlus I don't think these would cause this error, but they would cause the command to be misinterpreted.

My suggestions are: - try a different tool. If you are getting the error in SQL Developer, try it in SQLPlus. It won't necessarily work, but you might get different feedback. - reduce it to a minimal statement that works, then add elements back in one at a time until the error occurs

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your comments.. .OK will try and revert. Infact, we have a similar view syntax and it is working. When I tried the similar working view and try to test that, throws an error. It is really weird. Have to dig deep ..
0

your column name "volidint" not in selected column, i see "dealervolumeidint" select vs "volidint".

2 Comments

It was my typo.. I had to scrub some of the columns with a diff name.
In any case, the column names projected by the view don't need to match the column names being selected. That's the point of being able to specify column names for the view.
0

Column name "volidint" is not available in your below select query. Please correct that by using "As".

CREATE OR REPLACE FORCE VIEW "APDA"."countview" 
        (
        "dealidint", "companyidint", "nametxt", "county", "street", 
        "state", "city", "zip", "geocodelatdec", "geocodelongdec", 
        "volidint", "reportdate", "vehicletotalint", "salvagetotalint"
         )
AS 

SELECT a."dealidint",
          a."companyidint",
          a."nametxt",
          a."county",
          a."street",
          a."state",
          a."city",
          a."zip",
          a."geocodelatdec",
          a."geocodelongdec",
          c."dealervolumeidint" as "volidint",
          c."reportdate",
          c."vehicletotalint",
          c."salvagetotalint"

     FROM "APDA"."company" a
     JOIN
          "APDA"."volume" c
     ON   c."dealidint" = a."dealidint";

1 Comment

The alias in the select list is irrelevant if a column list is specified in the create view part. Plus: this was already mentioned by Yakamuz.
0

Thanks to all you pitched to answer my query. The one I have shared is a stripped down query with the same syntax. The query was fine but my actual query has an extra character on the join. Which is like - "APDA"."vvolume".

After that I was able to create the view.

Thanks again.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.