Triggers and Cursors...........!!!!!!!!!

Hai friends i have one doubt and i request please clarify that
Can we create cursors in Triggers?

sql>
create or replace trigger trig100 after insert on emp
begin
for rec in (select * from dept) loop
  null;
end loop;
end;
show error;
Trigger created.
No errors.
sql>
create or replace trigger trig100 after insert on emp
declare
cursor csr is select * from dept;
begin
for rec in  csr loop
  null;
end loop;
end;
show error;
Trigger created.
No errors
Message was edited by:
        jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Sql query to  know the number of triggers and cursors present in a schema?

    friends,is there any way to know the number of triggers and cursors preseent in a schema.
    thanks in advance..

    what do you mean by triggers in a schema? is it the triggers owned by that schema? or the triggers applied on tables owned by that schema? remember you may own triggers applied on the tables belong to other schemas. Anyways, all this information can be extracted from oracle dictionary using a combination of all_triggers and all_tables.
    As far as cursors, please elaborate. Do you mean cursors declared in PL/SQL blocks?

  • Autocommit and Cursor commit Behaviour

    Hi,
    I need help to set and get the Autocommit and Cursor commit behavior attributes
    in Oracle.
    AUTOCOMMIT:
    For DDL Statement, this attribute is set while executing the OCIStmtExecute() api
    as below:-
    r = OCIStmtExecute(d->svc, d->sql, d->err, 1,0,
    (CONST OCISnapshot *) NULL,
    (OCISnapshot *) NULL,
    d->transaction ? OCI_DEFAULT :                                         OCI_COMMIT_ON_SUCCESS);
    For DML Statement, from the OCI documentation the database parameter attributes
    support OCI_ATTR_AUTOCOMMIT_DDL with the values OCI_AC_DDL and OCI_NO_AC_DDL.
    Since this is a parameter attribute, I couldn't set using OCIAttrSet() API.
    I need help in implementing AUTOCOMMIT for both DDL / DML statements.
    CURSOR COMMIT BEHAVIOUR:
    Similarly, I have observed that Oracle support cursor commit behavior attributes
    using OCI_ATTR_CURSOR_COMMIT_BEHAVIOR and the attribute values are OCI_CURSOR_OPEN and OCI_CURSOR_CLOSED.
    I have tried setting this attribute as below:-
    ub1 nCommitType = OCI_CURSOR_OPEN;
    oraRC = OCIAttrSet((dvoid *)d->svc, (ub4)OCI_HTYPE_SVCCTX,
         (dvoid *)&nCommitType,
         (ub4)sizeof(nCommitType),
         OCI_ATTR_CURSOR_COMMIT_BEHAVIOR, d->err);
    This always fails with the error ORA-24315: illegal attribute type.
    I need help in setting this attribute using OCI.
    Another approach to set Autocommit / Close Cursor attributes:-
    Oracle support SET commands for autocommit and closecursor, I have prepared
    and executed these set commands using OCIStmtPrepare and OCIStmtExecute api. The OCIStmtExecute() API fails to execute the below command texts.
    SET AUTOCOMMIT ON/OFF
    SET CLOSECURSOR ON/OFF
    Is it the right method of setting these attributes?
    Thanks,
    Sankar.P.

    Hi.
    You are trying to commit "child" information before your Parent information is commited.
    Can you describe how you dragged & droped your views?.
    Dragged relationship views or single views?.
    Can you put output log with jbo with FINEST level?.
    To find a solution try next solutions:
    1) Disable "strong" association between your parent-child entities. To achieve it follow next steps:
    - Go to your "Assoc" that describes your foreign key.
    - In "Realtionship" tab, "Behaviour" disable "Composition Association".
    Image: http://1.bp.blogspot.com/-Em8NZvjOUzo/T_NQbJTcLjI/AAAAAAAAAm4/hPsDwtEhJQ4/s1600/4.png
    2) Drag and Drop correct views as a Master-Detail (cascading views in your Data Control).
    http://2.bp.blogspot.com/-1By5vNNGMFQ/T_NQdYzexKI/AAAAAAAAAnE/DGn7Gr0RSDw/s1600/6.png (in spanish).
    In the image, drag & drop PortalwebView2 is the correct way for Master-Details tables. Probably you dragged PortalwebView1 that have dependecy to master table.
    Steps that you have followed:
    - Drag & Drop dependen View Object as a Master-Detail with two tables.
    - Add Create operations from these views to create Rows.
    - Add Commit general operation from Data Control.
    Try to drag & drop Master-Detail views correctly before disable association.
    PD: To try your model faster run Model project instead of your application.
    Regards.
    Edited by: Daniel Merchán on 30-jul-2012 12:05

  • I can edit on Premiere Pro 6 files, but after a dozen keystrokes, the space bar and cursor keys stop working while the save function works

    I can edit on Premiere Pro 6 files, but after a dozen keystrokes, the space bar and cursor keys stop working while the save function, render workspace function, export file are still operational. How can I fix it so I may complete my assignment?
    Besides DaVinci Resolve, Adobe Creative Suite 6 is the only software on the machine. I am using Windows 7 Professional 64-bit Operating System on AMD FX 6100 six-Core Processor at 3.31gHz and 32 GB RAM memory. There are two SLI-bridged GTX680 NVidia cards.
    The software was very stable for the last six months, working with 720P proxy files from 2.5K masters (Blackmagic Design Camera). I am working on a feature-length project that exceeds 1000 edits. I have broken the file into 2 one hour segments.
    I have deactivated the software before reinstalling the entire OS from scratch. PP6 was very stable for 48 hours. Then the freezing space bar returns. After a dozen strokes into the project, same problem.  I have made cache files store next to originals, I have deleted preview files if they were corrupted and causing instability. Am I missing something?
    I have Microsoft Security Essentials for virus protection. I double checked the memory for damage/defect. Nothing says that the motherboard or other components are damaged.
    I am in film competition overseas and need to have deliverables in less than a month's time.  I lost the last two weeks troubleshooting and this crisis came at an inopportune moment of the project.
    Any assistance would be greatly appreciated.

    Still getting software freezes but found a way to mitigate for the mean time.
    Upon launching Adobe Premiere Pro, hit CTRL-ALT-DEL to launch TaskManager as well.
    You will want to highlight Adobe QT32 Server.exe
    Right click and select "End Process Tree"
    You will get considerable stability in the program, long enough to get timing of cuts done. Be sure to save often.
    If the program freezes, do not hit Save. You definitely want to avoid saving the corruption into your TimeLine
    CTRL-ALT-DEL to relaunch the TaskManager and highlight Adobe Premiere Pro.exe
    Right-click to "End Process"
    No need to reboot the whole system; just launch Premiere Pro again and continue with the session. Note that your work reverted to Last Save.
    Hope this helps until the bug is fixed.

  • 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

  • Problem using TAPI triggers and merge statement

    Hi,
    I use Designer tapi triggers on a table. When I try to execute a merge statement, I get the following error:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value.
    Is there a restriction when using TAPI triggers and merge statements that anyone is aware of?

    No restrictions on MERGE commands that I know of. I have, however, seen the TAPI give inexplicable ORA-06502 errors. It would help to know what line in which procedure or trigger gave the error. That information should have been in the error stack.

  • Non-responding keyboard and cursor, macbook pro 10.4.7

    Hi,
    My macbook pro has completely stopped detecting my keyboard and cursor [I am not referring to a usb keyboard, I'm talking about the original typing keyboard], otherwise, it's the keyboard that's malfunctioning. I plugged in a usb mouse and the cursor worked fine, so I suspect that the issue originates from the keyboard itself or some kind of disconnection. Has anyone encountered such issues before? I've attempted to install an apple keyboard update, but the computer refused it because the system did not need the update. I'm completely lost...please...help...thank you so much in advance!!!!!!!!

    this is the wrong place to be asking. please post here...
    http://discussions.apple.com/category.jspa?categoryID=190

  • How to use analog Triggering and External clock scan

    Hi, there. I want to measure the engine cylinder pressure with an PXI6070-E card and BEI encoder. I have tried using Cont Acq&Graph ExtScanClk D-Trig.vi and Cont Acq&Graph ExtScanClk Soft A-Trig.vi , but they don't work. What I did was to connect a 50HZ pulse to PFI0 (analog triggering, I changed the code from digital triggering to analog triggering), and a 100K pulse to PFI7 (startscan), and an 50 HZ analog signal to ACH0. But the code always says: timeout. If I use internal clock, it works fine. Could you please give me some help? THANKS A LOT!

    Hey Wyuan,
    I tested the Cont Acq&Graph ExtScanClk Soft A-Trig.vi and it worked fine. However, the Cont Acq&Graph ExtScanClk D-Trig.vi has a small error in its logic that will prevent the data from ever being displayed to the graph. In order to run the examples you need to connect a trigger to pin 11 and a scan clock to pin 38. A 10kHz square wave would be fine for the clock signal and just a single pulse would work for the digital trigger.
    One additional think to keep in mind is the grounding. You might need to connect you ground from your signals to a DGND pin. I am including the two programs that I used for the test.
    I hope this helps,
    Joshua
    Attachments:
    Cont_Acq&Graph_ExtScanClk_D-Trig.vi ‏121 KB
    Cont_Acq&Graph_ExtScanClk_Soft_A-Trig.vi ‏153 KB

  • Select and Cursor doubt

    Dear All,
    I got a doubt b/n select and cursor.
    I read in one oracle book that select into clause will actually tries to get the data twice, Whereas the cursor will query only ones.
    Is this the case in Oracle 10g or both the select and cursor will fetch the data only ones.
    Ex
    select sal into v_sal from emp where empno = 7788 --> Ones it hit the data, oracle will again scan the entire set of records in the emp table for another match.
    Whereas
    Cursor c_sal is select sal from emp where empno = 7788; --> This will do the fetch operation only ones.
    Is this the case still True in Oracle 10g or 11i.
    Appreciate your help.
    Thankyou very much
    Madhu K

    the query is processed as follows (this is from ora doc)
    Parse:
    – Search for identical statement
    – Check syntax, object names, and privileges
    – Lock objects used during parse
    – Create and store execution plan
    Execute: Identify rows selected
    Fetch: Return rows to user process
    for cursor also same things are performed, but cursor is private sql area in which you can processes one row at a time, you can use cursor in your pl/sql program and access one row a time,
    so if you say,
    cursor c1 is select * from emp;
    c1 is private sql area where you can processes single row of emp , make comparisons, calculations etc,
    once you close the cursor this area is released and can be used by another cursor,
    the basic query processing rules remains the same,

  • 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)

  • Trigger, triggers and more triggers

    I've been given theenviable task of reviewing the triggers on a legacy application, as an example a typical table will have between 1 and 10 before insert triggers and I've been asked to validate the logic in the triggers.
    Does anyone know if there are any tools available to help with this, so far having looked at the first table (I was asked to loko at this specifically because someone wants to add yet another trigger) I'm starting to lose the will to live, 4 of the triggers currently in place alter similar fields makeing the results indeterminate. I have a nasty feeling the only way to be certain is to cross check every trigger and compile some kind of cross reference I'd really like some kind of toolset to make this easier.
    So far my analysis is the logic is horribly broken and really the whole shambles should be ripped out an re-wrtten properly this time, preferably fixing the problems in the front end rather than trying to bandage the data using triggers..

    You may have to look into dba_triggers and dba_dependenices too see how may triggers and if all depned on same object,
    This is why Tom kyte recommands using inline code instead of triggers.
    Good luck,

  • The code to set focus and cursor position fails in a mobile browser

    In two previous discussions (http://scn.sap.com/message/15176399 and http://scn.sap.com/message/15205348) I received help on how to set the focus on an OpenUI5 mobile input field and then how to position the cursor at the end of any text that might be in that field.
    That all works well in desktop browsers (Chrome, Firefox and IE10).
    However that same code seems to fail when I test it on browsers on mobile devices. At first I thought this was working in Chrome on an iPad but now it does not (could our taking new OpenUI5 code recently affected that?). I do not think I have ever see this work in Chrome on a, Android tablet.
    Has anyone had success setting the focus and cursor position on a mobile input field running in a mobile environment?

    Wasn't sure where to turn with this problem. There is talk on the web that there is a problem in Chrome on Android and that this will be fixed in version 37. We I get that version I will try and update this post.

  • Time bound policy :: CPSC Server down :: Re-triggering and Notification

    I have some Service Requests which are triggered by Time bound policy that execute, say for eg; Power Up some servers. But during a scenario of CPSC server being down during the time of Time bound Service request triggering, none of the requests are triggered  and also after the CPSC server is up again after few minutes past the triggering time. Is there a way to get notified if a Time bound policy is not triggered, like receiving an email? 
    Please let me know if there is any possible way to get notified during failure of time bound policy request triggering.
    Thanks,
    Anish

    Hi,
    According to event log, Winlogon process takes a long time to handle logoff event. That's to say winlogon process is waiting for response to logoff.  
    According to your description after, this problem is most probably caused by Avecto. You can try to disable or uninstall it temporarily for test.
    To make further troubleshoot with this problem, you can try to use WPT (Windows Performance Tool) to make troubleshoot.
    http://blogs.technet.com/b/askpfeplat/archive/2013/03/22/troubleshooting-windows-performance-issues-using-the-windows-performance-recorder.aspx
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Macbook Pro boots to blank gray screen and cursor

    Hello,
    I downloaded the "time machine update" and now my macbook pro will not boot, it stops at a gray screen and cursor.
    I have tried safe boot, Disk Warrior, clearing NVPRAM or whatever.
    Any ideas on anything else?
    Question, how long does a time machine restore take?
    Thanks

    elipsis1 wrote:
    I downloaded the "time machine update" and now my macbook pro will not boot, it stops at a gray screen and cursor.
    I have tried safe boot, Disk Warrior, clearing NVPRAM or whatever.
    Assuming the TimeMachine updte came from Apple correct?
    Disconnect the TM drive and any other hardware to return the machine back to factory as possible.
    Run through this fix list
    Step by Step to fix your Mac

  • Fork : triggering and terminating event ?

    Hi Experts,
    I am a begginer in  Workflow ..
    I just want to know how Fork can be used for paralled processing with triggering and  terminating event.
    It would be appreciated if provided with some scenarion in detailed steps.
    Thanks in advance.
    Ganesh..

    Mike,
    It would be HELPFUL for me if i get my problem solved as earlier so i can concentrate on other my commited topics..thats why expecting info., from the experts.
    Anyway , you  triggered me to read SAP help..thanks for the indirect motivation..
    Let me start reading the SAP help information!!!
    Thanks .
    Ganesh

Maybe you are looking for

  • Can't use front USB port for external Hard Drive

    I have had some problems for about the past year with the front USB port on my 2009 13in Macbook Pro 5.5. As you know, there are 2 USB ports on the left side on a 13inch Macbook pro.  The one closest to me (the front one) works fine when I use it wit

  • HT4928 is there anyway to delete hidden apps?

    Hi there, recently had an ipad and downloaded a few naughty apps that i deleted after a few days, they always still appear even when i have hidden them, i have sold my ipad on now and only have an iphone and a new macbook pro, when i sign into itunes

  • ACS 5.2 Authentication Issue with Local & Global ADs

    Hi I am facing authentication issue with ACS 5.2. Below is AAA flow (EAP-TLS), - Wireless Users >> Cisco WLC >> ADs <-- everything OK - Wireless Users >> Cisco WLC >> ACS 5.2 >> ADs <-- problem Last time I tested with ACS, it worked but didn't do mig

  • Why can't a person in Australia not receive my iTunes gift?

    I sent an iTunes gift for by email from my iTunes account in Switzerland to a friend in Australia. He said he cannot open it, it does not work. He has an apple account. Why doesn't that work? Anybody any suggestions? Thanks

  • Re-setting Bounce outouts?

    Hi - I'm new to the forum and have been using Logic for about 6 months since switching from DP, which I used for about 10 years. Does anyone here know how to re-set the outputs used to bounce audio in Logic? It seems that the default setting is Outpu