How can I insert record in DB ONLY if it does not already exist?

I am using Microsoft Access and I have 3 tables: jobs, KSAs, and JobKSAs. JobKSAs is a link table, that is, it connects the KSAs that relate to a particular job.

A KSA can be bound to more than one job, but it must be bound to a single job only once. (i.e., is there any reason why the Saudi Arabia "communication skills" should be linked to employment 'seller' more than once.)

Unfortunately, I discovered I could bind a Kingdom of Saudi Arabia for a job all of times that I wanted, that is, a new record would be added to the Table: JobKSAs.

KSA - Job link is created (or revised) using a form in a file titled "add_ksa.cfm".

Table: JobKSAs contains these fields:
JKID (the primary key of this table),
frn_JobID (foreign key referring to the unique ID of the given work) and,
frn_KSAID (foreign key referring to the unique ID of the given Saudi Arabia).

The form data are transmitted to the 'ksa_au_pro.cfm', that I hope will run a check to see if there is already a record in JobKSAs with the frn_JobID and frn_KSAID data. If such a file already exists, I don't want a new record added to the table: JobKSAs. In addition, I want the user to be taken to "ksa_already_linked.cfm", which informs the user that Saudi Arabia has already been given job-related.

If a record in Table: JobKSAs containing frn_JobID and frn_KSAID does not already exist, then I want to be added to the Table: JobKSAs, and for the user to 'ksa_confirm.cfm', that informs the user that Saudi Arabia has been linked to the job.

Here is my code for "ksa_au_pro.cfm".

Thanks for any help with this!

Luke

I think I've answered my own question. The code below seems to work:



SELECT *.
OF JobKSAs
WHERE frn_JobID = #form.frn_JobID #.
AND frn_KSAID = #form.frn_KSAID #.


Tags: ColdFusion

Similar Questions

  • How can I get Nitro PC installed properly, so it does not say that he may not support a file or a codec required that it blocks and other problems.

    How can I get Nitro PC installed properly, so it does not say that he may not support a file or the required codec, which it does in Windows Media Player, everything seems to go through there and Nitro prevents me from opening photos or electronic-mail/transfer their. Also, what are the appropriate programs to run files in the documents library and photos. recently, I lost all my documents, the files are there but now empty. It happened a little while before had spoken, by buying the GoFlex Seagate plug of iYogi I was stupid enough to buy their storys. Now that I told them that I used to pay $ 400 to renew my contract, which has more than a year and a half left in this regard that they were still treat me worse than ever. I even bought a program that is supposed to protect your bank account, but only have a debit card which they protect not only credit cards, it was not even mentioned in the contract or the sales pitch. The Seagate GoFlex is sitting here unplugged after that they could not challenge or whatever it is to recover after at least 4 attempts. Brief this cowboy got scalped, but if I can get the Nitro to block all my stuff I would be off to a good start to correct things. Also, I had a printer that was supposed to be a fax with all sorts of other gadgets they had me plug with a wire and wireless and never had to use the fax once and continue receiving invalid messages when I try to put in place something like snapfish, which seems to be an automatic link to my set of requirements. I'm lost.

    Maybe their support/forums?

    http://support.nitropdf.com/home

  • How can I disable the 'top sites' history of cleaning does not remove this and confusing and a risk to privacy

    How can I disable the 'top sites' history of cleaning does not remove this and confusing and a risk to privacy.
    It also serves as the sites I want to keep are my favorites
    Is there an alternatively an add-on for this

    Hi Wayne_a,

    If you are concerened about your privacy you can turn off this feature:

    Disable the new tab Page

  • I got an iphone 4 to a friend in the Canada. I want to use it here in the Philippines as a regular iPad reserved for wifi, how can I use it without sim card? It does not pass the activation page. Help please?

    I got an iphone 4 to a friend in the Canada. I want to use it here in the Philippines as a regular iPad reserved for wifi, how can I use it without sim card? It does not pass the activation page. Help please?

    You can activate it without a SIM card. If it is locked, it takes a SIM card by the carrier, for it is locked. The SIM card should not be linked to an active line of service, but it must be present to activate it.

  • How can I set up Vista so that the PC does not switch to another window (for example the Spy Sweeper alerts) while I am playing a game?

    How can I set up Vista so that the PC does not switch to another window (for example the Spy Sweeper alerts) while I am playing a game?

    Vista is not in control of this technique. Spy Sweeper needs to have an option to control that. If this isn't the case, then it is badly programmed. Flight of focus (go to another window) when it is actually needed is a big no-no for the design. I find this option, if I were you :)

  • I always can I not download photo elements 11 Please help me, how can I download you provide a link but it does not work pleas help me

    I always can I not download photo elements 11 Please help me, how can I download you provide a link but it does not work pleas help me

    Make sure that you are logged on the Adobe site, having cookies enabled, clearing your cookie cache.  If he continues to not try to use a different browser.

  • How can I insert a google doc jpg in an email, not as an attachment.

    I have a google doc that is a "flyer" in the color I want to insert in an email, a page rather than
    use as an attachment. How can I do? Anne063 is an adobe document.

    I want to do a promotional mailing to my list of clients who are hurt at the opening of attachments nototriously. So I want to put the flyer "in color" in the body of an email. How can I do this?

    Thank you.


  • I'm subscribe membership creative cloud, but individual membership limits to produce the only iPad app. How can I solve this problem? DPS-generating app does not appear iphone ipad option and membership requires that enterprise subscription.

    Hello

    I'm operating from digital publishing house, and I'm an individual subscriber of CC.

    When I use DPS generator app for ipad + iphone app, the DPS is only show iPad as a default option.

    And it is not possible to register kiosk app either.

    How can I do ipad + iphone app that supports fully the kiosks?

    Is it possible the upgrade from individual to professional/business subscriber?

    You will need at least a professional account of DPS. Creative cloud allows only single edition iPad apps.

  • Now the Export Module has disappeared, how do I convert a thousand goals as JPEGS (but only where they do not already exist)?

    I need to create files JPEG of hair in a few hundred subfolders.  They need to save in the same place as their original TIF and skip record if the jpeg already exists.

    A walk in the Park by using the defunct export Module.  I spent an hour studying how do I do this now, it is gone and I can't for the life of me get by.

    I investigated the Photoshop Image Processor and batch - not only it would be incredibly slow, as it is open each file in photoshop and then save again, there is no option to skip the file if it already has a saved jpeg file.  In fact, worse still, it just seems to add a "_1" on the end of the file it creates eventually give me hundreds of duplicates.

    Anyone knows how is to take about it?

    Dan

    You can do this with a script.

    For example this will convert all tif to jpg files in the current folder if they do not exist.

    #target bridge;
    if( BridgeTalk.appName == "bridge" ) {
        tif2jpg = MenuElement.create("command", "Convert TIF to JPG", "at the end of Tools");
    }
    tif2jpg.onSelect = function (){
    app.document.deselectAll();
    var sels = app.document.getSelection("tif");
    for(var z  in sels){
    var Thumb1 = new Thumbnail(sels[z]);
    var jpgName = Thumb1.spec.toString().replace(/tif$/i, "jpg");
    if(File(jpgName).exists) continue;
    app.synchronousMode = true;
    bm = Thumb1.core.fullsize.fullsize;
    app.synchronousMode = false;
    if(bm.width != undefined) {
    bm = bm.rotate(Thumb1.spec.rotation);
    bm.exportTo(new File(jpgName),100);
        }
        }
    };
    
  • How can you download pro Prime Minister when the icon does not exist in the clouds? [was: pr]

    How can you download pro Prime Minister when the iucon doesent exist cloud?

    In order to download the software, your computer must meet the system requirements to run the software.

    http://helpx.Adobe.com/x-productkb/policy-pricing/system-requirements-Premiere-Pro.html http://www.Adobe.com/products/premiere/tech-specs.html

    The usual for not being able to download reason is that Premiere Pro (and other video applications such as After Effects) are 64-bit only what they need for a 64-bit computer and a 64-bit operating system.

    If you use a 32-bit computer and operating system, and then you see the icon of Premiere Pro as the software will not work on your computer.

  • Question: How can I format Satellite A10 PSA10C - CD/DVD drive does not work

    Question: How can I format my laptop?

    The problem is that my CD-ROM does not work or it cannot read the CD.
    Help me guys and btw, is possible to format using USB Flash Disk?

    TNX in advance

    Model: PSA10C-035WM

    As much as I know with USB Flash Disk won't work.

    I really wonder why you don't buy replacement ODD. Compatible readers for this model of laptop old are more expensive. Replacement is very easy and you can do it alone.

    Wait a minute: you can remove the laptop HARD drive and connect to other PC / laptop as external one. If you can do what you want.

  • How can I remove PC Cleaner Pro when a popup does not close?

    A program called PC Cleaner Pro downloaded it on my Vista Home Premium computer. I tried to uninstall, but a pop-up window appears asking me if I really want to uninstall it, but it is impossible to answer, or to remove the pop up. How can I uninstall this program?

    The procedure described here might work:

    http://www.bleepingcomputer.com/forums/topic444836.html

  • How can I remove old agreements when the "delete" button does not work?

    In our account here several agreements that are years old, created by users is no longer working with us. But in the accounts of administrators who have access to these agreements now, the 'deleted' button is gray and does not? How get rid of these old contracts?

    Hello

    May be that the sender of a document cancel/remove the agreement.

    Thank you

  • How can I set at the point when the [key does not work because I have a German keyboard?

    Hi, I'm new to CS6 and worked through the book of Adobe After Effects. Some of the shortcuts do not work for me, probably because I use a German keyboard. In Chapter 11, I have problems because I need to select a layer, go to a specific time and then set to the point, but the [key does not work. Does anyone know a German equivalent or another way to set the point to? Otherwise, if I look at the colored bar in the timeline representing the layer that I want to put a point, can I get the same effect by dragging the edge of the colored bar until I reached the time limit? Or that fails to preserve the relationship of all images existing keys, etc. that I have implemented for a layer in a way that the [key would be? Grateful for any advice.

    Shift + o/a, o/a and so on. Also kann man mit Sttrg + shift + D die ebony einfach und den Teil parts, den man nicht parish, löschen. Ansonsten einfach evil die die Shortcuts.txt Datei deepening und oder das KeyEd Up Script dafur use squad.

    Mylenium

  • How can I send variable to new window since cflocation does not work?

    I have a form that sends data to itself using the < FORM action = "#getfilefrompath (cgi.script_name)" # "method ="post">"

    He is then saved or updated, then the flyer_id sent to pdf_view.cfm to display it in a PDF format. I use cflocation to go to another page with the flyer_id:

    < cflocation url = "flyer_pdf.cfm? flyer_id = #flyer_id #" >

    Where the flyer_id is used to query the appropriate information on the pdf_view.cfm. What I would really like to do is flyer_id varable automatically opens the page pdf_view.cfm in a new window, after economy/update the flyer.

    How is that possible?

    Hi rickaclark54,

    You can open a new window using javascript. Please take a look at the following example.

    Page name:OpenWindow.cfm

    Page name:openWindowcont.cfm

    #URL.flyer_id #.

    not available!

    in this way, you can open a new window and sends the data via a url.

    Thank you

    Sliman

Maybe you are looking for