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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:56:06+00:00 2026-06-10T00:56:06+00:00

I want to know the correct way to use nested functions in PLSQL. In

  • 0

I want to know the correct way to use nested functions in PLSQL. In the following snippet the function ‘to_number’ works fine, but my two nested functions can’t be used in the same manner.

Declare
  Tettt Number;
  Function lolazo(pigt Number, p_Fecha_Fact Date)
  Return Number Is
    resultado number;
  Begin
    Select Vp.Valor
    into resultado
    from valor_precio vp
    Where Vp.Id_Tipo_Cargo = 103
      And Vp.Id_Grupo_Precio = pigt
      and vp.f_inicio_precio =
        (select max(vp2.f_inicio_precio)
         From Valor_Precio Vp2
         Where Vp2.Id_Grupo_Precio = pigt
           And Vp2.F_Inicio_Precio < p_fecha_fact
           And Vp2.Id_Tipo_Cargo = 103 );
    Return Resultado;
  End Lolazo;
  Function Multi(Uno Number, Dos Number) Return Number Is
  Begin
    return uno*dos;
  End Multi;
Begin
  Select to_number('123')
  Into Tettt
  From Dual;

--  Doesn't work!
--  Select lolazo(1544, to_date('01/01/2011','dd/mm/yyyy')) 
--  Into Tettt
--  From Dual;

--  Doesn't work!
--  select Multi(2,3) into Tettt from dual;

Dbms_Output.Put_Line(lolazo(1544, to_date('01/01/2011','dd/mm/yyyy')));
Dbms_Output.Put_Line(Multi(2,3));
dbms_output.put_line(Tettt);
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-06-10T00:56:07+00:00Added an answer on June 10, 2026 at 12:56 am

    Your functions can’t be used in SQL, so DO NOT: select into some_variable from dual.

    Try using an assignment:

    Tettt := Multi(2,3);
    

    Also, post your errors from your script (instead of saying doesn’t work). Much easier for us to see the actual issue.

    If you really wanted to use these functions from SQL, you’d have to expose them to the SQL engine (outside of the PL/SQL world in which your anonymous block resides). This would typically involve creating separate stored procedures or defining them in some package specification.

    Hope that helps.

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

Sidebar

Related Questions

I'm want to know how's correct way to use Xml in sdk for web
I want to know is below code correct ? I have following code which
I want to know the correct way to structure ajax views in django. say
I want to know, when using conditional comments, what is the correct way (pay
Ok, i wish to know the correct way to build forms in JSF. I
this is a simple html question but I would like to know the correct
What is the correct way of removing a component I know I'm not going
I use Django for my website and I want to know whether there is
i want know how i can manage multiple twitter account on iOS in my
i want know if is possible, to get a specific element value of a

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.