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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:49:13+00:00 2026-05-13T05:49:13+00:00

When does the below sql function can cause an exception other than NO DATA

  • 0

When does the below sql function can cause an exception other than NO DATA FOUND?
v_ExchangeRate is of type float.The datatype of rate column is NUMBER(14, 10) and this column can not contain NULL values.

BEGIN
SELECT rate
INTO v_ExchangeRate
FROM exchange_rate
WHERE currency_code = CurrencyCode
AND status        = 'A';

The data type of exchange_rate in database is NUMBER(14,10)

Edit
Multiple rows cannot be returned by the where clause as the currency_code is the primary key.

  • 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-13T05:49:13+00:00Added an answer on May 13, 2026 at 5:49 am

    Possible exceptions (not an exhaustive list by any means):

    1) ORA-00942: table or view does not exist

    declare
      var integer;
    begin
      select 1 into var from nosuchtable;
    end;
    

    2) ORA-06502: PL/SQL: numeric or value error: character to number conversion error

    declare
      var integer;
    begin
      select 'x' into var from dual;
    end;
    

    3) ORA-06502: PL/SQL: numeric or value error: character string buffer too small

    declare
      var varchar2(1);
    begin
      select 'xx' into var from dual;
    end;
    

    4) ORA-01722: invalid number

    SQL> create table t1 (n1 number);
    
    Table created.
    
    SQL> insert into t1 values (1);
    
    1 row created.
    
    SQL> declare
      2    var varchar2(1);
      3  begin
      4    select 'x' into var
      5    from t1 where n1 = 'y';
      6  end;
      7  /
    declare
    *
    ERROR at line 1:
    ORA-01722: invalid number
    ORA-0512: at line 4
    

    Can you not create a copy of the function, remove the WHEN OTHERS part, and test it in SQL Plus or an IDE to see what exception you get?

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

Sidebar

Related Questions

Can any one tell what does below given lines means? The lines below are
What does the below JavaScript mean? Why is the function embedded inside ()? (function()
I am looking for a SQL Server function that I can supply 3 primary
I am currently using below function to sanitize my $_POST and $_GET against SQL
I found that my DB.sql has error shown below, i did not process it
The below does not compile: Func<int, int> fac = n => (n <= 1)
The routine below does two scans over an input stream of hypertext. The first
Why does the below code give Seg. Fault at last line? char* m=ReadName(); printf(\nRead
What does the below query explain? SELECT * FROM `jos_menu` WHERE (id = 69
Why does this graphml file below does not render the node color properly in

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.