How to get this function working

Dear buddies,
I created a function which should check if a certain code exists in a certain table.
Not sure how to get it done
create or replace function check_code(crs_code in varchar) return integer is
  Result integer;
begin
  if crs_code in (select cod_code from crs_code) then
    result := 1;
  else  
    result := 0;
  end if;
  return(Result);
end check_code;error: Compilation errors for FUNCTION CONV.CHECK_CODE
Error: PLS-00405: subquery not allowed in this context
Line: 6
Text: if crs_code in (select cod_code from crs_code) then
Error: PL/SQL: Statement ignored
Line: 6
Text: if crs_code in (select cod_code from crs_code) then

My guess is that
create or replace function check_code(p_crs_code in varchar) return integer is
  l_Result integer;
begin
  SELECT COUNT(*)
    INTO l_result
    FROM dual
   WHERE EXISTS (
      SELECT 1
        FROM crs_code
      WHERE cod_code = p_crs_code
  return( l_Result);
end check_code;should work but you've provided no table structure, no sample data, and no desired output so it's a bit unclear. Note that it is a really bad idea to have parameter names that match table names. My assumption is that CRS_CODE is both a table and a parameter name in your original function. Otherwise, I'm not sure what your SELECT statement is attempting to do.
Justin

Similar Messages

  • I have purchased itunes match but the cloud will not load on my ipad 4.the only music that will show up is stuff that i bought from the itunes store.any ideas on how to get this to work?

    i have purchased itunes match but the cloud will not load on my ipad 4.it works on my iphone 5 & it originally worked on my ipad.the only music that will show up is stuff that i bought from the itunes store.any ideas on how to get this to work?

    On the MBP, in iTunes, switch to Song view and enable the iCloud Status column by pulling down View > View options and selecting the option for "iCloud Status." Close the small window. Look for any tracks that have a status of "waiting." If you see several of them disable iTunes Match while holding down the Option key. Quit iTunes, wait a few seconds, then open it again and turn iTM back on. Let it compelete the scan. Wait until all tracks that are "waiting" have a status of either "matched" or "uploaded."
    On the iPad, turn off iTunes Match then launch the Music app and let the contents clear out. Power cycle the iPad for good measure, then re-enable the service once all the tracks in iTunes have been processed.

  • Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Facebook like button is not working, I have used the muse widget and created code from facebook. Does anyone know how to get this to work?

    Hi connally25,
    Below is a link to a video tutorial on how to add a Facebook Log button, please check if you have followed the same steps to add the video.
    http://tv.adobe.com/watch/learn-adobe-muse-cc/adding-a-facebook-like-button/
    If you have followed the steps correctly and the button still does not work; here is a link to a forum thread which might help solving the issue:
    Facebook Follow Widget not working
    Regards
    Sonam

  • I have a 4s iPhone which I loaded the new Os on last night. Now I can not connect to iTunes. A message comes up saying i need 10.6.3 or later but I am running 10.6.1 as I have an older Mac. Anyone have ideas how to get this to work?

    I have a 4s iPhone which I loaded the new Os on last night. Now I can not connect to iTunes. A message comes up saying i need 10.6.3 or later but I am running 10.6.1 as I have an older Mac. Anyone have ideas how to get this to work?

    Its not telling you to update your iPad, its telling you you need to download a recent version itunes on your computer.
    Go here to download the newest version of iTunes.
    http://www.apple.com/itunes/?cid=OAS-US-DOMAINS-itunes.com

  • My itunes store won't open. Any suggestions on how to get this to work? I've already downloaded the newest version of itunes. I'm also not sure what Mac operating system I have..

    My itunes store won't open. Any suggestions on how to get this to work? I've already downloaded the newest version of itunes. I'm also not sure what Mac operating system I have..

    To find the version of Mac OS X on your computer, all you have to do is click the Apple logo and then About this Mac. For more info, take a look at this doc -> Finding your OS X version and build information
    Do you see an error when you try to open the iTunes Store on your Mac?
    This Apple doc is a good place to start -> iTunes: Advanced iTunes Store troubleshooting

  • How to get old functions working on new keyboard

    I purchased a new metallic keyboard to replace the original on my Mac G4, and downloaded the specified software update. Now the keyboard works, but some of my applications that had functions attached to the old function keys won't respond to the new function keys, which Apple reconfigured to do other things. Is there a workaround? I tried reconfiguring System Preferences, but nothing there makes sense.

    I am trying to get te @ key to function by pressing down the normal shift+' key, It is a windows keyboard I am using. Any clues anyone. cheers Janny
    It's the software keyboard layout that determines this. The Mac "British" layout puts @ at Shift + 2. If this drives you crazy, you can download and install a different layout:
    http://liyang.hu/osx-british.xhtml

  • How to get this to work ?

    Firs tof all I'm using Vista, sorry... Anyway, I hope there are someone which can help me with my problem...
    I have an Asus WL-500W router where I've disabled the DHCP router and I want my ADSL Modem to work as the DHCP server.
    I've then connected my Time Capsule to the Asus WL-500W with an Ethernet cable and connected my computer to the Asus WL-500W also with an Ethernet cable as I want to take advantage of the fastest transfer speed possible (in my case 100mbit).
    The above setup does also work, and the Time Capsule shows as a Network Drive. But if I want to go Wireless between my computer and my Asus WL-500W, then I can't get access to my Time Capsule.
    My computer has an IP of 10.0.0.4 and my Time Capsule has one of 10.0.0.7.
    If I setup the Time Capsule to use Wireless to connect to my Asus WL-500W then I can see the Network Drive, but then I will only have 54mbit connection even if I plug in the Ethernet cables...
    But I need help to setup my Time Capsule so it will work with Ethernet and Wireless so it will take advantage of the fastest speed possible...
    Regards,
    Jakob

    Giving the error message might have saved some time... Also do you compile manually or from NetBeans?
    First, you have a syntax error in the main file (an extra closing brace).
    Once fixed, I had a puzzling error...
    If I remove the package declarations, I get the following error:
    Test.fx:18: thetank has script only (default) access in unnamed package
    If I add public to thetank class, I can compile and run your code.
    But if I add back the package declaration, I get the cannot find symbol (thetank) error.
    I found why I had this error: I was compiling (manually) from the fishtank folder. After I compiled one level higher (+javafxc fishtank/thetank.fx+ then javafxc fishtank/Test.fx) I was successful.
    I was puzzled because I most of my test code without package, it is easier to compile from my editor...
    Since you don't tell which error you have, I don't know if I addressed your problem...

  • Import selected photos button not working, Please tell me how to enable this function.

    in Iphoto on macbook pro, the 'import selected' button blacked out, only 'import all photos' works, pls tell me how to get this to work. i'd like to transfer only selected photos to ipad. Have tried to import by copy/paste method into itunes but still cannot be done, every way i've tried is restricted. I don't want to send all my photos through email. neither do i want to use icloud. all i simply want is to have only selected photos sent through my USB cable connected from my macbook pro to send photos to Ipad. It seems Apple have made these strange restrictions for whatever purpose i don't know.

    If you went through the 5 Rs step by step and you're still having problems, it might be time to find an iPod repair service. Apple will charge you as it's out of warranty. You can probably find third party repair outfits that will do it more cheaply.

  • Satellite L500 - How to get FN keys working on Windows 7 64bit?

    Hi
    I needed to reinstall Windows 7 on a Satellite L500 but I can't get the FN keys to work. Would anyone here be able to give any ideas on how to get this to work?
    cas

    Hello
    You need Toshiba Value Added Package and Flash Cards Support Utility. Both you can download here:
    http://eu.computers.toshiba-europe.com > Support & Downloads > Download Drivers
    Use also the forum search, this question was asked 100 times before.

  • How to get Messages to work with a proxy server?

    at work we use a proxy server.
    some icloud programs work, but Messages does not.
    any idea how to get this to work through a proxy server?
    thanks.

    Hi,
    Now I feel really silly.
    I remember the pane looking like this though:-
    As there used to be two iChat forums here at Apple Support Communities  and the older iChat 2.1 one has disappeared I am not sure how many threads might be available for scrutiny on this matter.
    AS I said I don't ever recall someone reporting that they got it  to work.
    During early version of iChat it was found that the AIM server would accept a login on almost any port.
    It became popular to suggest port 443  as this was a well known port known to be open on most routers "out-of-the-box" and likely to be open in campus situations where students may not have any control over what ports were open.
    An AIM Login can also do "Direct IMs" for which is switches to port 5190 on the UDP Protocol.
    At this point the chat is peer to peer.
    It does this if you send a pic in the Chat or send a file.
    It uses port 5190 for this no matter what is used for the Login.
    7:27 PM      Thursday; May 9, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • The message function on my Ipad just quit working.  I was using it while in Mexico and it just quit.  I have come home and synced my Ipad with Itunes and function still does not work.  How do I get this function to work again?

    The message function on my Ipad just quit working.  I was using it while in Mexico and it just quit.  I have come home and synced my Ipad with Itunes and function still does not work.  How do I get this function to work again?

    When I use find file http://www.macupdate.com/app/mac/30073/find-file (which does tend to find files that "Finder" can't), it's not coming up with any other itunes library files that have been modified in the past week, which I know it would have been - unfortunately, I don't have a very recent backup of the hard drive.  It would be a few months old so it wouldn't have the complete library on it....any ideas?  I'm wondering if restarting the computer might help but have been afraid to do so in case it would make it harder to recover anything...I was looking at this thread https://discussions.apple.com/thread/4211589?start=0&tstart=0 in the hopes that it might have a helpful suggestion but it's definitely a different scenario.

  • Hi out there. To capture a screen shot one uses: Command-Shift-3 or 4. I have done this for a long time. Now suddenly neither screen shot works anymore. Suggestions how to get this useful function back? Thanks, Georgx

    Hi out there. To capture a screen shot one uses: Command-Shift-3 or 4. I have done this for a long time. Now suddenly neither screen shot command works anymore. Suggestions how to get this useful function back? Thanks, Georgx

    Command-Shift-3 and 4 works just fine on several Macs that I have here.
    Try restarting your Mac....or post in the specific support area for your Mac model....for more advice.
    https://discussions.apple.com/index.jspa

  • I'm trying to connect my iPad to my Samsung galaxy s by bluetooth but the ipad will pair with it but not connect and says "its not supported" does anyone know what this means and how I get it to work?

    I'm trying to connect my iPad to my Samsung galaxy s by bluetooth but the ipad will pair with it but not connect and says "its not supported" does anyone know what this means and how I get it to work?

    iOS devices do not have the BT profiles that support file sharing and othr general functions. See:
    iOS: Supported Bluetooth profiles
    Basically it support headphones, keyboards, speakers, peer-to-peer gaming

  • How can I get this function to fire off last?

    In the following code, there are two buttons on the stage- "button1" and "button2". 
    I want to get the buttons to change frames and THEN have the "playerChange" function fire off.
    Currently, the "playerChange" function fires first. Moving the function  either renders the code inoperable or
    returns error messages.
    function buttonChange (e:MouseEvent)
    {if    
                    (e.target.currentFrame == "frame1" )
             if (e.target==button1) (playerChange)
                     (e.target.gotoAndStop(player.currentFrame + 1)) 
               else{player.gotoAndStop(player.currentFrame)
              if (e.target==button2)  (playerChange) 
                    (e.target.gotoAndStop(player.currentFrame + 1))
              else{player2.gotoAndStop(player2.currentFrame)
    button1.addEventListener(MouseEvent.CLICK,buttonChange );
    button2.addEventListener(MouseEvent.CLICK,buttonChange);
    Note:this is an abridged version of the code. The code I'm actually using uses 20 buttons and about 8 conditionals for each button, so e.target is more convenient than writing a command for each button.

A: How can I get this function to fire off last?

the code is very hard to understand
it's badly formatted
{}'s don't match
you aren't calling a playerChange function
this is my guess at something that might work for you
function buttonChange (e:MouseEvent)
          if(e.target.currentFrame == "frame1" )
                    if (e.target == button1)
                              e.target.gotoAndStop(player.currentFrame + 1);
                              playerChange();
                    else
                              player.gotoAndStop(player.currentFrame);
                              if (e.target == button2)
                                        e.target.gotoAndStop(player.currentFrame + 1);
                                        playerChange();
                              else
                                        player2.gotoAndStop(player2.currentFrame)
button1.addEventListener(MouseEvent.CLICK,buttonChange );
button2.addEventListener(MouseEvent.CLICK, buttonChange);

the code is very hard to understand
it's badly formatted
{}'s don't match
you aren't calling a playerChange function
this is my guess at something that might work for you
function buttonChange (e:MouseEvent)
          if(e.target.currentFrame == "frame1" )
                    if (e.target == button1)
                              e.target.gotoAndStop(player.currentFrame + 1);
                              playerChange();
                    else
                              player.gotoAndStop(player.currentFrame);
                              if (e.target == button2)
                                        e.target.gotoAndStop(player.currentFrame + 1);
                                        playerChange();
                              else
                                        player2.gotoAndStop(player2.currentFrame)
button1.addEventListener(MouseEvent.CLICK,buttonChange );
button2.addEventListener(MouseEvent.CLICK, buttonChange);

  • I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Maybe you are looking for

    • ITunes Install Problem Newest 6.0.2.23

      Windows XP SP2 Norton Anti Virus and Firewall Trying to install and get error messages: Error 1714: The older version of iTunes cannot be removed. Contact your technical support group. After reading through all these posts please don't tell me it is

    • Iphoto won't switch to my apple ID? due for an update but cannot update. help???

      I had recently purchased my Imac OSx from a family friend and did a complete update to the Mavricks software. I changed all the accounts to my own apple ID but cannot change iPhotos domain account to my apple ID. it shows another email and does not g

    • "The document could not be opened. Bad file handle."  Error

      Greetings, I have many operators opening documentation using acrobat reader 8.1.2. When the documents are opened, sometimes a change has to be done to the file. I use computer management to "kick" everyone out of the files, update the .pdf, and then

    • Possible to speed up processor?

      At the moment I cannot afford to buy a new gaming pc, and I am playing RIFT.  At lowest setting it is running good except about every 10 min the game lags out for a few minutes, can almost set your watch buy it.  Granted my comp is a bit old and outd

    • Brush won't function in Overlay Layer in PS 7

      Yes, I'm using a very old version of Photoshop. No I cannot upgrade because I cannot afford it and I don't use it professionally.  Anyway, I discovered to my great satisfaction recently how to create an Overlay Layer so that I could add color to an e