Within trigger is it possible

within trigger is it possible to do like
var1:=:new.var2;[var2 means  column name of a table]

if INSERTING then
--insert into trace_sql(table_name,operation,operation_date) values('B','INSERT',sysdate);
--:NEW.POPULATION_DATE_TIME:=SYSDATE;
SQL_STR4:='select column_name from all_tab_columns where table_name = '||
''''||B||'''' ||' AND OWNER='||''''||TEST||'''';
EXECUTE IMMEDIATE SQL_STR4 BULK COLLECT INTO SEL_COL_LIST;
FOR I IN SEL_COL_LIST.FIRST..SEL_COL_LIST.LAST LOOP
SQL_STR1:=SQL_STR1||','||SEL_COL_LIST(I);
SQL_STR2:=SQL_STR2||','||':NEW.'||SEL_COL_LIST(I);
END LOOP;
SQL_STR1:=SUBSTR(SQL_STR1,2,LENGTH(SQL_STR1));
SQL_STR2:=REPLACE(SQL_STR2,',',''',''');
SQL_STR2:=SUBSTR(SQL_STR2,3,LENGTH(SQL_STR2));
SQL_STR3:='INSERT INTO '||'JU_'||B||'('||SQL_STR1||') VALUES ('||SQL_STR2||')';
EXECUTE IMMEDIATE SQL_STR3;
end if;
my code is this

Similar Messages

  • 2 MERGE statements in same trigger - is it possible ?

    Hi guys,
    I have an After Insert trigger (on table A) that takes the last record from table A and insert/update it on another table (B) then insert /update in same table (B) some records which depends on it. When trying to insert data in table A, the trigger raise this error: ORA-04092: cannot COMMIT in a trigger.
    I understand the error, but I need expert's opinion to make the trigger works.
    Here is the actual situation:
    Table A has a trigger on after insert, and BASED ON THE LAST ROW inserted (only this data is subject to the trigger's actions) does the following:
    1. MERGE the data (last row from the source table=A) with the data from the table destination=B. This data is specific to an employee;
    2. Open a cursor that goes through all the ancestors of the employee (I have an employees hierarchy) and MERGE the same data (but for ancestors) with the table destination;
    To be more specific :
    EmpID LOB Day Status
    12 1007 29 Solved
    EmpID has ancestors 24 and 95. Therefore in the destination table I will have to do:
    1. Merge data for EmpID 12;
    2. Merge data for EmpID 24, 95:
    EmpID LOB Day Status
    24 1007 29 Just S (this is the status for ancestors)
    95 1007 29 Just S
    Steps 1 and 2 are inside a PL/SQL procedure that works fine by itself, but not within the trigger (since there are many transactions on the destination table). These 2 steps are required because for EmpID 12 I set a status and for the ancestors I set up a different status (this was the only way I could think of).
    Can someone give me a hint how should I handle this situation ?
    Thank you,
    John

    Based on my understanding of what you are trying to do you are going about this in the wrong way. Try this approach instead:
    1. Trigger fires initiating the process and passes relevant :NEW values to a stored procedure
    2. The stored procedure does all the work and possibly should be an autonomous transaction
    It looks very much like your code just doesn't belong in a trigger.
    PS: Why a MERGE statement? If the rows most likely do not exist then INSERT and UPDATE in your exception handler: Otherwise UPDATE as the default and INSERT in the exception handler. It is not very likely the percentage of inserts and updates will be near 50% each.

  • Capacity leveling. Aim is to have oders scheduled within 1 day if possible

    Hi All,
    I have a list of 10 prod. orders with same basic/scheduled start/finished date= today
    In capacity leveling, if i select a whole list of these orders and dispatch them, i get all orders with start day= today, finish date= today+ x days.
    I would like to have orders scheduled with start/finish date within 1 day.
    I have available capacity of 4 hours per day. Each order takes around 1,5 hours, thus i can have 2 orders scheduled for today, and so on. This is exactly what i need.
    My kind question to you is how to setup SAP in a such way.
    NB: If i do leveling for each order one by one, then i get what i want: e.g. order is scheduled within 1 day.
    Best Regards,
    Andrey

    Dear Andrey
    Your requirement is, Automatic capacity levelling based on the available capacity.
    In SAP R/3 PP module, only manual capacity levelling is available. Automatic is possible in APO.
    If the requirement dates are same for multiple orders, system will through all the orders in the same date and it will display overloaded. So manually we need to dispatch the overload to the required date.
    Please check the below thread also.
    Re: Triggering Finite Scheduling
    Hope it helps
    Regards
    Bala

  • Using cmd within the process flow. possible?

    I am trying to combine all the flat files in a directory in my process flow by executing
    cmd> C:\folder *.log copy new.log
    is this possible within the owb?

    I would like to ask another question..
    The external table isnt dynamically connected to the flat file defined, so does it mean that I would have to re-deploy it again, everytime the content of the flat-file get updated?
    if so, is there a way for me to deploy the external table within the process flow?

  • Advanced Trigger, is this possible?

    Hi im doing an assignment in oracle at uni and i am wondering if this trigger is possible.
    I have the following tables:
    STUDENT
    StudentID PK
    firstName
    secondName
    surname
    homeAddress UDT
    termAddress UDT
    DOB
    gender
    etc etc...
    StudentFinance
    FinanceID PK sequence
    StudentID FK from above table
    arrangementType Varchar2
    agreementDate
    feeStatus
    agreementCompleted
    finalPaymentDate
    Basically when a new student is insert i would like it to automatically create a new record in the studentfinance table with the students id number, it would need to set the agreementdate to the currentdate and the finalpaymentdate to one year ahead.
    feestatus would default as unpaid and agreementcompleted to no.
    Is it possible to somehow, 'ask' the user which arrangementtype they would like the student to have on insert of the student?
    Thanks,
    Alex

    Is it possible to somehow, 'ask' the user which
    arrangementtype they would like the student to have
    on insert of the student?As others already mentioned it is not possible to write an "interactive" trigger. However the missing information could be entered along with the insert already.
    You could create a view and insert into the view including arrangementtype. The view can have INSTEAD OF trigger that will insert/update the underlying tables.
    The application logic should do:
    1) Get all information from the student that you need (including arrangementtype).
    2) Then move this information from the client/browser to the database. It could be done with an insert into a view, with a procedure call or with mutliple inserts into different tables.
    regards
    Sven

  • Executing operating system command within trigger or procedure

    Hello
    Can some one help me out as how to execute operating system command (unix or windows ex.. stop,start,cc,del or copy etc...) in a trigger or procedure.
    My requirement is, if some predefined error occure then listener listener should be stopped automatically.
    Thanks in advance
    kvss

    Here is some code to tell you how to do:
    First a small Java program that taker a string as a parameter and executes it as an os-command
    import java.lang.Runtime;
    import java.lang.Process;
    public class Commands extends Object {
    * Constructor
    public Commands() {
    // On NT the command should be like this "cmd /c del c:\temp\readme.txt"
    // exec execute('cmd /c del c:\temp\readme.txt');
    public static void execute (String cmd ) {
    try {
    Process p = Runtime.getRuntime().exec(cmd);
    try {
    p.waitFor();
    catch (java.lang.InterruptedException intex ) {
    intex.printStackTrace();
    System.out.println("Return = "+ p.exitValue());
    System.out.println(" Done ...");
    catch ( java.io.IOException iox) {
    iox.printStackTrace();
    ===================end of java ====
    Use loadjava to load it into the database and create a pl/sql wrapper around the java code.
    See the manual about loadjava details.
    Log in to sqlplus as SYSTEM and create a role for this purpose e.g. 'JAVA_ROLE'
    and exec the following as SYSTEM or SYS to make sure the user has the the needed privs.
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.io.FilePermission','<<ALL FILES>>','read,write,execute,delete');
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.lang.RuntimePermission','writeFileDescriptor',null);
    dbms_java.grant_permission('JAVA_ROLE','SYS:java.lang.RuntimePermission','readFileDescriptor',null);
    and you're done.

  • Prefer 802.11a over 802.11g within SSID - Is it possible?

    Currently have a corporate SSID advertised enabling clients to connect using either A or G. Ideally I'd like clients too connect using A if they're able, and if not connect on G.
    I think I've read on these forums this is possible but requires the WLCs to be running specific (quite new) firmware.
    Is anyone able to advise?
    TIA

    Yes, you can try to make 802.11a more attractive by tweaking the rrm values on the controllers.
    For example:
    my tpc values for a are:
    Tx Power Level Assignment Algorithm
    Power Threshold (-80 to -50 dBM) -67
    and only have 36, 40, 44, 48, 149, 153, 157, 161, 165, 26 channels enabled
    for b:
    Tx Power Level Assignment Algorithm
    Power Threshold (-80 to -50 dBM) -70
    You can also choke back on the basic rates for b/g depending upon your density.
    If your environment allows you to control the clients, you can also tweak the network card settings on the clients to prefer a as well.

  • SOLVED Trigger Trouble using substr within trigger to merge feilds

    hi all,
    im new to oracle triggers although this trigger seems right to me but it wont compile without errors can anyone spot what i have missed...
    1 CREATE OR REPLACE TRIGGER "BOOK_INFO"
    2 BEFORE INSERT ON "BOOK_INFO" FOR EACH ROW BEGIN SELECT BOOK_SN.NEXTVAL
    3 INTO :NEW.BOOK_CN_NUM
    4 FROM SYS.DUAL :NEW.book_cn
    5 := SELECT SUBSTR( :NEW.book_title, 1, 2 )||'-'||
    6 SUBSTR( :NEW.book_author_name, 1, 2 )||'-'||
    7* TO_CHAR( :NEW.book_num, 'fm000' );END
    8 /
    Warning: Trigger created with compilation errors.
    thanks everyone
    RMMO
    Message was edited by:
    RMMO

    this is the session in which SHOW ERRORS gave me a no error response
    SQL> ed
    Wrote file afiedt.buf
    1 CREATE OR REPLACE TRIGGER "BOOK_INFO"
    2 BEFORE INSERT ON "BOOK_INFO"
    3 FOR EACH ROW
    4 BEGIN
    5 SELECT BOOK_SN.NEXTVAL
    6 INTO :NEW.BOOK_CN_NUM
    7 FROM SYS.DUAL;
    8 :NEW.book_cn := SUBSTR( :NEW.book_title, 1, 2 ),||'-'||,
    9 SUBSTR( :NEW.book_author_name, 1, 2 ),||'-'||,
    10 TO_CHAR( :NEW.book_num, 'fm000' );
    11 END;
    12* /
    SQL> /
    Warning: Trigger created with compilation errors.
    SQL> SHOW ERRORS;
    No errors.
    SQL>

  • Building chapter index menu within DVDSP4...possible?

    I am trying to build an index menu from my video track, but so far I haven't been able to. My video track is 15 short pieces each with audio and each butted to the next. At each start, I created a Chapter Marker in the track editor. What I would like to do is take that "marked" track and create a chapter index menu from it - is that possible? If so, how? Thanks!

    Hi - welcome to the discussions!
    What you need to do is go to the outline view and click on the track icon, then drag it in to the menu editor window. Just hold it there for a second until the menu appears and select the appropriate option to create the menus. You will then be asked to choose a style from the built in templates and DVDSP will do the rest for you, including adding the next and previous buttons to move between the menus (if more than one is needed).

  • BEFORE UPDATE Trigger

    Hi,
    I'm looking for a solution to find out which columns are set in the update-statement inside a before update trigger. Can someone give me a hint?!
    What I want to do:
    I want to ensure that an update-statement for a special table always include attribute "XXX". To declare this attribute as "not null" is useless, because it is set correctly at insert. To compare the new value against the old value in a before update trigger isn't possible because the new value can be the same as the old value.
    I'm using Oracle 8i.

    There is no need to use two triggers and a temporary table where a simple insert from the before trigger will do the job.
    You can just insert the :old.column values straigth into a history table within the before update trigger though I would prefer to use an after update trigger. Nevertheless, both the insert into history and the update will be part of one transaction so the two action will commit or rollback together:
    UT1 > create or replace trigger marktest_bu
    2 before update on marktest
    3 for each row
    4 begin
    5 insert into marktest_hist
    6 values (:old.fld1, :old.fld2, :old.fld3, :old.fld4);
    7 end;
    8 /
    Trigger created.
    UT1 > select * from marktest_hist;
    no rows selected
    UT1 > update marktest set fld1 = 'trigtest2'
    2 where fld1 = 'trigtest';
    1 row updated.
    UT1 > select * from marktest_hist;
    FLD1 FLD2 FLD3 FLD4
    trigtest 9 28-MAY-04 trigtest
    IMHO -- Mark D Powell --

  • IMAQdx with JAI and a hardware trigger

    Hello,
    We are working with two 'JAI AD-080' cameras and IMAQdx, and have two problems regarding the triggering and frame grabbing:
    1)  We are unable to change the trigger source through IMAQdx property node or the Vision Acquisition Express; Vision Acquisition block.
    2)  When we manually edit the trigger source property using the NI Measurement and Automation Explorer (MAX) to its correct value, we can't get all four of the CCD's to run at a time without resulting in bad packets, e.g. horizontal black lines across the images.
    Our goal is to obtain the images from the 4 CCD's at a rate of 5 Hz using our hardware trigger.  We can already connect and obtain all four images at full speed, but the 5 Hz trigger is not being used by the cameras in that case.
    Details of the setup:
    NI 2011, Windows 7 
    Two (2) JAI AD-080 cameras (with 2 CCD's each), GigE cameras connected over Ethernet
    Hardware triggering at 5 Hz, on pin:  'Line 7 - TTL In 1'
    Details of the problem:
    (1)  Setting the trigger source not possible in Vision Express or IMAQdx property node
    In order to use our hardware trigger, we have to set the camera property 'CameraAttributes::AcquisitionControl::TriggerSour​ce' to a specific pin (Line 7 - TTL In 1).  This property is available in MAX, but is not usable in the Vision Express Block.  The property is present, but the values are invalid.  Here is what I think is happening:  the list of properties are read from the camera, but LabVIEW does not know what the valid values are for that property and it populates the value drop-down menu with whatever was loaded last.  This can be seen in figures 1 and 2 where the values in the drop down menu change.
    Similarly, this property of 'Trigger Source' cannot be changed programmatically using the IMAQdx property node shown here: http://digital.ni.com/public.nsf/allkb/E50864BB41B​54D1E8625730100535E88
    I have tried all numeric values from 0 to 255, and most give me a value out of range error, but the ones that do work result in no change to the camera.
    (2)  Lost packets in image during triggering
    If I set the 'Trigger Source' property in MAX to the correct pin, save the configuration, and then use the Vision Acquisition Express block to connect to the camera, the triggering works properly (the hardware trigger is used and the images are received by LabVIEW at 5 Hz).  However, this only works for one CCD:  If i use the same code for all four CCD's at the same time, I get black bars on the images, and at least one of the CCD's result in an error in 'IMAQdx Get Image.vi'  (code -1074360308, -1074360316)
    I tested this by using the configuration attributes created by the Vision Express Block, (The string used in the 'IMAQdx Read Attributes From String.vi'),  in the code we have been developing as well as a very simplified version which I have attached.  Those configuration attributes are saved in the text files:  JAI_Config_TrigON.txt and JAI_Config_TrigOFF.txt for using triggering or not respectively.  
    So my final questions are:
    Is there a problem with the IMAQdx because it doesn't recognize the trigger source value?
    Do you have any suggestions for why there are bad packets and trouble connecting to the cameras when I load them with the trigger on attributes?
    Thank you for your time - 
    Attachments:
    Fig1_VisionAcq.png ‏387 KB
    Fig2_VisionAcq.png ‏442 KB
    Fig3_BadPackets.png ‏501 KB

    Hello,
    Thank you for your response; especially the speed in which you responded and the level of detail.  
    I have not solved the problem fully in LabVIEW yet, but I was able remove the black lines and apparitions from the images using different camera parameters.  
    Since this was a significant victory I wanted to update:
    1)  Version of IMAQdx?
    I have IMAQdx 4.0, but the problem persists.
    2)  Setting configuration files
    Your suggestion to pay attention to the order in which the properties are set as well as using the MAX settings is very helpful.  I have not explored this feature fully, but I was able to successfully use MAX to set the default settings and then open the cameras programmatically without loading a new configuration file.  
    3)  Bandwidth limitations
    I modified the CCD's to only use 250 Mbits/second, but the lost packets (or missing lines/ apparitions) were still present.  
    4)  JAI AD-080GE Specifics
    I am using the JAI AD-080GE; and there are two settings for this camera that I want to mention:  
    JAI Acquisition Control>> Exposure Mode (JAI)>>Edge pre-select
    JAI Acquisition Control>> Exposure Mode (JAI)>>Delayed readout EPS trigger
    The "Edge pre-select" mode uses an external trigger to initiate the capture, and then the video signal is read out when the image is done being exposed.
    The "Delayed readout EPS trigger" can delay the transmission of a captured image in relation to the frame start.  It is recommended by JAI to prevent network congestion if there are several cameras triggered simultaneously on the same GigE interface.  The frame starts when the 'trigger 0' is pulsed, then stored on the camera, then is transmitted on 'trigger 1'.  
    The default selection is the "Delayed readout EPS trigger", however, I do not know how to set the 'trigger 1' properly yet and I only have one connection available on my embedded board that is handling the triggering right now (I don't know if 'trigger 1' needs to be on a separate line or not).  Incidentally, the system does not work on this setting and gives me the black lines (aka lost packets/ apparitions).
    I was able remove the black lines and apparitions using the "Edge pre-select" option on all 4 images with a 5 Hz simultaneous trigger.  I confirmed this using the "JAI Control Tool" that ships with the cameras.  I am unable to make this happen in MAX though, as the trigger mode is automatically switched to 'off' if I use the mode:  JAI Acquisition Control>> Exposure Mode (JAI)>>Edge pre-select
    i.e. when manually switching the trigger mode to 'on' in MAX, "JAI Acquisition Control>> Exposure Mode (JAI)>>Delayed readout EPS trigger" option is forced by MAX.  The vise-versa is also forced so that if EPS mode is chosen, "Trigger Mode Off" is forced.
    Additionally, there is a setting called:
    Image Format Control>>Sync Mode>>Sync     &     Image Format Control>>Sync Mode>>Async
    When the "Sync" option is chosen the NIR CCD uses the trigger of the VIS CCD.  In addition to using the "Edge pre-select" option, the "Sync" option improves the triggering results significantly.  
    5)  Future troubleshooting
    Since I cannot set the camera parameters manually in MAX (due to MAX forcing different combinations of parameters in 4), I am going to explore manually editing the configuration file and loading those parameters at startup.  This can be tricky since a bad combination will stall the camera, but I can verify the settings in JAI Control Tool first.  There is also an SDK that is shipped with the cameras, so I may be able to use those commands.  I haven't learned C/C++ yet, but I have teammates who have.

  • Hyperlink from within a Word Document to a specific page within a PDF document.

    I was hoping that someone would be able to assist me.  I would like to create a hyperlink (used as a citation) on my Word document that opens directly to a specified page within a PDF document (possible other word docs and so on, but less
    often).  How do I go about performing this?  Another note, all the documents would reside within a SharePoint site.

    I was hoping that someone would be able to assist me.  I would like to create a hyperlink (used as a citation) on my Word document that opens directly to a specified page within a PDF document (possible other word docs and so on,
    but less often).  How do I go about performing this?  Another note, all the documents would reside within a SharePoint site.
    I am not a Word guru, but I don't think you can run a macro from a hyperlink. But you can create an active X label that runs a macro when clicked. You can use the following macro to go to a specific page in a PDF file.
    Sub OpenPDFPageView(DisplayPage As Integer)
    'In order to use the macro you must enable the Acrobat library from VBA editor:
    'Go to Tools -> References -> Adobe Acrobat xx.0 Type Library, where xx depends
    'on your Acrobat Professional version (i.e. 9.0 or 10.0) you have installed to your PC.
    Dim PDFApp As AcroApp
    Dim PDFDoc As AcroAVDoc
    Dim PDFPageView As AcroAvPageView
    Dim PDFPath As String
    Dim DisplayPage As Integer
    PDFPath = "C:\Users\doudou\documents\test1.pdf"
    'Set the page you want to be displayed
    'DisplayPage = 3
    'Initialize Acrobat by creating App object
    Set PDFApp = CreateObject("AcroExch.App")
    'Set AVDoc object
    Set PDFDoc = CreateObject("AcroExch.AVDoc")
    'Open the PDF
    If PDFDoc.Open(PDFPath, "") = True Then
    PDFDoc.BringToFront
    'Maximize the document
    Call PDFDoc.Maximize(True)
    Set PDFPageView = PDFDoc.GetAVPageView()
    'Go to the desired page
    'The first page is 0
    Call PDFPageView.GoTo(DisplayPage - 1)
    'Set the page view of the pdf
    Call PDFPageView.ZoomTo(2, 50)
    End If
    Set PDFApp = Nothing
    Set PDFDoc = Nothing
    On Error Resume Next
    'Show the adobe application
    PDFApp.Show
    'Set the focus to adobe acrobat pro
    AppActivate "Adobe Acrobat Pro"
    End Sub

  • Oracle iRecruitment: Keyword Search within Resumes using Oracle Text

    Dear All,
    As per my understanding (and Note: 247064.1) simple Keyword searches can be performed in iRecruitment if oracle Text is installed. However searching for Keywords within resumes is not possible using Oracle Text and is possible ONLY if Resume Parsing is enabled via a third party (non-oracle) service provider.
    Can you please let me know if my understanding is correct and if not provide further inputs on this.
    Thanks,
    Subrat

    Got this confirmation from Oracle via SR:
    Resume searching is independent of resume parsing and not required to search resumes.
    Oracle Text is the text engine that allows you to search documents using content-based queries. Oracle Text allows you to upload documents, search documents, parse resumes, etc.
    Hence to conclude - Installation of Oracle Text will allow Keyword Searches on resumes.
    Thanks,
    Subrat

  • Linking an image from one page to an image within a slideshow on another page.

    I would like to link an image on my home page with an image within a slideshow on another page of my website. I can create the link, but when I click on the link, instead of taking me to the image within the slideshow, it takes me to the first image of the slideshow which I don't want. Is there a way to link to an image "within" the slideshow and not the first image?

    Hi
    You can create pages with specific images and then use link of images which will open the page with that specific image, link images within slideshow to show exact image within would not be possible with native Muse feature as by default slideshow will open the first image in target.
    Thanks,
    Sanjit

  • Flex 4 - insert combobox or other interactive component within RichEditableText

    As part of my massive quest to convert a large application from AS2 to Flex AS3, I am going to need to insert a UI component within a RichEditableText component.
    Is that actually possible?
    In AS2, I had created each word of a paragraph as a separate textField and then positioned them all together, inserting input fields and combobox components as required.... however... project requirements means I have to try and insert components within full paragraphs, if possible... Dynamically and in actionscript.  I'm not sure where to start attempting this... if anyone has any ideas which might help, I'd be truly grateful !!!
    This is a question paragraph.  The first answer to this paragraph question is [combobox] and the second might be [combobox] so select your answers and press the check button.
    Thanks.

    Have you discovered TinyTLF yet? I believe it will enable you to create the sort of controls you're looking for. http://guyinthechair.com/

Maybe you are looking for