Newbie needs simple help on triggers

Hello. I need to create a trigger and am very new to this language and would be delighted to help.

I have STUDENTS, BOOKS, LOAN tables.

When a student borrows a book, a composite entry is created in the table of the LOAN. In the table of books, there is an attribute 'Borrowed' by a Y or N.

When a new record with the same title as a book is created in the loan, the value of 'borrowed' must be set to Y. So far, I have the following, but I forgot that I need to insert a WHERE clause so that it is not up-to-date books, but only the book that activates the trigger.
I have a problem with it-how could I go to do this? Any help appreacited.

CREATE OR REPLACE TRIGGER book_returned_trigger
AFTER borrowing ON DELETE
FOR EACH LINE
BEGIN
UPDATE books
SET
borrowed = 'n';
END;

Hello

When you INSERT, all the: OLD columns have a NULL value (they weren't there before the operation).
Change the trigger AFTER INSERT to use: NEW instead of: OLD.

It is the reflection of a DELETION, where all the: NEW columns are set to NULL.

Tags: Database

Similar Questions

  • Newbie needs debugging help

    I'm new to Flex (since a CFer years) and I play with Flex in the hope to learn it. I just started playing with it and stumbled upon an error immediately. I hope that somepone there can point me in the right direction for this cryptic error message...

    Here is my simple Flex code...

    <? XML version = "1.0" encoding = "utf-8"? >

    < s:Application ' xmlns:fx = ' http://ns.Adobe.com/MXML/2009 "

    " xmlns:s = 'library://ns.adobe.com/flex/spark"" "

    "xmlns:MX ="library://ns.adobe.com/flex/mx"minWidth ="955"minHeight ="600">

    < fx:Declarations >

    <! - Place non-visual elements (e.g., services, items of value) here - >

    < / fx:Declarations >

    "" " < s:SkinnableContainer x ="59"y ="78"width ="200"height ="200"id ="container">

    "" " < s:Button x ="88"y ="72"label ="play"id ="play"enabled ="true"click =" http://97.91.79.206:8000/listen.pls"fontFamily ="Verdana"/ >

    < / s:SkinnableContainer >

    < / s:Application >

    The error is 1084: Syntax error: expecting identifier before the end of the program.

    So does that mean?

    Thank you

    ~ Clay

    Click is an event handler and need code, not the URL, it will change to.  NavigateToURL to launch a browser to a URL.

  • Newbie needs squirm help

    I saw this post:

    http://forums.Adobe.com/message/1794156#1794156

    I would like to know how to make a word or a series of letters, shake as if they feel cold (temperature wise).  I thought about using an animation technique fussing, but I am helpless as to where to start or how to apply the instructions in help for AE CS4 documents.  If there is someone who can guide me through this process I would be very happy.

    Sincerely,

    Markerline

    If I understand correctly what you want, it can be much easier - no need to expressions.

    As you probably know, After Effects has to a very powerful text animation engine, based on the idea of the animators and selectors. I suggest you take a look at the whole of the chapter on the text animation using After Effects.

    A host of text is essentially a group of properties that you add in the calendar that includes two basic elements - a number of properties of the animation (position, scale, rotation, followed, color fill and many others) and one or more text selectors, which are those used to choose which elements of the text are affected by these properties Add. Animation is done by how certain elements of text going in or out of a State 'selected' State 'not selected', going through everything in between. The beauty of it all, is that it takes only a couple of keyframes for control of dozens of characters. And you can do it very quickly, once you master the basics, instead of fighting with a thousand layers as it used to be.

    In this Ernestine cazel, according to me, you can get what you want by creating a host for position with a selector of fussing: whirlpool open the layer text and the "Animate" menu select "position". You will see this host has a range inside selector (this is the default selection). Delete it and from the menu 'Add' next to the host you created, choose selector > Wiggly (the earthquake selector is on the assignment of each character (or word or line if you wish) a random selection intensity that changes x times per second.) This intensity (amount) defines how strongly the position (or other real estate to host text) value affects this character/Word/line. So, if the selector given earthquake one amount of 30% for the second, it means that he will receive 30% of the value of position specified in the animation of text. And this amount changes all the time, from the wiggles per second confusing?

    To mimic this 'cold' you feel probably want to adjust the selector fussing for something quick (earthquakes per second) over a short distance (weak position values). You can set the selector fussing to create random quantities by line, depending on what you need, by word or by a character-based.

    Let us know if you need more information.

  • I hate the checkboxes. Need simple help

    Hi all

    I am trying to use checkboxes to add a value (a bit like a shopping cart). Where the user would pay if they check the different boxes. I want it where if they select in box 1 and 2 (named paymenttype and paymenttype2) that will change the value of the checkbox. How can I have the check boxes work? I tried to use "AND" to tell "If zone 1 and zone 2 are checked set the value of a $150"but it does not work. " Any help is very appreciated.

    This is the code on my functional (treatment page)

    < cfif IsDefined ("form.paymenttype") is true >
    < cfset paymentamount = "100" >
    < cfelseif IsDefined ("form.paymenttype") is set to TRUE AND IsDefined("form.paymenttype2") is set to TRUE >
    < cfset paymentamount = "150" >
    < / cfif >

    What you have seems ok, but is incomplete. You need to do to
    1 box not checked and box 2 checkedd
    No box ticked.

    What happens when you run your code?

  • BlackBerry Smartphones Newbie needing real help fast please

    Hello boys and girls need to know ASAP how to transfer all my contacts from the phone to my computer or memory card?

    madyin wrote:

    h how to transfer all my contacts from the phone to my computer

    I would recommend Desktop Manager, version 5, without the Media Manager. Download Desktop Manager here:
    https://www.BlackBerry.com/downloads/entry.do?code=A8BAA56554F96369AB93E4F3BB068C22

    madyin wrote:

    memory card?

    Can't do.

  • (Help) I need simple code for Bluetooth connection in the Eclipse IDE

    I need simple code for Bluetooth in the Eclipse IDE connection because I do not know tutorial http://docs.blackberry.com/en/developers/deliverables/11938/Use_a_Bluetooth_serial_port_connection_5...

    Please help me, thanks for all

    Use the tutorial for 5 SDK (or lower), each SDK has its own set of samples.

  • My camera a San Disk SDHC is full. You want to re - use? Need simple directions.

    Hello

    My camera San Disk SDHC card is full and I would like to re - use.
    I need simple instructions on how to scrub clean for re-use
    I do not have old photos. Can I reformat it or how
    I would remove the old photos to so I can re - use the card?
    step by step would be helpful.
    Thank you.

    Hello

    Your camera software will be instructions on erasing the internal memory of the device, or in your case, the external memory (map)

    See you soon.

  • I need serious help please... We do translations of textbooks, I searched an excessive type function but have been unable to find, we are working in indesign CS 5. It takes allot of time to delete the text and type in the new language.

    I need serious help please... We do translations of textbooks, I searched an excessive type function but have been unable to find, we are working in indesign CS 5. It takes allot of time to delete the text and type in the new language.

    Argh it's frustrating! I never noticed that the key was not working in InDesign.

    A bit of research and it turns out that the MS Office has this as an option in their software. But I can't find an option in the InDesign preferences to make it work.

    However, somethings do not appear in the shortcuts and preferences and are hidden triggers in InDesign that are accessible via a script.

    I'm not saying that it is possible to activate the button insert by using a script, but it is plausible that he can be activated.

    Maybe ask on the forum script? Scripting InDesign

    I know that this may be a possibility as with InDesign prior to export PDF documents interactive versions, there was previously no way to export PDFs interactive as unique pages if the gaps of.

    But the option to toggle this setting was scriptable.

  • Trying to get simple help to this hell hole...

    Excuise frustration, but the cycle and attempt to get the simple help here is almost impossible.

    My three questions that I think are simple... but I can't find the support to get the answers.  The questions are:

    1. I use Windows 7 Professional, 64 bit... I need to install the 32 bit CS5 as well?

    2. I downloaded CS5 Web should I keep in my computer the 1.69 Gig "Adobe CS5.1" folder that contains Photoshop CS5.1 read me and CS5.1 Adobe, who has the exe on it... or I can put it on a DVD?   I have to do something special to reinstall (if I ever needed to) with the DVD?

    3. now that everything is downloaded and installed what I keep Akamai_NetSession_Installer on my computer or I would uninstall and remove?

    Now that I asked the question, I have no instruction or idea of where I'm going to get a response if one is already posted.  This seems to be a very poor way to run a business...

    1. you do not have to install the 32-bit version.

    2. the Photoshop installer that you downloaded is what is on the DVD. There should be no special measures if you ever need to reinstalld with the DVD, it's like the installation, you just made.

    3. you can uninstall and remove the Akamai_NetSession_Installer.

    Ken rice

    Quality engineer

    CS Review

  • Need some help with FLASH

    Hello world

    I'm a very new to using flash 8 and I need som help.

    I know what it mifgt be a simple for some of you, but for me it's a chlange...

    I need to create a page with 6 buttons

    I can create a button without a problem and I can scrupt uncertain and it will open url

    However, if I have 4-5 buttons every thing work towards the top, down etc but the script does not work then link do not OUP page...

    I'm sure it's a simple soluton to this question

    Help, please

    I would like to join .fla file to show what I was doing, but it seems that it's not possible...

    Anyway please help if you can

    Sincerely

    L.

    Your instance names must match those that you use in the code.  The name of the instance provides the means for code assignment and control objects.  If you have btn1 as instance name, the code for this button should use this name...

    Btn1.onRelease = function() {}
    getURL ("http://www.google.com");
    }

    Think of it in terms of talking to the touch... you gave this button name "btn1", so your code needs to say "Hey, btn1, this.

    In addition, in order to keep things clean for yourself, you must create a layer for actionscript, where you take all the code you are currently distributed through the layers of each button and move to that layer.  I often create some to separate the different types of actionscript, variables, functions, actions, but you can do what suits you best.  But having it on separate layers makes it easier to find and manage.

  • Unable to open gmail and other google account services. Need urgent help. Firefox version is 29.0.1. Erasedeverythingcache/history + reset without addons.

    Unable to open gmail and other google account services. Need urgent help. Firefox version is 29.0.1. Deleted all cache and history + wiped without addons. Urgent help please. Same problem in other browsers ie opera/IE. Other Internet sites without problem.

    Personally, I've never had problems with ABP, but questions about ABP would be better answered in the AdBlock Plus forum where there are people more suited to respond as we only deal with technical support from Mozilla (e.. g the Fx of Firefox, Thunderbird, for Android)

  • Yahoo mail compose page announced the Indian Railways. Same is the case with some Gmail site. For this reason, it is difficult to compose mail. I need your help to clear advertising so that I can compose mail on the blank page, cordially. Maes

    Yahoo mail is normally empty. One can type mail in the blank part of . In my case the Compose page has rail logo. because I can't type my mail. Even if there is no problem in gmail-INBO isn't the case with Gmail site "A Google approach to email" or make up may site.
    For this reason, it is difficult to compose mail on yahoo mail. I need your help to clear advertising logo so that I can compose mail on a white page, cordially. eldiablo kumar

    You can also try to install Adblock Plus with Easylist subscription and check

  • yesternight I tried to improve my S5 iphone for a new virsion so at the end he asked me my icloud and the password I remember my password but not my icloud so I need your help please

    Yester night I tried to improve my S5 iphone for a new virsion so at the end he asked me my icloud and the password I remember my password but not my icloud so I need your help please.

    Seems that Apple has temporary problems with their activation servers. Many users report similar problem on older devices.

    Latest news: If you can not activate your iPhone, iPad, or iPod touch after installing iOS 9.3 - Apple Support

    r http://www.IMore.com/Apple-Working-iOS-93-Fix-Older-iPhone-iPad?utm_medium=Slide & utm_campaign = navigation & utm_source = im

    lder-IOS-devices-affected-by-bricking-bug/ http://9to5mac.com/2016/03/24/Apple-releases-New-Build-of-iOS-9-3-for-Users-of-o

    Hoppefully Apple will highlight the top soon.

  • buy an iphone 5s by amazon and I came with iCloud blocked an account... {I called the seller and does not that I do that I'm from Venezuela please need your help}

    buy an iphone 5s by amazon and I came with iCloud blocked an account... I called the seller and does not that I do that I'm from Venezuela please need your help

    No one here can help you. The device is locked activation. Since you have made the purchase by Amazon, you can check with them to see if they will stand behind it. No one on the forum, or Apple can help you remove the lock. Only the previous owner can do this. I suggest that you demand a refund, so let's start a claim with Amazon about this dealer.

  • Please I need your help in the next issue.

    Please I need your help in the next issue.

    I'm trying to change a driver of function generator to perform the following operations:

    starting with the initial value (for example 1 MHz) for some time (for example 10 sec.) and turn off the output for another time (e.g. 20 seconds) and then start again but this time with the frequency increment value (for example 1 MHz + 0.1 x n MHz = 1.1 MHz for n = 1, 2, 3,... n).

    The function generator model is ag33xxxGPIB and the link of the driver is http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E9066659CE034080020E748...

    There is no modifications are required for the driver, although there might be an example that you can edit. You use the function of the frequency set in a loop with a shift register. Initialize the registry to offset with the frequency of your departure and each iteration of the loop, add the value of the step. Exit the loop when the stop frequency is reached. Try to write something and after back if you have any problems. Fix what you wrote.

    It's pretty basic LabVIEW code. Did you do the online tutorials?

Maybe you are looking for