Can we put procedure in a function?

Can we put procedure in a function?

Hello

If you mant to say have a procedural code in a function, you can do it, you can have a block of code in a function or if you want to call a procedure in a function you can call it.
Have you tried to create a Package?

http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14261/packages.htm

Thank you

Tags: Database

Similar Questions

  • I installed JZip and now I can not put my homepage of everything except the jzip search page. How to disable the functionality of jzip?

    I installed JZip and now I can not put my homepage of everything except the jzip search page. How to disable the functionality of jzip?

    See:

    To open the topic: config page, type Subject: config in the address bar (address) and press the 'Enter' key, as you type the url of a Web site to open a Web site.

    If you see a warning then you can confirm that you want to access this page.

  • Can we call the procedure inside the function?

    Hello

    Can we call the procedure inside the function?

    Thank you
    Brij

    845712 wrote:

    Can we call the procedure inside the function?

    Strange question to ask.

    Yes. This is the standard behavior in most (if not all) procedural and object oriented languages.

    A procedure, function or a method is a unit of code.

    You can call one of the other units. Units can call themselves (recursion). Technically, this means simply by pushing the battery current (to save the stack of the current device memory), the call to the new unit and then popping up battery when control is returned to the unity of the appellant.

    There are very few exceptions to this. The only one that comes to mind programming languages I've used through the years, is natural 1 - could not call a new unit of code to replace the existing one in memory. If no call-and-return was possible.

    Exactly what did you ask this question? Some newcomers to confused Oracle SQL and PL/SQL - two different languages aside server. And then also mistaken for PL/SQL client command vocabulary of SQL * more.

    You will need to make sure that understand the basics of programming (applies to most current programming languages) and Oracle concepts.

  • IPod 160 GB Classic is stuck on the apple logo. I have reset several times and I can not put in DFU mode or resets it to take. Done all the help topics that I have seen here and nada... Please help

    help me get the apple logo take off. I reset it, tried and failed to reset. I can't put it in dfu mode. I'm stuck and need help pease. I did everything that was mentioned in other posts similar to this issue.

    That may mean the iPod has a hardware problem, such as a faulty hard drive or the logic board.

    When you do a Reset (press and hold the Menu and Center buttons), going blank at the start before the Apple logo returns the screen to the iPod?  Or do you mean that the Apple logo is 'stuck' and it doesn't go away when you try of the reset?

    Is the "DFU mode" procedure for disc Mode.  Have a look here to confirm that this is what you have tried

    How to put your iPod in disc - Apple Support mode

  • Can I put a reminder on a line on a canvas print?

    Can I put a reminder on a line on a canvas print? How can I do? A few examples?

    I want to click on the line and a sign to appear, but I don't know how this thing of a reminder for the line of code.

    My canvas:

    Test_2 = NewCtrl (panelHandle, CTRL_CANVAS, ' ', o, 0);
    Status = SetCtrlAttribute (panelHandle, Test_2, ATTR_HEIGHT, 693);
    Status = SetCtrlAttribute (panelHandle, Test_2, ATTR_WIDTH, 693);
    Status is SetCtrlAttribute (panelHandle, Test_2, ATTR_PICT_BGCOLOR, VAL_TRANSPARENT);.

    Draw line on the canvas:
    Status = SetCtrlAttribute (panelHandle, Test_2, ATTR_PEN_WIDTH, 2);
    Status is SetCtrlAttribute (panelHandle, Test_2, ATTR_PEN_COLOR, VAL_RED);.
    Status = CanvasDrawLine (panelHandle, Test_2, MakePoint (489,75), (235, 620) MakePoint);

    If you use a canvas, you can use GetRelativeMouseState to detect the position of the mouse on the canvas. Take a look at the example of the Web (\userint\canvas.prj), more precisely the ScratchPad () and DrawToCanvas () functions in which GetRelativeMouseState is used to allow the drawing freehand on canvas.

    The next step is to figure out if the mouse is on the line: the line drawn to the user's hand or is it drawn programmatically? In the second case, I guess you know the function it generates, so it is easy to check if the mouse is over the line or not.

  • I am using windows 7 home basic 32 bit.i bought the copy under license in August 2012.how can I put my windows 7 32-bit to 64-bit? Wat is the cost?

    I use genuine windows 7 home basic 32-bit.

    I bought the copy under license in August 2012.
    How can I update my windows 7 32-bit to 64-bit?
    or can I put windows 7 32-bit to 64-bit windows 8?
    Wat is the procedure & fees for it?
    pls show me the right way.
    thanx

    You will need to do a clean install, there is no place on the way to upgrade Windows 7 32 bit to 64 bit.

    Using the disk of 64-bit Windows 7, install Windows 7 Windows Easy Transfer Utility from the DVD (to find it, simply navigate to x:\support\migwiz, "x:" is the name of your hard drive. (In this case, you will see a collection of files, the important"that you must search for and double-click is 'migsetup'.) run it and create a DAMP (Windows Easy Transfer file), if you have an external hard drive, you can access it later when you perform a clean install of Windows 7 64-bit disk so you can stored there.

    Once you have done this, just do a clean install of Windows 7 64 bit disc. In Windows 7 64 bit disk, start Windows Easy Transfer, follow the wizard screen, tap on which is stored the WET file (external hard drive) and it will restore your personal files and settings. Reinstall the applications needed.

    http://www.notebooks.com/2009/10/07/using-Windows-easy-transfer-in-Windows-7/

    For a DVD that contains all the flavors of 32-bit and a DVD that contains all the flavors of 64-bit Windows 7: Starter, Home Basic, Home Premium, Professional and Ultimate see here.

  • Call a procedure and a function over a db link

    I feel a few errors with the following and would be very happy in the view of some experts here.

    My use case is to insert records into a table via a database link. Inserted records will be interviewed for a same table in the local data dictionary. Everything works, but sometimes, I get a unique constraint violation if I'm trying to insert a duplicate record, so I wrote a simple function to check for the scenario. My problem is that I can run my procedure using the link to the db and I can run my function using the db link, but I can't use the two together without errors.

    My test scenario uses only the standard emp table:

    create or replace procedure test_insert(p_instance varchar2)
    IS
    l_sql varchar2(4000);
    begin
        l_sql := 'insert into EMP@'||p_instance||' (EMPNO, ENAME, JOB, MGR, SAL, DEPTNO) (Select EMPNO, ENAME, JOB, MGR, SAL, DEPTNO from EMP)';
    execute immediate l_sql;
    END;
    
    

    BEGIN
    test_insert('myLink');
    END;
    
    

    It works very well and the insert occurs without any problem.

    If I run the same process a second time, I get:

    00001 00000 - "forced single (s.%s) violated" which is what I've been waiting for EMPNO has a unique constraint. So far so good.

    Now, I create a function to check if the record exists:

    create or replace function record_exists(p_empno IN NUMBER, p_instance IN varchar2) return number
    IS
    l_sql varchar2(4000);
    l_count number;
    BEGIN
    l_sql := 'select count(*) from EMP@'||p_instance||' where empno = '||p_empno;
    execute immediate l_sql into l_count;
    IF
    l_count > 0
    THEN return 1;
    ELSE
    return 0;
    END IF;
    END;
    
    

    I test this situation as follows:

    select record_exists(8020, 'myLink') from dual;
    
    

    RECORD_EXISTS(8020,'myLink')

    -------------------------------------------

    1

    That works well, so now I'll add this feature to my procedure:

    create or replace procedure test_insert(p_instance varchar2)
    IS
    l_sql varchar2(4000);
    begin
        l_sql := 'insert into EMP@'||p_instance||' (EMPNO, ENAME, JOB, MGR, SAL, DEPTNO) (Select EMPNO, ENAME, JOB, MGR, SAL, DEPTNO from EMP WHERE record_exists( EMPNO, '''||p_instance||''') = 0)';
    execute immediate l_sql;
    END;
    
    

    I test this situation as follows:

    BEGIN
    test_insert('myLink');
    END;
    
    

    As a result:

    Error report:
    ORA-02069: global_names parameter must be set to TRUE for this operation
    ORA-06512: at "FUSION.TEST_INSERT", line 6
    ORA-06512: at line 2
    02069. 00000 -  "global_names parameter must be set to TRUE for this operation"
    *Cause:    A remote mapping of the statement is required but cannot be achieved
               because global_names should be set to TRUE for it to be achieved
    *Action:   Issue alter session set global_names = true if possible
    
    

    I don't know why I'm getting this. The function works, the works of the procedure, but when I combine I get an error. If I set the global setting to true names and then run again I get:

    
    02085. 00000 -  "database link %s connects to %s"
    *Cause:    a database link connected to a database with a different name.
               The connection is rejected.
    *Action:   create a database link with the same name as the database it
               connects to, or set global_names=false.
    
    

    All opinions are appreciated. I do not understand why I can run the procedure and function of each separately on the db connection, but they don't work together.

    Thank you

    John

    The procedure depends on what how would you define failure and it should mean - error to the caller, sign and continue, just continue. Constraints are created to ensure if it receives no invalid data in a table. Generally, they provide the most effective mechanism for the verification of the invalid data and return useful exceptions that can deal with the appellant. You also double the workload of the checking uniqueness by adding your own control.

    In general I would say use Exceptions, they are your friend

  • How can I put an image of a painting focused on blank postcard 4 x 6?

    How can I put an image of a painting focused on blank postcard 4 x 6?

    moopartist wrote:

    How can I put an image of a painting focused on blank postcard 4 x 6?

    1. Go to file > new > empty file. Enter the size, the color of background in function. For resolution, it is better to have the same value as the image. For printing, it is desirable to have the resolution in the range 240-300px/in, although I printed below this range.
    2. Open the file with paint. Use one of the selection tools, for example the selection brush, lasso tool and select the image.
    3. Go to Edition > copy
    4. Open the empty file
    5. Choose Edition > paste. The selection comes on its own layer
    6. Use the move tool to position and resize (if necessary) with the corner of the frame handles encompassing.
  • Can I do this using the functions?

    Hi all
    I have a select statement, this query with the category as a product:
    Select c.category_name, p.product_id
    product p join internal category c on c.product_id = p.product_id

    Now, I have several select statements that will do the calculations and give me a line of results by year:
    (I do much inner joins and pivot data to achieve this results from different tables)

    Select sum (column1) year01, sum ((column2) year02, sum (column3) sum (column4) year04 year03
    from tableA - calculations results for my first product

    Select sum (column1) year01, sum ((column2) year02, sum (column3) sum (column4) year04 year03
    from tableB - calculations results for my second product

    Select sum (column1) year01, sum ((column2) year02, sum (column3) sum (column4) year04 year03
    in tableC - calculations results for my third product

    Each select statement are calculations that I want to attach to each product, but there is no relationship with the products.
    Now I would like to join the results with my first select and get a result like:

    category_name, product_id, year01, year02, year03, year04

    Can I put my select calculations in functions?
    If I can, how can I display the result of different functions for each product?
    I need some ideas on how to achieve this.
    Thank you

    Johnny

    So, if I understand correctly, there is no relationship between your first query and queries of summary of each product. If this is the case by default in your product_id by summary query value product would work. Something like...

    SELECT
    c.category_name,
    p.product_id,
    Max (u.year01) year01,-guess there is only 1 row by summary motion product, otherwise use sum
    Max (u.year02) year02,
    ....
    Of
    product p,.
    category c,
    (SELECT '1' product_id, sum (column1) year01, sum ((column2) year02, sum (column3) year03, sum (column4) year04
    FROM tableA - calculations results for my first product
    UNION
    SELECT '2', sum (column1) year01, sum ((column2) year02, sum (column3) sum (column4) year04 year03
    FROM tableB - calculations results for my second product
    UNION
    .....) u
    WHERE
    c.product_id = p.product_id
    and c.product_id = u.product_id
    GROUP BY
    c.category_name,
    p.product_id

  • HOW CAN I PUT A PERM ON A JPEG IMAGE CAPTION?

    I have 8 elements of functioning (successfully!) with Windows 7.  How can I put a legend on the Jpeg which appears actually pictured and will show on an impression?  I want the legend to run along the bottom of the image.  I think that using the "Title" feature in the pre elements will not imprint itself on the JPEG image.  Am I wrong?

    Hello

    Use the text tool.  Make a box to the approximate location you wnt legend, choose a font and size and type the caption in the box.  You can then use the move tool to refine and adjust the location.  Once satisfied, you can flatten and save the image.  I hope this helps.

  • Why I can not put a veriable in attributes of animation?

    Hello

    I have a simple question, why I can't put variables in animations?

    <? XML version = "1.0" encoding = "utf-8"? >
    < s:Application width = "100%" height = "100%".
    ' xmlns:fx = ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" >

    < fx:Declarations >
    < s:Parallel id = "MoveRect_1ToRight" >
    "< s:Move xTo ="
    {MoveXto}"target ="{Rect_1}"duration ="8000"/ >"
    < / s:Parallel >

    < / fx:Declarations >

    < fx:Script >
    <! [CDATA]

    public var MoveXto:Number =-(Rect_1.width-stage.width);

    []] >
    < / fx:Script >

    < s:Group id = "Rect_1" width = "3000" height = "800" red = "0" >
    < s:Rect width = '100 percent"height ="100% ">
    < s:fill >
    < s:LinearGradient >
    < s:GradientEntry color = "#e8db03" / >
    < s:GradientEntry color = "#153eec" / >
    < / s:LinearGradient >
    < / s:fill >
    < / s:Rect >
    < / s:Group >

    < s:Group id = "Rect_2" width = "80" high low "0" = "0" right = "0".
    rollOver = "MoveRect_1ToRight.play (); "rollOut ="MoveRect_1ToRight.pause (); ">
    < s:Rect width = '100 percent"height ="100% ">
    < s:fill > < s:SolidColor color = "#000000" alpha = "0.2" / > < / s:fill >
    < / s:Rect >
    < / s:Group >
    < / s:Application >

    Greetings

    zombiecook

    You need to calculate the value of MoveXto after the application is created, here, I use the creationComplete for example Manager (and I changed the stage for this), but you might also consider using the applicationComplete handler if you do not want a value non-zero stage.



    "xmlns:FX ="http://ns.adobe.com/mxml/2009"
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    creationComplete = "init ()" > "
       
       
           


               
           
       
       
       
            [Bindable] public var MoveXto:Number;

    private function init (): void {}
    MoveXto = - 1 * (Rect_1.width - this.width);
    }

    ]]>
       
       
       
           
               
                   
                       
                       
                   

               

           

       

       
       
    rollOver = "MoveRect_1ToRight.play (); "rollOut ="MoveRect_1ToRight.pause (); » >
           
               
           

       

  • How can I put text in front of a form

    Hello I have header and one line below. For the character as j, p, etc. the background is cut by the line; How can I put the text to be in the front of the line? I tried to bring the line.

    Thank you!

    Select your line segment and then organize menu: Section Masters: move Section Master object. This will put this line in the background on all pages, and your text will appear on the line.

    Alternatively, you can consider giving your line transparency more or less color darker, so that it does not interfere with the readability of your character chutes.

  • How can I put an icon on your laptop MAC Book Air - i.e. Facebook (for faster access)?

    How can I put an icon on your laptop MAC Book Air - i.e. Facebook (for faster access)?

    Drag it to your desktop.

  • How can I put a my signature on a text?

    How can I put a signature on a text?

    Hello. Do you mean the type of signature used by PDF files, or just a picture of a signature that is added to a document? Is the software you use to create the document?

  • Can I put OS Lion directly to El Capitan without an intermediate upgrade. I have a MacBook Pro late 2011. Safari no longer works on a lot of web content with this OS not.

    Can I put OS Lion directly to El Capitan without an intermediate upgrade. I have a MacBook Pro late 2011. Safari no longer works on a lot of web content with this OS not.

    Yes.

    (143974)

Maybe you are looking for

  • HP Pavilion 15 laptop: defective Ethernet Jack

    Hi all It seems that the RJ45 cable can not install propeerly into the socket on my laptop, I use a toothpick to jam it so the light comes on and I know it works. Can the adapter replace easily if I open the computer? where I buy the piece in Europe

  • I have a very big problem!

    I am of the Iran, and Apple does not support the Iran. My credit card had a $ 15 and I can't use it cause I forgot my security questions and do not have access to my email of relief. What can I do? Please help me

  • Want to 700-074 video card recommendation

    I start to play a MMO and he says my driver is low level. She still plays. There is no newer driver on the HP website and I can't load new driver Intel that HP has installed a driver(for stability) custom A more recent MMO starts in April with graphi

  • CANNOT INSTALL KB951944, KB972581, KB974234

    I TRY TO INSTALL KB951944, KB972581, KB974234, BUT I DO PASS THE ERROR MESSAGE "EXPECTED VERSION OF THE PRODUCT WAS NOT FOUND ON THE SYSTEM. MY COMPUTER HAS THE ORIGINAL VERSION OF MICROSOFT OFFICE AND WINDOWS VISTA 64-BIT. WHAT SHOULD I DO TO INSTAL

  • slow video

    HP Pavilion dm 1 APU AMD E-300 with 1.30 GHz Radeon graphics card 6.00 GB Ram (5,60 usable) 64-bit operating system Windows 7 Home Premium SP 1 Drive hard solid state My computer seems to be simply not be able to play movies.  I thought that this com