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 6853867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:33:47+00:00 2026-05-27T01:33:47+00:00

I have a view. the view has a function that returns a text string

  • 0

I have a view. the view has a function that returns a text string of either “TRUE” or “FALSE” based on two criteria

The function looks at two tables.

Condition 1: The customer table contains a date field – if the system date is > the date field it should return false

Condition 2: The customer table links to a customer_detail table. there is sometimes a record in the detail table and sometimes not (so i added the outer join sytax to the query which doesn’t really do anything because the additional criteria forces an inner join I believe). There can be multiple records in the customer_detail table for each record in the customer table. if there are multiple records in the detail table I need to look at the most recent record max(uniquefield). this table has a date field. if this field is not null the function should return false regardles of the first condition.

Here is what I have. When I compile I get two errors:

SQL statment ignored – at the first line of the first select statment

and

Error(17,45): PL/SQL: ORA-00942: table or view does not exist – on the subselect of the first select

create or replace FUNCTION "F_STATUS" (
N_UNIQUE IN NUMBER)
RETURN VARCHAR2
IS
  V_TORF varchar2(20);
  D_ACTDATE date;
  D_STARTDATE date;
BEGIN
select b.startdate into D_STARTDATE
from customerdb.customer a, customerdb.customer_detail b
where a.uniquefield= b.uniquefield(+) and
b.uniquefield = N_UNIQUE and
b.uniquefield in 
  (select max(c.uniquefield) from customerdb.customer_detail c group by uniquefield);

if 
D_STARTDATE is not null
then
  V_TORF :='FALSE';
  RETURN(V_TORF);
else
  select expiredate into D_ACTDATE
  from customerdb.customer 
  where customerdb.customer.uniquefield = N_UNIQUE;
  IF 
      D_ACTDATE > SYSDATE 
      then
      V_TORF :='TRUE';
      RETURN(V_TORF);
   else
      v_TORF :='FALSE';
      RETURN(V_TORF);
   end if;
 end if;
end;
  • 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-05-27T01:33:47+00:00Added an answer on May 27, 2026 at 1:33 am

    Your procedure seems to be unable to see the table customerdb.customer_detail. This is likely due to the fact that procedures are defined without any role enabled and you probably have a role with the SELECT ANY TABLE privilege. From the security guide:

    The user who owns the procedure also must have privileges for schema objects referenced in the procedure body. To create a procedure, you need to have been explicitly granted the necessary privileges (system or object) on all objects referenced by the procedure. You cannot obtain the required privileges through roles. This includes the EXECUTE privilege for any procedures that are called inside the procedure being created.

    To see if your procedure will be able to run a query, you can test with your user after having disabled all roles with the following command:

    set role none
    

    In your case you probably need to be granted the SELECT privilege directly to your user:

    GRANT SELECT ON customerdb.customer_detail TO <your_user>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using MVC2 with VS2010 I have a view that has two partial views
I have a view that has a list of jobs in it, with data
I have a picker view that has a list of numbers to pick from.
I have an view in my App which has a number of buttons based
I have a view controller class that has to implement several protocols. Too keep
I have a navigation view with a cell that has something as simple as
I have the problem that my view controller class has too many delegates and
i have a product table which has a Title as string. inside my view
I have a jquery game that you can view here link text The game
I have a jquery game that you can view here link text The game

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.