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

  • Home
  • SEARCH
  • 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 6619295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:56:53+00:00 2026-05-25T20:56:53+00:00

SQL> CREATE or REPLACE FUNCTION custord (custNo IN number) 2 RETURN NUMBER 3 IS

  • 0
 SQL> CREATE or REPLACE FUNCTION custord (custNo IN number)
 2     RETURN NUMBER
 3     IS cust_tot NUMBER(11,2);
 4     BEGIN
 5        SELECT sum(cust_total_field)
 6        INTO cust_tot
 7        FROM ord
 8        WHERE cust_number_field=custNo;
 9        RETURN(cust_tot);
 10      END;
 11  /

 Warning: Function created with compilation errors.

 SQL> begin
  2    dbms_output.put_line('customer 102 total is ' || custord(102));
  3  end;
  4  /
  dbms_output.put_line('customer 102 total is ' || custord(102));
                                                    *
  ERROR at line 2:
  ORA-06550: line 2, column 52:
  PLS-00905: object CIS605.CUSTORD is invalid
  ORA-06550: line 2, column 3:
  PL/SQL: Statement ignored


  SQL>

I see the error but object cis605 is valid. Any ideas what I am missing?

Using the ORD table create a stored function called custord that will use a customer id (CUSTID) that will return the sum of the specified customer id TOTAL field.
When your function has been stored run the following SQL:
begin
dbms_output.put_line(‘customer 102 total is ‘ || custord(102));
end;

Your output should look like:
Results
Explain
Describe
Saved SQL
History

customer 102 total is 27775.5

Statement processed.

  • 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-25T20:56:53+00:00Added an answer on May 25, 2026 at 8:56 pm

    Try

    SHOW ERRORS FUNCTION custord
    

    Your custord function was created with compilation errors, so there is something wrong with it. This is why you’re getting the object CIS605.CUSTORD is invalid error.

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

Sidebar

Related Questions

The following T/SQL:- create table #temp(foo varchar(10)) insert into #temp select '' insert into
I got some SQL function CREATE OR REPLACE FUNCTION tools.update_company(IN company_id integer, OUT value
We have a function written in pl/sql(oracle) as below: CREATE OR REPLACE PROCEDURE folder_cycle_check
I have a sql function in oracle create or replace function testfunc..... Compile it
create or replace function gen.sample_func(owner varchar2) return varchar2 as data_t varchar2(10); cursor cur is
Consider this T-SQL: CREATE USER my_test_user WITHOUT LOGIN; SELECT USER_NAME(), USER, SUSER_SNAME(),SYSTEM_USER, suser_name(); EXECUTE
I have the following scalar function in MS SQL 2005: CREATE FUNCTION [dbo].[Distance] (
On Pavel's page is the following function: CREATE OR REPLACE FUNCTION makedate(year int, dayofyear
I have a function defined inside an Oracle package: CREATE OR REPLACE PACKAGE BODY
PostgreSQL 8.4 on Linux. I have a function: CREATE OR REPLACE FUNCTION production.add_customer (

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.