Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8266043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:01:03+00:00 2026-06-08T05:01:03+00:00

I got this Oracle view: CREATE OR REPLACE VIEW VALIDA_CADVEN_VIEW (SETOR_INI, NOME_REP_INI, RE_REP_INI, TARGET_REP_INI,

  • 0

I got this Oracle view:

CREATE OR REPLACE VIEW "VALIDA_CADVEN_VIEW" ("SETOR_INI", "NOME_REP_INI", "RE_REP_INI", "TARGET_REP_INI", "SETOR_FIM", "NOME_REP_FIM",
                                                "RE_REP_FIM", "TARGET_REP_FIM", "Situacao", "Causa") AS 
SELECT I.SETOR, I.NOME_REP, I.RE_REP, I.TARGET_REP,
        F.SETOR, F.NOME_REP, F.RE_REP, F.TARGET_REP, 'Não existe no arquivo atual' Situacao, 'Arquivo' Causa
FROM ZCADVEN_INI I 
LEFT JOIN (SELECT * FROM ZCADVEN_FIM WHERE RE_REP IS NOT NULL ) f
ON I.RE_REP = F.RE_REP
WHERE F.RE_REP IS NULL
AND I.RE_REP IS NOT NULL

UNION

SELECT I.SETOR, I.NOME_REP, I.RE_REP, I.TARGET_REP,
        F.SETOR, F.NOME_REP, F.RE_REP, F.TARGET_REP, 'Não existe no arquivo anterior' Situacao, 'Arquivo' Causa
FROM ZCADVEN_FIM F 
LEFT JOIN (SELECT * FROM ZCADVEN_INI WHERE RE_REP IS NOT NULL ) I
ON I.RE_REP = F.RE_REP
WHERE I.RE_REP IS NULL
AND F.RE_REP IS NOT NULL

UNION

SELECT I.SETOR, I.NOME_REP, I.RE_REP, I.TARGET_REP,
        F.SETOR, F.NOME_REP, F.RE_REP, F.TARGET_REP, 'Há divergências' Situacao, 'Target' Causa
FROM ZCADVEN_FIM F 
INNER JOIN (SELECT * FROM ZCADVEN_INI WHERE RE_REP IS NOT NULL ) I
ON I.RE_REP = F.RE_REP
WHERE I.TARGET_REP <> F.TARGET_REP

UNION


SELECT I.SETOR, I.NOME_REP, I.RE_REP, I.TARGET_REP,
        F.SETOR, F.NOME_REP, F.RE_REP, F.TARGET_REP, 'Há divergências' SITUACAO, 'Nome' CAUSA
FROM ZCADVEN_FIM F 
INNER JOIN (SELECT * FROM ZCADVEN_INI WHERE RE_REP IS NOT NULL ) I
ON I.RE_REP = F.RE_REP
WHERE I.NOME_REP <> F.NOME_REP

UNION

SELECT I.SETOR, I.NOME_REP, I.RE_REP, I.TARGET_REP,
        F.SETOR, F.NOME_REP, F.RE_REP, F.TARGET_REP, 'Há divergências' Situacao, 'Setor' Causa
FROM ZCADVEN_FIM F 
INNER JOIN (SELECT * FROM ZCADVEN_INI WHERE RE_REP IS NOT NULL ) I
ON I.RE_REP = F.RE_REP
WHERE I.SETOR <> F.SETOR

UNION

SELECT I.SETOR, I.NOME_REP, I.RE_REP, I.TARGET_REP,
        F.SETOR, F.NOME_REP, F.RE_REP, F.TARGET_REP, 'OK' Situacao, '-' Causa
FROM ZCADVEN_FIM F 
INNER JOIN ZCADVEN_INI  I
ON I.RE_REP = F.RE_REP
AND I.SETOR = F.SETOR
AND I.NOME_REP = F.NOME_REP
AND I.TARGET_REP = F.TARGET_REP

Now, in certain point I need to do this simple SELECT:

SELECT CAUSA FROM VALIDA_CADVEN_VIEW

And I get this error:

ORA-00904: "CAUSA": "%s: invalid identifier"

Any ideas of what I’m doing wrong?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:01:04+00:00Added an answer on June 8, 2026 at 5:01 am

    Since you created the view with “Causa” in double quotes, case is significant. You will have to do this:

    SELECT "Causa" FROM valida_cadven_view;
    

    I would recommend you re-create your view with upper case identifiers. Either leave the double quotes off or make the identifier upper case:

    CREATE OR REPLACE VIEW VALIDA_CADVEN_VIEW 
        (SETOR_INI, NOME_REP_INI, RE_REP_INI, TARGET_REP_INI, SETOR_FIM
       , NOME_REP_FIM, RE_REP_FIM, TARGET_REP_FIM, Situacao, Causa) AS 
    

    or

    CREATE OR REPLACE VIEW "VALIDA_CADVEN_VIEW" 
       ("SETOR_INI", "NOME_REP_INI", "RE_REP_INI", "TARGET_REP_INI", "SETOR_FIM"
      , "NOME_REP_FIM", "RE_REP_FIM", "TARGET_REP_FIM", "SITUACAO", "CAUSA") AS 
    

    Unless you have a really compelling reason to use lower case in your identifiers, I’d recommend not using them. They are a major source of confusion, as you can see.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this stored procedure in oracle create or replace procedure mayor_sueldo as cursor
I got a bit of a problem with a Oracle query create or replace
We've got a view that's defined like this CREATE VIEW aView as SELECT *
I'm getting crazy with this problem: I have got some Oracle SQL-Reports to redesign
Got this error message while trying to load view: The model item passed into
I've got some Oracle-Views which I'm using to generate multiple Letters. For Example: CREATE
I've got this simple Oracle statement for deleting rows... but I can't get it
I've got an oracle query like this: SELECT floatColum0,floatColum1,ROUND(floatColum2,2) from table; which is returning
I got an oracle db 10g, here a table as an example create table
We've got an Oracle 11g installation that is starting to get big. This database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.