problem with the definition of a boolean as output parameter type

Hi, I have a problem with the definition of type boolean as output parameter and it must return true if the query procedure retrieves one line else it shouuld return false

Hi, I have a problem with the definition of type boolean as output parameter and it must return true if the query procedure retrieves one line else it shouuld return false

And what are the issues? Its simple.

SQL> create or replace procedure is_emp_exist
  2  (
  3     p_empno  in  emp.empno%type
  4   , p_result out boolean
  5  )
  6  as
  7     l_empno emp.empno%type;
  8  begin
  9     select empno into l_empno
 10       from emp
 11      where empno = p_empno;
 12
 13     p_result := true;
 14  exception
 15     when no_data_found then
 16        p_result := false;
 17  end;
 18  /

Procedure created.

SQL> declare
  2     l_result boolean;
  3  begin
  4     is_emp_exist (7788, l_result);
  5
  6     if l_result then
  7        dbms_output.put_line('Employee Exist');
  8     else
  9        dbms_output.put_line('Employee does not Exist');
 10     end if;
 11  end;
 12  /
Employee Exist

PL/SQL procedure successfully completed.

SQL> declare
  2     l_result boolean;
  3  begin
  4     is_emp_exist (1000, l_result);
  5
  6     if l_result then
  7        dbms_output.put_line('Employee Exist');
  8     else
  9        dbms_output.put_line('Employee does not Exist');
 10     end if;
 11  end;
 12  /
Employee does not Exist

PL/SQL procedure successfully completed.

SQL>

Tags: Database

Similar Questions

  • problem with the definitions of the brush

    Hello:

    I just started using Illustrator but I have some experiences with the PS. My operating system: Windows 7 64-bit

    So, I was my way around learning and playing with the Brush tool, but when I went to reset the brush base under brush definitions, there wouldn't be on Basic. Also, when I go to set the different size race he keeps back to 1px.

    Any ideas? Or do I just call tech support Monday?

    Just thought I would ask here first.

    Thank you for your time.

    Have a good day/evening,

    Kara

    The basic means: no brush

    But if you use the Paintbrush tool, it will always use a brush.

    In case you want to draw simple traces brushless, take the pen tool

    In case you want to paint simple lines, use the pencil tool, not the brush

  • Problem with the definition of the Application context Variable

    Hi all

    In our application, we use political VPD. We use the app context variables to store session level settings. When I'm trying to set the value of context separately through SQL PLUS he started after the exception.

    ORA-01031: insufficient privileges
    ORA-06512: at "SYS." DBMS_SESSION", line 90

    But the same works very well a procedure. When I am executing the procedure it works fine.

    Can anyone of you pls help me?

    user12097713 wrote:
    Hi all

    In our application, we use political VPD. We use the app context variables to store session level settings. When I'm trying to set the value of context separately through SQL PLUS he started after the exception.

    ORA-01031: insufficient privileges
    ORA-06512: at "SYS." DBMS_SESSION", line 90

    But the same works very well a procedure. When I am executing the procedure it works fine.

    Can anyone of you pls help me?

    I assume that you have created the context related to the packaging?

    Create context SOME_CONTEXT using SOME_PACKAGE;
    

    When you do this, the ONLY place you can set the values of context is the specified package. If you cannot change it directly, you must call the package (whatever the process change it and is available).

    This is a safety mechanism, so you can't do whatever it is that you're probably trying to do :)

  • Voltage offset problems with the NO-9401 for PWM signal output

    I try to create a 20 kHz PWM signal to drive a motor control circuit uses the NI 9401 module in the chassis OR cRIO-9073. Generating the PWM signal works. For some reason, changes in shift of power as the market factor is increased. It is less effective for the engine, as you can imagine.

    The code I am using is the finder of the example, for the generation of PWM on an FPGA and is attached.

    I thought that it worked before but may have used the the NOR-9505 rather PWM output to test my circuit. It would be unreasonable for me to do this as a permanent solution.

    The problem can be summed up as: with an increase in the liability of the cycle the voltage line (offset) movement of the output signal in the negative (according to ADGE) Basic or down. The Vpp signal is correct and does not change. Against ticks from 0 to the maximum of 2000 ticks (duty cycle IN), the offset voltage shift is such that 100% the level of full voltage is 0V.

    Any ideas as to why this offset voltage shift that happens?

    Do not be dismayed, I worked on the problem. There was a connection problem - I thought I was logged in as reference Earth, but it has not been properly clipped.

  • Problem with the start of VMware ESXi 5.0

    I just installed VMware ESXi 5.0 on a new Cisco UCS B200 series blade with two 300 GB hard drives configured in a RAID 1 mirror.  I went through and completed the installation of VMware ESXi 5.0 on this server.  When the installation is complete and the server restarted, he did not initiate the ESXi where I can change the IP address and VLAN.  Instead, I get this text string after the initial boot sequence that is shown in the attachment.  I have a guest who said Shell > do not know why I can not start correctly in ESXi 5.0.  Thank you!  Paul

    Hi Paul,.

    Looks like you boot to the EFI shell. What is the startup policy that you have configured on this server service profile? It should look like the one below.  If there is a problem with the boot order, you should be able to type "EXIT", then enter on the EFI shell to exit the prompt. If your startup is similar to the one below and you still experience this issue, try to downgrade and re - ack the blade.

    Let me know if it helps.

  • Satellite U400 - 10L: problem with the start-up & reboot

    Hello

    Well I don't like much about the touchpad overheating but I have a problem. When I restart this mobo instead of activate after a reboot it stays black without any reaction only lower diods, dvd - rom and the display flashes (can't hear fan or hard drive).

    If I press the power button / stop all the icons of diod (ac, pwr, hdd bat) shine up just for a second and new (can't hear the fan hard drive or cpu) computer does not turn on. All this happened only when AC cable is connected to the power if I use just notebook power source battery boots and restart without problems.

    If I remove battery completely from the laptop, once more, I get the same symptoms (cannot start). And the saddest part of this story is the fact that I got brand new Toshiba U400 10 L to the seller and got a new.
    It has the exact same problem.
    As you all probably understand im crazy because in the last two days, I tried really everything, including the BIOS without flashing and the success.

    Well im not sure whats going on, but this could be the problem with the battery or a bad contact?
    Any ideas?
    I would return it back?

    Thanks much for the reply

    Hello

    The behavior of your laptop is really strange and I suppose it might be bound only to a hardware problem.

    A friend of mine couldn't t start the laptop connected to the AC adapter the power adapter is faulty. It was only possible to start Notepad using the battery, and only if the battery was not completely empty.

    I put t know if your AC adapter failures but the authorized service provider should definitely check out the laptop and accessory for laptop (AC adapter).

    Then call the ASP in your country and ask the technicians for later handling.

    Greetings

  • Problem with the number of lines in the channel

    Dear community LabView,

    I'm relatively new to labview and I came across a problem that (I assume) can easily be resolved with your help.

    I need to create a digital signal to trigger a camera, but I have a problem with the configuration of my lines or exit lanes. I would not use that line output to trigger the camera. (I use a card NI PCIe-6353). LabVIEW is telling me that the number of lines in the channel does not have the number of rows of data:

    Possible reasons:

    Specified read or write operation failed because the number of rows in the data of a string is not the lines in the channel.

    If you use the digital waveform data type, make sure that the number of lines in the digital waveforms is the number of lines in the channel. If you are using Boolean data, make sure that the dimension of the array for the rows of the data is the number of lines in the channel.

    Number of lines in the channel: 1
    Number of data lines: 2

    Task name: _unnamedTask<11>

    How and why the number of data rows is connected to the resolution of my analog digital converter?

    I would appreciate your help! Labview code and a screenshot attached.

    Thank you

    Beff

    I got it to work by changing the "data format" "binary not signed" OR by plugging is not the "offset" for the Square Wave VI.  I think that the default "offset binary" data format works correctly if there is a negative value.

  • HP Support Assistant unable to fix a problem with the CD/DVD not detected

    I have a G42-415DX laptop and I can not read cd/DVD, it was working fine 3 weeks ago and now nothing / I tried the support assistant and he could not solve the problem.  I got a message saying the driver must be reinstalled, how do I reinstall the driver?

    Hello

    If you do not get the chance to use another PC, I would definitely create the CD and the DVD bootable as it would give a clear indication if there is a hardware problem with the optical drive.

    In the meantime, try following the procedure in the title of the subheading "Let me fix it myself" on the link below to remove upper and lower filters (if these registry keys exist) and see if that helps the issue.

    http://support.Microsoft.com/kb/982116

    If find you the following registry keys and delete them, restart the laptop before checking the disc.

    Kind regards
     
    DP - K

  • Could get a new router block printing? We had a lot of problems with the computer in the last week and a half. Bought new router and now the printer does not print. :-(

    (1) we went to DirecTV. Then the same day, our internet computer is down. I asked our current provider, Suddenlink, to let them know we had them to another - but we wanted to keep for the internet.

    (2) called DirecTV to investigate why our internet went down at the same time they installed? They said that they did nothing to cause that. We waited 5 days to make out and also install the third TV that was promised. The second tech gave things a lookover and said, once again, that there is nothing unusual during their passage to cause the problem.

    (3) called Suddenlink. They said it was the router. Called the people of Netgear. They said that the router was too old. We needed to pay an exorbitant sum for support and when I told him I'd rather just buy a new router and get free technical support for 90 days... and I personally do not have the credit cards in that time. (it's my mother s equip and I wonder it for the computer) when the guy told me that he could help and hung up on us, even though I was pleading for him to wait until I put my mother on the phone. (I'm in my 40s... not a kid).

    (4) Suddenlink called a few days later, when we got a new router (netgear brand NO!) Installed and I noticed that the 'ready' light was not 'on' on the modem. Their technology has said that he would check and call us in a few minutes. He did not.

    (5) the next day I called Suddenlink AGAIN. This time, I got a really nice customer service agent. She said she would send someone to check on it. It turns out that they had disconnected when I had called to pass only the TV.

    (6) in any case, we are finally online... only now... I can't the printer to work. :-(  This has worked before.  Could it be caused by the different router? I don't know about these things. I didn't even know what it was until someone at Radio Shack has explained to me. (I was not about to buy one at Wal-Mart - these poor people). The printer is a Canon Pixma MX340. We love him. The only thing is that it is difficult to clear the tasks or to reset. The only way to really do that is to simply pull the plug, unfortunately and restart the computer. But hey, it's a great printer, better than HP.

    We are under vista. The router is a Linksys wifi (which we have) N300 model E900.

    Of course I appreciate any help you can give. God bless you!

    Michelle and Ruth.

    Hello

    Thanks for posting in the Microsoft Community.

    I understand that you are facing problems with the printer in Windows Vista.

    I imagine the inconvenience that you are experiencing. I will definitely help you with this.

    Please follow the steps in the link.

    Solve printer problems

    http://Windows.Microsoft.com/en-in/Windows/printer-problems-in-Windows-help#fix-printer-problems=Windows-Vista&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

  • Problem with the disk check.

    32-bit Vista Home Premium:

    About 6 months ago, I ran a Check Disk from my C drive (using Vista error checking tool) and checked the two boxes before starting (fix Auto file system and search for errors / attempt to recover bad sectors).

    He ran through the 1 5 6 controls without finding an error.

    On the 6th and final verification that it is running, it hung (or the 4th of 5 controls it works - do not remember if it is 5 or 6 it works). According to me, he started the final control, but stopped and none did not move. A few hours later he still hadn't moved, so I did a hard stop.

    Fortunately, everything was fine when I rebooted.

    I use the computer since then without problems/errors obvious hard drive, but I'm afraid to run another check of the disk, even though I would right now.

    Suggestions are welcome as to what might have caused the shot, and if I do another check of the disk.

    Yes, it's essentially the same command.  Personally, I never use the other method - I just use the one that I you provided.

    : You are right about the meaning switches - you already know or you're an awfully good guesser.  Since you have expressed interest, here's more information on CHKDSK you might find of interest with other switches and guidelines and some good information on how it works and how to use the results: http://www.vistax64.com/tutorials/67612-check-disk-chkdsk.html.

    If you cannot complete a cHkdsk on your hard drive, then there is a problem with the player that must be resolved before it is any worse.  I would definitely give it another chance and also run the diagnostics that I recommended in a previous post.

    I hope this helps and I hope that the test completes successfully this time.  If this isn't the case, I hope that the diagnostic test identifies the problem and it can be repaired than replaced (even if it's pretty rare - usually if it goes wrong it must be replaced).  If this is the case, I would as soon as possible to ensure that it is not so bad that you can no longer access the drive at all - but then again, there may be nothing wrong and we could be worrying for nothing but a bad block or two which is nothing to worry about in itself.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Problem with the ObjectListField

    Hello

    I have problems with the method getSelectedIndex() ObjectListField.
    Supposedly, when there is no index selected, it returns-1. But how come it always returns the index of the last element?

    To illustrate, I created my own dialog that has similar functionality to the "device window select" Bluetooth BB application. I have an ObjectListField and a Cancel button. What I did simply, is to change the label of the button to show the selected index. I have attached my sample code below.

    public class MyDialog extends dialog
    {
    private ObjectListField m_list;
    private ButtonField m_btn;

    public MyDialog)
    {
    Super ("Select Device:", null, null, 0, Bitmap.getBitmapResource ("bluetoothIcon.PNG"), Manager.FOCUSABLE);

    m_List = new ObjectListField();
    m_btn = new ButtonField ("Cancel", Field.FIELD_HCENTER);
    m_List.set (new String [] {"first", "second"});

    Add (m_List);
    Add (m_btn);
    }

    protected boolean navigationClick (int status, int time)
    {
    m_btn.setLabel (Integer.ToString (m_List.getSelectedIndex ()));

    Returns true;
    }
    }

    Can someone help me on this problem? Is there something wrong with my code, or is the buggy API? All I want to do is to return an index of-1 if there is no selected item in the list.

    Also, I tried the isFocus() method to check if the list is being concentrated, it always returns false even if the list is OBVIOUSLY being focused. I'm running out of options on how to determine the solution to this problem. Help, please!

    Thank you very much.

    @jacylan - I do not use isFocus() to determine if the ListField is net.  Take a look at the following code, I think that with this, you can force-1 when the ListField is not the point.

        protected boolean navigationClick(int status, int time)
        {
            int selectedIndex = m_list.getSelectedIndex();
            boolean listInFocusOption1 = false;
            if ( this.getLeafFieldWithFocus() == m_list ) {
                listInFocusOption1 = true;
            }
            boolean listInFocusOption2 = false;
            if ( m_list.isFocus() ) {
                listInFocusOption2 = true;
            }
            m_btn.setLabel(Integer.toString(selectedIndex) + ":" + listInFocusOption1 + ":" +listInFocusOption2);
    
            return true;
        }
    
  • "Détarer" problem with the Torch 9800/Device Simulator

    Hello everyone,

    Im a very strange problem with the Torch 9800 (OS 6).

    I have an application developed with 5.0 SDK. Throughout the process of synchronization of this app, there is a point he gets a. tar.gz file that is unziped. For this purporse (in fact, the tar part / "détarer"), we use a tar / "détarer" 'library' we found here in the forum (http://code.google.com/p/j2metar/). This library works fine in all phones with OS 5.0 that we try and even on the simulators of somo 6.0.

    But there seems to be a problem with the torch. During the uncompress, there are an exception, because what is the reading of the structure of the tar (from the industry), load the bytes that are invalid, corrupt, dirty, memory, and it fails.

    The strange thing of all is that if I have only the routine détarer to the file (in the torch), it works! But when I run all my sinchronization, which open and close httpconnections and process the file on some points (sometimes the same point, others of different) fails.

    My question is... are at - it a known bug, issue, etc. with the BONE of the torch (touch device)? Of course, the first thing that jump to mind is "my code is incorrect, memory leaks (in Java, but perhaps odd that a stream was not getting close properly)" and so on, but I can't seam to find the problem. And like I said before, this application works fine with the same file tar.gz in other devices like the 8520 OS 5, 9780 OS 6, 8900 (OS 5).

    IM completely stuck with this problem and any help/test will be greatly appreciated.

    Here some code, the method that makes him détarer and calls the détarer/tar library:

    public static boolean "détarer" (String tarFileUrl, String destUrl) bird Exception {}

    FileConnection fconn = null;
    FileConnection tarFileConn = null;
    TarInputStream tis = null;
    Boolean bRet = false;

    try {}
    fconn = (FileConnection) Connector.open (destUrl, Connector.READ_WRITE);
    If (! fconn.exists ())
    fconn.mkdir ();   Create the folder if it does not exist
    fconn. Close();
    fconn = null;
                
    Create a TarInputStream
    tarFileConn = (FileConnection) Connector.open (tarFileUrl);
    TIS = new TarInputStream (tarFileConn.openInputStream ());
    tarFileConn.close ();

    Entry TarEntry;
    int count;
    data Byte = null;
                
    While ((input = tis.getNextEntry ())! = null) {}
    Count = 0;
    data = new ubyte [2048];

    fconn = (FileConnection) Connector.open (destUrl + entry.getName (), Connector.READ_WRITE);
    If (! fconn.exists ())
    fconn. Create();   create the file if it doesn't exist
    else {}
    fconn. Delete();    Create a new
    fconn. Create();
    }

    OutputStream os = fconn.openDataOutputStream ();
                    
    While ((count = tis.read (data))! = - 1) {}
    OS. Write (data, 0, count);

    }
                    
    OS. Flush();
    OS. Close();
                    
    fconn. Close();
    fconn = null;
               
    }

    TIS. Close();
    TIS = null;
                
    bRet = true;
                
    } catch (Exception e) {}
    e.printStackTrace ();
    throw e;
    } {Finally
    try {}
    If (tis! = null)
    TIS. Close();
    If (tarFileConn! = null)
    tarFileConn.close ();
    If (fconn! = null)
    fconn. Close();
    } catch (Exception e) {}
    }
            
    Return bRet;
    }

    Thank you!

    Santiago.

    Hello

    It is a problem with the OS 6.  I've posted about this before here:

    http://supportforums.BlackBerry.com/T5/Java-development/reading-and-writing-file-on-torch-9800/TD-p/...

    Basically, corruption may occur if you write to the stream simultaneously in different threads.  The solution is to ensure that a single file operation is occurring at a given time.  Some people have had the chance to control the size of the buffer to something as a multiple of (64 * 1024)-1. e.g. 65535.  In addition, you can rinse after each write to the buffer.  I have had no luck with this, but others.  If you look at the bug in JIRA, there is also no activity on this:

    https://www.BlackBerry.com/jira/browse/JAVAAPI-1513

    Good luck!

  • my computer asks me to fix a problem with the graphics driver intel but windows tells me solution can not be downloaded

    computer crashed and rebooted itself. I first started in safe mode, and the computer did not find any problems but had sent a report anyway.

    To restart normally, the center of the action (or as I would say, Center!; - p), has been asking me to scan with windows defender and a problem with the graphic driver intel. Scanned well, but to solve the problem, said action solution Center could not be downloaded. I am most definitely connected to the internet and have tried to solve this question many times during approximately the last 18hours?
    Help would be much appreciated?

    Good suggestion but I tried this, had to go the manufacturer of the laptop, but still no luck. Think he was playing tricks on me in any case, as seemed to be resolved with a full audit of the system and diagnosis.

    Thanks for the effort though...
  • problem with the help of the conditional formatting on a cell that is defined as the percentage

    Hi all

    I am facing a problem with the help of the conditional formatting on a cell that is defined as the percentage.

    I am using beaches for example:

    is equal to or greater than 10% - green color

    5%-10%-yellow

    less than or equal to 5%-color red


    the problem is that keeps the value 10% get yellow color when it should get green.


    i thought that is a rounding issue but when I change the definitions of the cell to learn more decimal places I see this part of the percentage 9.65% and some of them are 10.00% and they are both colored in yellow.

    I also tried to change the way range of 6 to 9%, but values between 9.65% or 5.5% are not colored.


    I really enjoy your help!

    You know the reason and the solution.

    change the format of the column and go or add a column more with decimal and opt for conditional and hide report.

    Thank you

    http://cool-bi.com

  • Strange problem with the keyboard event listener

    I have a full screen touch app. To close the application, I set an event listener on keyboard for the key "0". I don't want the press user due to some restrictions Alt + F4 key combination. Problems begin when the application loses focus. Here's the code;

    protected function onComplete(event:FlexEvent):void
    {

    this.setFocus ();
    this.addEventListener (KeyboardEvent.KEY_DOWN, trapKeys, true, 0, true);

    }

    private void trapKeys(e:KeyboardEvent):void {}

    If (e.keyCode == 96) {}
    This.Close ();
    }

    Else if (e.keyCode == 48) {}
    This.Close ();
    }

    }

    When the user change the screen to a different with Alt + TAB application, or any other combination of keys flex app loses focus and does not work when he turns back to my app "0". How can I solve this problem?

    Thanks in advance.

    Hi, Ahmed.

    I have absolutely no problem with the solution you are trying to set up - you use mode full-screen interactive mode of keyboard?

    Please consider:

    on full add keyboard listener

    protected function applicationCompleteHandler(event:FlexEvent):void

    {

    this.stage.addEventListener (KeyboardEvent.KEY_DOWN, trapKeys);

    };

    //

    protected function applicationActivateHandler(event:AIREvent):void

    {

    If (this.stage)

    {

    switch the State to display full-screen when activated

    If (this.stage.displayState! = StageDisplayState.FULL_SCREEN_INTERACTIVE)

    {

    this.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;

    };

    };

    };

    //

    private var exitHandled:Boolean = false;

    on NUMBER_0 | NUMPAD_0 exit-close

    protected function trapKeys(event:KeyboardEvent):void

    {

    If ((event.keyCode is Keyboard.NUMBER_0

    || event.keyCode is Keyboard.NUMPAD_0)

    (& this.exitHandled == false)

    {

    exitHandled = true;

    this.stage.removeEventListener (KeyboardEvent.KEY_DOWN, trapKeys);

    This.Close ();

    };

    }

    (Note: applicaton of the events 'applicatonComplete' and "applicationActivate" are routed to over managers)

    Kind regards

    Peter

Maybe you are looking for