Whats the best way to check table before form deletion or update ?

Hi, I have a func_staff table made up of a composite key - func_no and staff_id. I have a form where the datablock references this table.
I need to be able to check that before a func_no and staff_id combination on the form are written to the database that that combination does not already exist in the table.
What would be the code for that ? I've tried stuff like IF EXIST statements and even a select statement but I totally worded it it wrongly.
To DELETE an entry in that same table, would the best way to be create an LOV for both func_no and staff_id, the problem with that would be if a user selected a combination that does not exist ? Could I create a combined LOV that would populate each field ?? (this way I could be 100% sure that the selected combination is valid)
Thanks Peeps.

hi,
you can try and use the count(*), before deleting and updating
lets say
select count(*)
into l_count
from table_name
where column1 = :block.column1
and column2 = :block.column2;
if l_count <> 1
then
insert into..........
else
show error message;
raise form trigger failure;
end if;
similarly u can use l_count before deleting.
regards,
Mayank

Similar Messages

  • Whats the best way to check the speed of my macbook Pro

    Hi people.
    I just wanted to get some advice on how my Mac is running, as i think it has become slower since i bought it and wondered if it is anything i have done or should be doing
    First of all, i have a MBP bought mid 2011, has thunderbolt port, its 2.3Ghz Intel i5, 4GB 1333Mhz DDR3, 320Gb HD and now running Mountain Lion.
    When i first got it i thought it was quicker than anything i have used previously, an example would be when i click to open an apple program e.g. iphoto, the icon jumped up and then seconds later it was open. Now any program i try to open, it seems to take much longer, it bounces for a while and then finally opens.
    I have not got any clutter on the laptop, i keep all my files on a network hard drive. The only thing i have is 80Gb of photos stored under iphoto and i have Windows XP running on a 40Gb partition using Bootcamp.
    I am thinking about getting rid of the XP on my mac to see if it helps, but thought i would ask here first. I need XP as it allows me to run programs which dont support Apple OS X.
    I was also wanting to know the best way to store photos, would i be able to store the photos on my network drive and have iphoto work exactly the same..?
    Help much appreciated.
    Thank you.

    Hi people.
    I just wanted to get some advice on how my Mac is running, as i think it has become slower since i bought it and wondered if it is anything i have done or should be doing
    First of all, i have a MBP bought mid 2011, has thunderbolt port, its 2.3Ghz Intel i5, 4GB 1333Mhz DDR3, 320Gb HD and now running Mountain Lion.
    When i first got it i thought it was quicker than anything i have used previously, an example would be when i click to open an apple program e.g. iphoto, the icon jumped up and then seconds later it was open. Now any program i try to open, it seems to take much longer, it bounces for a while and then finally opens.
    I have not got any clutter on the laptop, i keep all my files on a network hard drive. The only thing i have is 80Gb of photos stored under iphoto and i have Windows XP running on a 40Gb partition using Bootcamp.
    I am thinking about getting rid of the XP on my mac to see if it helps, but thought i would ask here first. I need XP as it allows me to run programs which dont support Apple OS X.
    I was also wanting to know the best way to store photos, would i be able to store the photos on my network drive and have iphoto work exactly the same..?
    Help much appreciated.
    Thank you.

  • Whats the best way to check weather a file exists online, or not?

    Hi!
    I need to show an Image File in my app which may have different sizes. _1.jpg, _2.jpg and so on.. If, for example, _2.jpg does not exist, I have to take _1.jpg.
    So my question is: is there a better way instead of making/allocating a pic and asking pic != nil ?
    thx!
    alex

    Hi Alex -
    The subject line says "file exists online, or not?". Are you trying to check existence at a network site, or the local file system? I'll cover the local fs first, since that's the easiest. If you need to search a remote site, I think we'll need some more details.
    Assuming an iPhone project (not specified, but your usual topic), NSFileManager will probably be all you need unless the files are localized and/or in the application bundle, in which case you'll want NSBundle. For example, say you're storing all the jpg's in the user's cache directory:
    #define MAXFN 5
    // return nil or the path to the file with the highest numeric suffix
    - (NSString)getPathForBestFile:(NSString)baseName extension:(NSString*)ext {
    NSString *bestFilePath = nil;
    NSFileManager *fileManager = [NSFileManager defaultManager];
    // locate the user's cache directory
    NSArray *paths = NSSearchPathForDirectoriesInDomains(
    NSCachesDirectory, NSUserDomainMask, YES);
    NSString *cacheDirectory = [paths objectAtIndex:0];
    NSLog(@"cacheDirectory=%@", cacheDirectory);
    // loop through file names with numeric suffixes
    for (int i = 1; i <= MAXFN; i++) { />/
    NSString *fileName =
    [NSString stringWithFormat:@"%@_%d.%@", baseName, i, ext];
    NSString *filePath =
    [cacheDirectory stringByAppendingPathComponent: fileName];
    NSLog(@" filePath=%@", filePath);
    if ([fileManager fileExistsAtPath:filePath])
    bestFilePath = filePath;
    return bestFilePath;
    If you need to use NSBundle, see pathForResource:ofType:. If you need to determine the existence of a file at a network site, please give us some details about the kind of server and how much you'll know about the possible file locations.
    Hope that helps!
    - Ray

  • What the best way to insert advertising before a movie?

    Hi!
    I've remarked on the web that many clips are precede by an advert. Does this advert is added in the code? Or, there is a way to tell the player to play first, the advert, and secondly the movie?
    Thanks for take to time to answers me.
    Daniel

    Hi! Thank you very much. Can you point me a tutorial to achieve this task?
    Daniel

  • Whats the best way of using "tables" in XMLForms

    Dear Guru's,
    I have the following query for you... I'm currently working on a XMLForm for a customer.
    The XMLForm is for promoting "Specials". A special is a featuredproduct that is available in the SRM Catalog for purchasing.
    Its format is something like this:
    1. Header - Textfield
    2. Description - HTML Area
    3. Availability info - Text Area
    4abc. Images - Image
    5. Product Details - table with 3 columns and n rows now implemented as - HTML Area.
        The 3 columns contain Productnumber; Productdescription; Price.
    6. Remarks - Text Area
    7. General Info A - Text Area
    8. General Info B - Text Area
    9. General Info C - Text Area
    Now its regarding number 5 the Product Details. As mentioned I implement it as a HTML Area now but I want to make is more easy for the end-user. Does anyone have an idea how to make it better without changing the xml/xsl or custom development (so only with the XMLForms builder).
    Thanks in advance and Cheers,
    Benjamin Houttuin

    I figured it out myself...
    If you creat a custom node in the datastructure as string. In the default field add the html code of a empty table.
    Hhen linked to a HTML edit field the Table will be "pre-loaded" in the HTML edit field and tada your table is born.
    Users now can add rows an columns when needed.
    Cheers,
    Benjamin

  • Mac Pro won't start up.  What's the best way to check the power supply?

    Hello. I'm having a severe problem with my 2007 Mac Pro. The symptoms are very easy to describe. The computer apparently shut itself off overnight, and when I press the power button to turn it on, absolutely nothing happens. No lights, no chime, no signs of any power whatsoever in the computer. I have never had major problems with the computer before. (Although I had recently noticed some minor skipping problems with streaming videos and Firefox had started hanging occasionally.)
    So far, I have checked the power cable and the power outlet. I have also reset the SMC (holding in the Power button for 5 seconds with the unit unplugged). I am unable to see any light in the diagnostic LEDs (including LED 1) when I press the DIAG_LED button on the logic board.
    While I welcome other suggestions, all I can figure is that this is either a power supply problem or a major logic board failure, but I don't know which. I have a multimeter and would like to test very directly if the power supply is the problem, because they are very expensive and obviously I do not want to order a replacement supply if it would not fix the computer. Does anyone know what the best way to test the supply directly is? What pins on what cable should I test, and what voltage should I look for?
    Also: No the computer is not under any warranty. If at all possible, I would like to fix this myself. Thanks for any help you can give.

    Well, I may have found the answer to my question as to why replacing the fuse dows not seem to be encouraged. I cut out the failed fuse (fast fuse, ceramic, 16 Amp 250V), and replaced it with another that was as close to it in spec as I could find (15 A instead of 16). Then I put the supply back in the case.
    When I tried to plug it in, I got an immediate spark, followed by an acrid smell from the power supply. Later inspection revealed that the new fuse blew, as did another component nearby (not sure what it was) where I could see blackening and the smell was concentrated. At this point, I would consider myself lucky if the power supply didn't take anything else on the computer out with it.
    Lesson learned; will try a new power supply and go from there.

  • I am getting pop ups on safari and firefox lately and am worried i may have malware or something now on my computer doing this. What is the best way to check this out for sure and remove it?

    I am getting pop ups on safari and firefox lately and am worried I may have malware or something now on my computer doing this. What is the best way to check this out for sure and remove it?

    Please review the options below to determine which method is best to remove the Adware installed on your computer.
    The Easy, safe, effective method:
    http://www.adwaremedic.com/index.php
    If you are comfortable doing manual file removals use the somewhat more difficult method:
    http://support.apple.com/en-us/HT203987
    Also read the articles below to be more prepared for the next time there is an issue on your computer.
    https://discussions.apple.com/docs/DOC-7471
    https://discussions.apple.com/docs/DOC-8071
    http://www.thesafemac.com/tech-support-scam-pop-ups/

  • I want to connect a Mac mini to a Samsung 40", Whats the best way to do this?

    I want to connect a Mac mini to a Samsung 40" LED tv to use as the monitor, whats the best way of doing this?

    Understand that there is one HDMI port on your TV that is specifically designated for PC connectivity. The order that the TV or Mini are powered on may determine your results. For your specific TV model, check buyer reviews on Amazon or elsewhere that can include optimum TV/Computer settings adjustment for improved viewing results.

  • I want to run Quicken through Windows on my macbook pro, whats the best way to do this?

    I want to run Quicken 2012 through Windows on my macbook pro, whats the best way to do this?
    I have been looking at Parallels or VMware in order to use Windows but then I will also need to get a Windows license. Just looking for the most inexpensive way possible as this will probably be the only Windows app I run.
    Also looking at this CrossOver software which says you dont need Windows license. Anyone used this before? had success?

    CrossOver's website has a list of software it has certified as working or working with known issues - Quicken 2012 has a bronze rating meaning it runs but with enough issues that it isn't recommended. In other words, "Run away!"
    Get a copy of Windows 7 OEM from Amazon or New Egg and give it a try with VirtualBox (an open source virtualization program). If VirtualBox doesn't cut it you can always buy VMWare or Parallels.

  • Whats the best way to go about load balancing Exchange 2010 CAS

    My server guys want to LB the Exchange 2010 client access servers, this will be the 7th Context on my Ace 4710.
    see table for ports that are used
    Port
    Usage
    25
    smtp
    80
    http various
    110
    POP3 clients
    135
    RPC end point mapper
    143
    imap4 clients
    443
    SSL various
    993
    secure imap 4 clients
    995
    secure pop3 clients
    6001
    rpc related outlook anywhere
    6002
    rpc related outlook anywhere
    6003
    rpc related outlook anywhere
    60200
    rpc CAS
    60201
    exchange address book service
    whats the best way of going about this?
    do I just LB the IP addresses of the Servers and ignore the ports?
    do i have to do anything special for ports 993 and 995 secure imap and pop?
    I am sure there are more questions I shold be asking!

    OK
    so If I have a single serverfarm with all services do I filter on  the virtual
    address something like below?
    class-map match-any EXCH_vip
    match virtual-address 172.16.93.2 tcp eq 25
    match virtual-address 172.16.93.2 tcp eq 80
    match virtual-address 172.16.93.2 tcp eq 110
    match virtual-address 172.16.93.2 tcp eq 135
    match virtual-address 172.16.93.2 tcp eq 143
    match virtual-address 172.16.93.2 tcp eq 443
    match virtual-address 172.16.93.2 tcp eq 993
    match virtual-address 172.16.93.2 tcp eq 995
    match virtual-address 172.16.93.2 tcp eq 6001
    match virtual-address 172.16.93.2 tcp eq 6002
    match virtual-address 172.16.93.2 tcp eq 6003
    match virtual-address 172.16.93.2 tcp eq 60200
    match virtual-address 172.16.93.2 tcp eq 60201

  • Whats the best way to stream videos?

    whats the best way to stream video thru plumtree portal?What all it requires? (technology/application/server/plumtree development?)

    Hello Kuljit,
    For the windows platform you could set up Windows Media services. It can be configured to play all sorts of media files. I created a "radio station" portlet that multiple channels and from the portal I could select a drop down and the station would play that stream. I would make sure that media services are not being gatewayed and that anyone that can see your portal can see the videos. Here is my html that I made a portlet out of: This will not show the video window. You can increase the size of the object to show the video window with controls. Check out MSDN online for configuration of the <object>
    <FORM NAME="streamForm"> <INPUT NAME="btnPlay" TYPE="Button" VALUE="Play" onclick="MediaPlayer1.controls.Play();"> <INPUT NAME="btnStop" TYPE="Button" VALUE="Stop" onclick="MediaPlayer1.controls.stop();"> <select name="musicGroup" onChange="changeStream()"> <option value="">-- Select --</option> <option value="barenakedladies">Barenaked Ladies</option> <option value="pinkfloyd">Pink Floyd</option> </select> </FORM>
    <OBJECT CLASSID="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" ID="MediaPlayer1" height="0" width="00"> <PARAM NAME="Name" VALUE="MediaPlayer1"> <param name="uiMode" value="invisible"> <PARAM NAME="TransparentAtStart" Value="true"> <PARAM NAME="AutoStart" Value="true"> <PARAM NAME="AnimationatStart" Value="false"> <PARAM NAME="ShowControls" VALUE="0"> <PARAM NAME="autoSize" Value="false"> <PARAM NAME="displaySize" Value="0"></OBJECT><script language="javascript">function changeStream(){ df = document.streamForm; if(df.musicGroup.selectedIndex != 0) {  MediaPlayer1.url = "mms://MBRUCELT-W3k/"+df.musicGroup[df.musicGroup.selectedIndex].value; } }</script>
    This works for the latest version of Window Media Player. The mms:// in my script is a call to Windows Media Services. That is the part that should be accessible from outside the portal.
    HTH,
    Michael [email protected]

  • When travelling and using 3G what the best way to turn off all internet connections except web browser on a Mac pro?

    When Travelling and using a 3G mobile stick for internet connection My MacPro burns through a lot of expensive connection data time doing background stuff such as checking messages, email, ungrades etc. Whats the best way to turn all this off so that intenet is only accessed when I request it?
    Thanks

    To turn off iMessages see this thread - https://discussions.apple.com/thread/4504796?start=0&tstart=0 
    For iCloud, read the article - http://support.apple.com/kb/PH2613 

  • HT3819 I have 2 Ipod touch's, one a 64gb and one an 8gb.  Whats the best way to use them both on the same itunes account?

    I have 2 Ipod touch's, one a 64gb and one an 8gb.  Whats the best way to use them both on the same itunes account?

    Click here for options.
    (64410)

  • Whats the best way to transfer everything from my old macbook pro to a new mac mini, i have a external hard drive which i backup to regularly via time capsule

    whats the best way to transfer everything from my old macbook pro to a new mac mini, i have a external hard drive which i backup to regularly via time capsule

    Check out > OS X Lion: How to use Migration Assistant to transfer files from another Mac

  • Wipe my hard drive clean except for the OS whats the best way?

    I need to wipe my hard drive clean except for the OS whats the best way?

    From Kappy (note: with this method, you will need to update to the present OS version using the appropriate Combo Update from Apple Downloads.)
    Boot from the OS X Installer Disc One that came with the computer. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities (Installer menu if using Panther or Jaguar) menu. After DU loads select the startup volume from the left side list then click on the Erase tab. Set the format type to Mac OS Extended (Journaled) then click on the Options button. Select the one pass Zero Data option and click on the OK button. Then click on the Erase button.
    Note: You can skip the Zero Data option if you are not concerned about removing sensitive personal data from the hard drive. If you choose to skip this part of the process then it is possible for others to recover data from the hard drive. The Zero Data procedure will prevent others from getting access to your personal information.
    This process will take 30 minutes to several hours depending upon the size of the hard drive. After formatting has completed quit DU and return to the installer. Now complete the OS X installation. At the completion of the installation do not restart the computer. Instead just shut it off. The next user will be presented with the Setup Assistant when they turn on the computer just as it would if new out of the box.
    https://discussions.apple.com/message/12364050?messageID=12364050#12364050

Maybe you are looking for

  • Member formula IF statement syntax

    Hi guys Can someone assist me with the syntax of the IF statement on a member formula. On the measure "Total Cost", i would like to apply a formula which calls value loaded to a series of other measures (m1, m2, m3, etc) such that if the Number of ba

  • OBJECTS_OBJREF_NOT_ASSIGNED_NO-Errorwhenaccessing Talent Profil ser fromESS

    Hello SDN Team, I have implemented a customized WD service for Talent profile. When this service works from Development instance, i'm facing an issue in Quality environment. I have ensured that all the change requests are in place in Quality environm

  • Installer, application manager and camera raw plug in issues

    Hi - I need help. I'm running on Windows 7. I have just upgraded Photoshop to CS5.5 from CS4 (on my laptop not a creative cloud version). I have since uninstalled Photoshop CS4. I was trying to install the camera raw plug in 6.7.1 but it would not in

  • SAP TM CONTAINER MANAGEMENT

    Have following Queries if someone can higlight on this. - Does SAP TM 9.0 support container management  solution from shipper prespective.      How to we  map the settings for  a container selection on the basis of cost. Example I want to select  a 2

  • Toast 6.0 : How to stop DVD from repeating itself

    I have created a DVD slideshow, using Fotomagico. Thus producing a .dv format for burning with Toast 6.0. DVD plays fine except repeats itself. Could it be Toast ? Cannot find proper settings in Fotomagico.