LOBS triggers and :new

The 9i (rel 1) documentation says you cannot read :new.lobcol in an after row trigger. I tried it becasue I had already written the code and I was able to read it. Is the documentation wrong or is there a loop hole? If it is a loop hole how big is it? Why is there a restriction?
Here is a simple test I ran in sql/plus
create table bill (c clob);
create table h_bill (ts date,action_cd varchar2(3), c clob);
1 create or replace trigger por_bill
2 after insert or update or delete on bill for each row
3 declare
4 c1 clob;
5 v varchar2(200);
6 begin
7 if inserting or updating then
8 v := dbms_lob.substr (:new.c,100,1);
9 end if;
10 if inserting then
11 dbms_output.put_line ('Inserting');
12 dbms_output.put_line (v);
13 insert into h_bill (ts,c,action_cd) values (sysdate,:new.c,'INS');
14 elsif updating then
15 dbms_output.put_line ('Updating');
16 dbms_output.put_line (v);
17 insert into h_bill (ts,c,action_cd) values (sysdate,:new.c,'UPD');
18 else
19 dbms_output.put_line ('Deleting');
20 insert into h_bill (ts,action_cd) values (sysdate,'DEL');
21 end if;
22* end;
SQL> /
Trigger created.
SQL> insert into bill values ('AAAAA');
Inserting
AAAAA
1 row created.
SQL> select * from h_bill;
TS C ACT
26-APR-02 AAAAA INS

Hi,
For old column values, You can directly select values from "deleted". You can refer to the new values using "inserted", like
CREATE TRIGGER trgAfterInsert ON [dbo].[Employee_Test]
FOR INSERT
AS
declare @empid int;
declare @empname varchar(100);
declare @empsal decimal(10,2);
declare @audit_action varchar(100);
select @empid=i.Emp_ID from inserted i;
select @empname=i.Emp_Name from inserted i;
select @empsal=i.Emp_Sal from inserted i;
set @audit_action='Inserted Record -- After Insert Trigger.';
insert into Employee_Test_Audit
(Emp_ID,Emp_Name,Emp_Sal,Audit_Action,Audit_Timestamp)
values(@empid,@empname,@empsal,@audit_action,getdate());
PRINT 'AFTER INSERT trigger fired.'
GO
Read
Sql server trigger
And the way to select from "deleted" is the same as the above one (that is to select from "inserted").
Many Thanks & Best Regards, Hua Min

Similar Messages

  • :new., lob columns and after insert ... for each row trigger

    I'm having this little problem with
    my update/insert triggers and lob columns.
    I have this little trigger:
    CREATE OR REPLACE TRIGGER BLOB_DATA_INSERT
    AFTER INSERT ON BLOB_DATA
    FOR EACH ROW
    BEGIN
    INSERT INTO BLOB_DATA_CHANGE VALUES(CHANGE_SEQ.NEXTVAL, 'I', :NEW.ID,:NEW.DATA);
    END;
    Which works except when the DATA column
    is a BLOB or CLOB (There is no data in :NEW.DATA. I even tried some of the DBMS_LOB package procedures)
    The one thing that is different for the lob columns is that the application updating
    the data is using a bind statement with returning, like:
    INSERT INTO BLOB_DATA
    VALUES(:ID,EMPTY_BLOB())
    RETURNING DATA INTO :DATA;
    COMMIT;
    Thanks for any help

    I'm having this little problem with
    my update/insert triggers and lob columns.
    I have this little trigger:
    CREATE OR REPLACE TRIGGER BLOB_DATA_INSERT
    AFTER INSERT ON BLOB_DATA
    FOR EACH ROW
    BEGIN
    INSERT INTO BLOB_DATA_CHANGE VALUES(CHANGE_SEQ.NEXTVAL, 'I', :NEW.ID,:NEW.DATA);
    END;
    Which works except when the DATA column
    is a BLOB or CLOB (There is no data in :NEW.DATA. I even tried some of the DBMS_LOB package procedures)
    The one thing that is different for the lob columns is that the application updating
    the data is using a bind statement with returning, like:
    INSERT INTO BLOB_DATA
    VALUES(:ID,EMPTY_BLOB())
    RETURNING DATA INTO :DATA;
    COMMIT;
    Thanks for any help

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • How to get the old and new statuses of CAD indicator (DRAW-CADKZ) while changing the status of document (DRAW-DOKST)?

    I want to delete the originals of document while changing the status of document based on CAD indicator status. For this I have implemented BADI DOCUMENT_STATUS01 and the method AFTER_CHANGE_STATUS. From this, the BADI is triggering whenever I am changing the document status and I can able to delete the originals. But here my requirement is to check the CAD indicator status to delete those originals. I.e. whenever the document status will change first time the CAD indicator status will also change. Based on that old and new status of CAD indicator I have to do delete operation.
    If anybody has an idea about SAP documents please help me
    Thank you,
    Regards,
    Ramesh

    First the document is exists in SAP in FR status. But when the CAD system will connect to SAP then the status is changing from ‘FR’ to ‘IN’ after that the CAD Indicator is populating from Blank to ‘X’.
    I want to know in which place the CAD indicator value is changing (any user exits available or any BADI s available when changing the CAD indicator) when connected to CAD system.

  • Triggering and reading on two HP/Agilent 34401A DMMs at same time

    Hi folks,
    I'm VERY new to LabVIEW and need some help with a measurement.  I'm using LV 8.2 with all equipment on GPIB.  I have two 34401A multimeters, triggered externally using an HP 33120A function generator.   I've downloaded the example vi's and drivers and everything works fine.  My problem is with the speed of the triggering and the synchronization between the two multimeters on the same trigger.  I've read the manual and for this multimeter, it claims it can be triggered and read over GPIB at 1kHz (display off, auto range off, delay= 0, 4.5 digits).  I'm finding it is nowhere near this speed.  The fastest I have successfully triggered and recorded the data was at 100 Hz, anything higher and it no longer stays in sync with the trigger (i.e. for 200 measurements at 100 Hz, I'm getting all 200 measurements, but over 3-5 seconds).  The trigger speed is the first problem.  The second problem is getting the two meters to take a reading at the same time.  One meter always lags the other (or vice versa) by 1 to 3 readings.  My goal is to continuously (for about 60 seconds) read both multimeters as fast as possible and at the same time (250-500 Hz would be fantastic) and write it to a file.  Can anyone give me some advice on this?  Is a software trigger the way to go?  Is there some limitation with GPIB that it cannot read/write to two devices this fast? 
    Thanks!
    P.S. I've been experimenting mostly with the example code provided by NI and a .vi posted in this forum thread (http://sine.ni.com/niforum/niforumforumDU=http://forums.ni.com/ni/board/messageboard.id=170&message....) hp34401a_-_testing.vi from Kunal.  If anyone could share some other example vi's it would be very helpful!

    Hi plasma420,
    I should have read your post more carefully - was thinking it was a 1 sec acquisition, not 1 minute!
    Getting your LabVIEW app to reliably respond to a measurement (detect/read) every 2 to 4 ms is going to be tough - especially if in a multi-tasking OS environment.  On a 2GHz box running a normal Windows XP or 2K install,  I suspect you could see an occasional "hiccup" even at 100Hz.  A bit of searching the forum turned up this old-but-still-valuable (even entertaining) post related to improving determinism of DAQ applications on a PC.
    Observation: The listed max measurement-rate of the 34401 (1000Hz) may assume the GPIB-bus is dedicated to one instrument - the requirement to read from two instruments sequentially, may necessarily increase time spent servicing each trigger - decreasing maximum theoretical throughput.
    The first rule for "high-speed" multi-sample DAQ - especially under Windows - is to make it a hardware task instead of a software loop;  the 34401 doesn't seem well suited here.  I hate to suggest this, but... have you considered purchasing one of NIs multi-channel DAQ devices?  With a $360 PCI 6010 + cable and break-out box, you could have one of the LabVIEW DAQ examples running in ~ 30 min.  The 6010 was the cheapest 16-bit board I could find, ask your sales-rep for other alternatives if you go this route...
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Fetching old and New Data in HRMS for 'Update' Transactions

    Hi All,
    I need to find out the old and new values for a person_id from HRMS tables (Per_all_people,Address,contacts etc) based on Person Id. Do we have any Standard Script or has someone prepared such script and can share with me. I am not expecting the Corrected records to be fetched as it overrides the same line but atleast for such records which comes under 'Update'.
    For Example, If for Perso_id 123, the Telephone# was 8888 and then it is updated to 9999. So my query Should return somethign like:
    Information From To Effective Date
    Telephone 8888 9999 28-Nov-2011
    Note: Can't use any triggers.
    Thanks

    Hi,
    You need to include a new keyfigure in the cube and map with both the new and old compcodes and the write a field routine with the logic that meets your requirement by passing the values of  PSPNR into the internal table and get the output for the keyfigure value. Also you use if else condition as per the requirement.
    Hope this helps...
    Rgs,
    Ravikanth.

  • Triggering and simultaneous measurements

    Hi everybody 
    I've written a Vi to to acquire data simultaneously from 7 devices. I'll be using cDAQ9178 with NI9203. The vi will acquire current values 4 to 20mA. Could you please check the attached file and let me know if I need to improve it.
    I have some question and I should be grateful if anyone can help me to answer them.
    1. How to open the binary file from write to measurement file by EXCEL?
    2. Is it better to use write to spreadsheet for data logging, if yes how to include the time column??
    3. I'm going to use external signal for triggering through PIF0 port, is it Ok to do that through dag assistance?? I've not tried yet but it seems straightforward?
    4. Finally I have another vi for valve control that should be triggered with the measurement vi, is their any way to do that?? I was thinking about notifiers but I don't know how to use them ?
    Sorry for asking to much  I really in urgent need of all of this. I should finish my data acquisition system by Tuesday 
    Best Regards 
    Solved!
    Go to Solution.
    Attachments:
    triggering and simultaneous measurements.vi ‏97 KB

    1. How to open the binary file from write to measurement file by EXCEL?
    If you select TDMS as the file format in the write to measurement file, you should be able to open it directly from Excel if you install the TDMS Excel Add-In. Be aware that at 1kHz data rate, you will exceed the capability of old versions of Excel to read the entire file in about 65 seconds. Newer versions can read more, but anything over a couple thousand points gets difficult to analyze. That is about my limit. Over this, I go to something else for analysis, such as LabVIEW or Mathematica.
    2. Is it better to use write to spreadsheet for data logging, if yes how to include the time column??
    The write to spreadsheet file is very inefficient for data logging and cannot be recommended. Given your data (an array of waveforms), TDMS is your best bet. The write to measurement file Express VI is the easy way to do this. I, personally, prefer the control I get from using the TDMS API directly. Note that under the hood, the output of the DAQ Assistant is an array of waveforms with individual t0s and dts. The t0s are all different due to the fact that your 9203 is a scanned device, not a simultaneously sampled device. It scans at 200kHz, so the differences are not large, but they are there. I would convert the DDT into an array of waveforms, then use the native TDMS API, but I have a lot of experience. Since you are in a hurry, the Express VI using TDMS is probably your best bet.
    3. I'm going to use external signal for triggering through PIF0 port, is it Ok to do that through dag assistance?? I've not tried yet but it seems straightforward?
    That should work fine. Given your continuous acquisition, the trigger will only start the acquisition, not gate it or trigger it at later times.
    4. Finally I have another vi for valve control that should be triggered with the measurement vi, is their any way to do that?
    We do not have enough information to answer this question. Specifically, how is the valve being triggered (boards being used, hardware interface, software interface). The ideal way would be to run it through the same cDAQ 9178 so that it can be synchronized through hardware. Software synchronization cannot be guaranteed better than about ±50ms. Read up on how to synchronize things through DAQmx and you should be good.
    Good luck!
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Triggering and Recording for specific duration

    Enclosed is the VI which I am using to trigger a electrical circuit for generating a spark.
    My system is very simple wherein I am generating spark in a vessel (by a triggred electrical pulse to HV generator) and measuring the pressure and temperature for a specified time of X and Y seconds after the spark.
    Part A:
    On a single Boolean input (TRUE) I would like to have following:  
    1. The Trigger pulse (USB 6009 device) should start and last for say 1.5 sec. which is input to my electrical circuit. Two DAQ max is used since current from one port is not sufficient to trigger the HV generator - electrical circuit.
    2. At the same time the pressure inside the vessel should be recorded for X sec. only (writing to file)
    3. Simultaneously the temperature should also be recorded for Y sec. only (writing to file)
    In the present VI, I have to keep the “Auto fire and record” button pressed to write the data to file. I have set up preset time for the trigger pulse.
    After triggering and recording for specific time 1.5, X and Y sec. the Boolean should go to FALSE position since long duration pulse to electrical circuit can be damaging.
    *** REQUEST SOME-ONE HELP ON THIS MATTER ASAP. ****
    Part B:
    Later I have to record the values of current and voltage measured at three locations by Tektronix TDS 3034B Scope (channel 1, 2  and 3) for a duration of 300 nano-seconds after the spark has occurred (i.e. say P sec. after trigger pulse and recording till P + 300 duration)
    This simple logic seems to be more difficult than, I expected, can some one please help
    / suggest in the right direction. (**VI attached**)
    Sorry for the language – New to Labview and not an electrical engineer. So pl. explain.
    THANKS
    Email: [email protected]

    Hi xseadog,
    Sincere apologies for inordinate delay in reply.
    Was blocked up with actually setting up the experiment in physical sense. Keeping all the bits and pieces in right place.
    The pressure sensor / transducer is Omega PX219 with output 0 – 5 V. Recording pressure reading every 0.001sec. immediately after the spark trigger (USB 6009 signal) is switched ON. (through labview)
    The temperature is K type thermocouple. Recording temp every 1/12 sec.(0.0833 sec) after spark.
    I have made a provision to trigger the spark manually – through push button. But this mode requires me to start recording press and temp., before pushing the button to generate spark. Hence keen on using the trigger initiated through Labview.
    Regarding relay controlled by the 6009, I understand that circuit is similar to that. The HV is generated through an EHT pulse generator, which is ready now, the only thing is it requires a trigger of 5 V and more than 10 mA.
    Manually when we generate spark, we do not require the USB 6009, so we get spark every time when button is pushed, it was only during the Labview trigging we diagnose this prob. And hence clubbed the two channels of 6009.
    As of now the loop time “Auto fire and record” which is the key for firing –spark generation –runs every 1.011 sec. can you suggest, how to reduce the loop time ?.
    Does the DAQ’s consumes time or which step consumes more time. I would request your comments.
    Thanks for the continuous help / replies.
    nnnsh

  • OIM 11g API to retrieve old and new values

    Hi
    In Self Service profile, when I modify user data, OIM is triggering an approval workflow. Our requirement is to use API which should retrieve old value and new value of the attribute when the request has been raised.
    We tried to use getTargetEntities() but it is retrieving only new values. Is there any other API which can do the needful?
    Thanks

    Use this :
    HashMap<String , Serializable> eventDataMap = new HashMap<String , Serializable>();
    eventDataMap.putAll(orchestration.getInterEventData());
    HashMap currentUserState = new HashMap(); //HashMap that contains old values
    HashMap newUserState = new HashMap(); //HashMap that contains new values
    currentUserState.putAll(((User) eventDataMap.get(CURRENT_USER)).getAttributes());
    newUserState.putAll(((User) eventDataMap.get(NEW_USER_STATE)).getAttributes());

  • Problem to use new abap editor and new abap debug.

    HI experts.
    currently using 640(patch 19) and GUI 640(patch 23).
    but when I activate new abap editor in se80 server dumps error
    ' Runtime Errors         MESSAGE_TYPE_X
    The current application program detected a situation which really
    should not occur. Therefore, a termination with a short dump was
    triggered on purpose by the key word MESSAGE (type X).'
    and new debug does not activating even though I switch to new debug.
    it works well both new editor and debug if I turn on new options when  I connect ECC6.0 with same GUI
    guess 640 server has not propery installed new editor and debug or something has to be checked.
    can anyone help me to activating these new functions?
    thank you.
    Lee

    There is a separate forum for the SAP GUI, please post your question over there and close this thread here.
    Thx

  • Mid Year Go Live-Australia and New Zealand

    Hi,
    We are implementing Mid Year Go Live for payroll for Australia and New Zealand.
    In case of India, we have schema INLK and list of technical wage types that need to be uploaded to T558B and T558C.
    SAP has delivered a note for Payroll India which gives the list of Technical wage types.
    Pls suggest what are the technical wage types to be uploaded for Australia and New Zealand and the schema to be used for Mid Year Go Live.
    Regards
    Yashika

    Hi,
    as far as i know, there is no such schema or special wage types except the ones that are used for LSMW before go live.
    In india, they might need the schema or technical wagetypes for the taxation purposes i guess which is different from AU or NZ.
    but australia/newzealand have simplified the taxation for software provides.
    Regards,
    LG

  • Macbook pro 15" mid 2010 i spilled water on keyboard now it wont power on if the battery is connected and the keys on keyboard doesnt work it works fine with no battery and external keyboard if i order a battery and new keyboard will every else work again

    macbook pro 15" mid 2010 i spilled water on keyboard now it wont power on if the battery is connected and the keys on keyboard doesnt work it works fine with no battery and external keyboard if i order a battery and new keyboard will every else work again lik it did before

    If you have records that show that you've taken your MacBook Pro in for a year to fix the machine, I would escalate the problem to Apple Customer Relations - unfortunately I don't have a number for Spain.
    It would only seem logical to me that if you've been trying to have the machine repaired during the time that the 'recall' was in effect that you should be eligible for a new logic board. But only customer relations will be able to make that call.
    Good luck - take the issue as high up the food chain as you can and see what happens.
    Clinton

  • Pop-ups and new tabs opening when I try to browse

    Hello
    I'm having trouble with pop-ups and new tabs for 'Mackeeper' among others, launching themselves in Safari on my MacBook Air. This has only just started after having the laptop for 3 months.
    Operating system: OS X 10.9.4 (13E28)
    Speed: 1.4 GHz Intel Core i5
    Storage capacity: 4 GB 1600 MHz DDR3
    I have tried troubleshooting by looking in 'Extensions' but there's nothing to remove. I've also tried Forum Member Linc Davis' advice, but unfortunately that's not working either.
    I've tried all of the suggestions below, but nothing's working. It is driving me bonkers, so if anyone can help I would be most grateful.
    Thank you
    Jess
    Linc DavisJul 10, 2014 8:22 AM Re: ANNOYING MACKEEPER TABS AND POPUP ADS
    Re: ANNOYING MACKEEPER TABS AND POPUP ADSin response to chickashnaz
    You installed the "DownLite" trojan, perhaps under a different name. Remove it as follows.
    Malware is constantly changing to get around the defenses against it. The instructions in this comment are valid as of now, as far as I know. They won't necessarily be valid in the future. Anyone finding this comment a few days or more after it was posted should look for more recent discussions or start a new one.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    /Library/LaunchAgents/com.vsearch.agent.plist
    Right-click or control-click the line and select
              Services ▹ Reveal in Finder (or just Reveal)
    from the contextual menu.* A folder should open with an item named "VSearch" selected. Drag the selected item to the Trash. You may be prompted for your administrator login password.
    Repeat with each of these lines:
    /Library/LaunchDaemons/com.vsearch.daemon.plist
    /Library/LaunchDaemons/com.vsearch.helper.plist
    /Library/LaunchDaemons/Jack.plist
    Restart the computer and empty the Trash. Then delete the following items in the same way:
    /Library/Application Support/VSearch
    /Library/PrivilegedHelperTools/Jack
    /System/Library/Frameworks/VSearch.framework
    Some of these items may be absent, in which case you'll get a message that the file can't be found. Skip that item and go on to the next one.
    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Uninstall any extensions you don't know you need, including any that have the word "Spigot" in the description. If in doubt, uninstall all extensions. Do the equivalent for the Firefox and Chrome browsers, if you use either of those.
    This trojan is distributed on illegal websites that traffic in pirated movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect much worse to happen in the future.
    You may be wondering why you didn't get a warning from Gatekeeper about installing software from an unknown developer, as you should have. The reason is that the DownLite developer has a codesigning certificate issued by Apple, which causes Gatekeeper to give the installer a pass. Apple could revoke the certificate, but as of this writing, has not done so, even though it's aware of the problem. This failure of oversight is inexcusable and has compromised both Gatekeeper and the Developer ID program. You can't rely on Gatekeeper alone to protect you from harmful software.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combination  command-C. In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

    Click here and follow the instructions, or if there’s a type of adware not covered by them on the computer, these ones. If you're willing to use a tool to remove it(you don't need to, but may find it easier), you can instead run Adware Medic; this link is a direct download.
    (122872)

  • New home and new WIFI sluggishness

    I recently moved in with my girlfriend. At my last location, I quit using wifi, was connected directly via ethernet to my cable internet modem. I was also Airport sharing the connection for my kids' iMac.
    Now in her new place (and new wifi), I can connect with full bars via Airport, but many sites do not load the first time. I need to refresh the browser several times to get many sites to load.
    I have turned off the internet connection sharing as well. Is it some type of DNS problem?
    clueless... assuming it has something to do with the move.

    HI greengrass,
    There is no real procedure for you as a customer.  You can place an order for broadband and phoneline simultaneously.  BT will take care of the rest.
    If there a line in the new place then it might need an engineer call out in order to get it up and going but this will be made clear whenever your order is placed. 
    TX
    Craig
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)”
    td-p/30">Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • New Ipod and new computer-how to transfer

    I just got the new ipod video and had the 20gb. I now have a new computer and new ipod. How do I transfer my songs to my new ipod and computer?
    any help would be appreciated.
    D

    If you transfer your library from the PC to the Mac, and then plug in your new ipod to the new Mac, a question will pop up asking you whether you want this computer's library to be transferred to the iPod. Click Yes, and it will start synching with whatever is in the library.
    You can also use some programs, like "Senuti" (for mac, freeware) to rip off the contents FROM your iPod TO your new Mac. I personally like Senuti since it has an iTunes-like interface except in reverse.

Maybe you are looking for