Trigger file

Greetings,
I'm currently writing a very simple trigger... I'm using oracle 10.2
In the query analyser, I wrote:
DROP TRIGGER TRIGMAXPARTIE;
CREATE TRIGGER TRIGMAXPARTIE
BEFORE INSERT
ON PARTIE
FOR EACH ROW
        DECLARE nbparties number;
    BEGIN
        select count(NoR) as nbparties
        from PARTIE
        group by NoR;
        IF (nbparties >= 5)
        THEN raise_application_error (-208476, 'Le nombre de parties maximal pouvant être effectué lors d''une rencontre est atteint');
    END IF;
END;but it stops entering the trigger after the "DECLARE nbparties number;"
If I enter it manually, my trigger works (right click, alter trigger)
but I need a single run file...
Any ideas what might cause this?
Thanks!

A database trigger is not the right tool for the job here. See this test case:
SQL> create table partie (NoR) as select level from dual connect by level <= 4
  2  /
Tabel is aangemaakt.
SQL> CREATE TRIGGER TRIGMAXPARTIE
  2     BEFORE INSERT ON PARTIE
  3     FOR EACH ROW
  4  DECLARE
  5     nbparties NUMBER;
  6  BEGIN
  7     SELECT COUNT(NoR) INTO nbparties FROM PARTIE;
  8     IF (nbparties >= 5) THEN
  9        raise_application_error(-20476,
10                                'Le nombre de parties maximal pouvant Ûtre effectuÚ lors d''une rencontre est atteint');
11     END IF;
12  END;
13  /
Trigger is aangemaakt.
SQL> insert into partie values (5)
  2  /
1 rij is aangemaakt.
SQL> insert into partie values (6)
  2  /
insert into partie values (6)
FOUT in regel 1:
.ORA-20476: Le nombre de parties maximal pouvant Ûtre effectuÚ lors d'une rencontre est atteint
ORA-06512: in "RWIJK.TRIGMAXPARTIE", regel 6
ORA-04088: Fout bij uitvoering van trigger 'RWIJK.TRIGMAXPARTIE'.So it looks like the code is working. But watch what happens when you open a second session:
SQL> remark
SQL> remark  Open up a second session and issue:
SQL> remark
SQL> remark  insert into partie values (6);
SQL> remark  commit;
SQL> remark
SQL> pauseOutput of the second session:
SQL> insert into partie values (6);
1 rij is aangemaakt.
SQL> commit;
Commit is voltooid.And the first session again:
SQL> commit;
Commit is voltooid.
SQL> select count(NoR) from partie
  2  /
COUNT(NOR)
         6
1 rij is geselecteerd.I doubt this is what you want.
You may want to go with a on commit fast refreshable materialized view that stores the count of records and place a check constraint on the materialized view. But more important, can you state your business rule. Maybe we can find an even better solution.
Regards,
Rob.

Similar Messages

  • Trigger File Option in SFTP Advantco Sender Adapter

    Hi ,
    What is the purpose of Trigger file option in sender SFTP adapter?When i enabled Advance selection for source file we have this functionality.Can i use this option to delete the multiple files in the same directory instead of using File Name Mask.
    We have scenario to delete 4 files from application server in that only one file should be sent to partner and the rest should be delete from application server.
    Actual solution is to use to use script to delete the rest of the files do we have any other alternative.
    Thanks

    Hi,
    Another alternativet is to write your own customer adapter module and using java programming you can delete remaining 3 files. This is bit complex comapre to script writing but one advantage is with adapter module is that, you can provide the deteted file names with time stamp in the audit log of XI message, which will help in troublshooting if some issue happens.
    Regards,
    RK

  • Sender File Adapter should run only when trigger file is found PI 7.1

    I am using PI 7.1 . I have a File Sender Adapter communication channel that needs to poll for a trigger file - input.trg  . Only If that is found then it needs to pick up the actual data file -  input.dat   .  The Transport Protocol is  FTP not NFS, so I cannot use standard features like   'Addtional Files'. 
    Is there any other workaround for this ? OS Commands etc?
    I have also read that I can use BPM for this . Could anyone help me out with the steps and if you have any good blog on BPM.
    Thanks !

    Hi Dev,
    You can use BPM for this. The steps benig
    1. Fork with two receive step (one for trigger file and one for dat) . The end condition of fork is when both brach is completed.
    2. transformation step
    3. send step
    you can use a dummy correlation between the two input files (trigger and dat input file)..
    Regards
    Suraj

  • Trigger file in Sender File CC

    Hi All,
    I have a query regarding the usage of trigger file in Sender File CC.
    I am triying to pick .XML files only if respective .trg file is existing. My question is when ever there are 10 files where 9 are completely written and have respective .trg but 10th file still being written(which does not have a .trg file), the other 9 files are also not getting picked.it is waiting for the 10th .trg file throowing an error. But in real time these are dynamic files, when one is completed there may be other file being written. Is there any possibility to pick the 9 files which have .trg and leave the 10th file to be written completely and pick that in the next polling.
    Please find the below attachment of configuration.
    Kindly post your solutions on this.
    Thanks & Regards,
    Sandhya

    Hi
    If i understand correctly your 10th file is placing into the folder and it was not completely placed yet.For this as suggested you need to use File Modification Check.
    Coming to trigger file,once your files are ready (File Modification check success) then using some background job, we used Autosys tool to place the trigger file then PI will pick the files.There should be a gap between the background jobs which places actual data files,trigger file and polling of PI channel.
    Please try with SAP SFTP adapter which has more functions compared to normal FILE.In Case of SFTP you no need to use any modules for the payload conversion.
    Thanks

  • Program to create a trigger file

    Hello,
    I have an Open Hub destination set up to run in a process chain, in this process chain I also need an program to create a blank trigger file (<openhubname>.trg). how woudl i create this program to create and drop this trigger file to the same directory as the open hub file is being extracted to.  Thanks in advance.

    Just do a:
    open dataset.  "for write.
    transfer dataset.
    close dataset.
    Make sure you don;t even write a space as space is a char so file size will be 1 byte.
    Don't forget to reward points.
    Sougata.

  • FTP Adapter Trigger File Configuration

    Iam using the follwing link for the Trigger File Configuration , but this does not work,
    Can please anybody help me.
    Below is my JCA Configurations in WSDl looks like for my InBound FTP .
    <jca:operation
    FileType="ascii"
    PhysicalDirectory="/DALV1I/incoming/"
    ActivationSpec="oracle.tip.adapter.ftp.inbound.FTPActivationSpec"
    DeleteFile="true"
    IncludeFiles="oc4j\.xml"
    PollingFrequency="1"
    MinimumAge="0"
    OpaqueSchema="true"
    TriggerFilePhysicalDirectory="/DALV1I/incoming/"
    TriggerFile="Purchaseorder.trg" >
    </jca:operation>

    hi
    i am facing the same prioblem whcih kburchil is posted. Error's are posted below. Looking for the solution
    <2008-12-22 17:21:54,593> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Host files.oraclecorp.com FTP command: PASS
    <2008-12-22 17:21:54,984> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> FTP Command: NLST, reply:
    150 ASCII data connection for /bin/ls (/140.87.254.136,15,515) (0 bytes).
    <2008-12-22 17:21:54,984> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Control socket being read by [JCA-work-instance:FTP Adapter-14]
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Sending event: 1 with: oracle.tip.adapter.ftp.FTPConnection@13952a4
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> FTPManagedConnection::destroy called, closing physical socket
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Clearing Event Listeners
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Poller enqueuing file for processing :/MySharedFolders/abc/4673202.pdf
    <2008-12-22 17:21:55,734> <DEBUG> <default.collaxa.cube.activation> <File Adapter::Inbound> Ignoring File : 4673202.pdf as it is already enqued for processing.
    Thanks in advance.
    Thanks,
    Synthia

  • Error in BIC MODULE BIC MODULE modules:  trigger file [not specified] conta

    Hello, i have a problem with the BIC Seeburger MD
    Scenario overview:
    IDoc Invoice02 => Message Mapping (Seeburger content) => FTP Seeburger Comm. Canal integrated with BIC adapter. This works correctly. Then I tested the field mapping and the BIC Adapter brings no more errors in field mapping.
    BUT NOW THIS ERROR MESSAGE IS:
    Error in BICMODULE modules: Temporary error: BIC XI Adapter call failed. Reason: Error: [Error: ID = 1104; LEVEL = 3] trigger file [not specified] contains no valid trigger. DESCRIPTION: You have specified no valid trigger for that mapping. Please change this within BIC Mapping Designer.
    Destination Message is the Edifact Invoic D96A
    I hope one of you can help me
    Kind regards
    Tobias

    Hi Tobias,
    there is a either a problem with your XML Message or with the BIC Mapping which converts XML to EDI.
    What's the name of the BIC-Mapping that you use in your FTP Module chain?
    You can also check the following to make sure, your BIC Mapping works correctly:
    a) Take your Invoice Idoc and convert it with the Message Mapping into Edifact-XML
    b) Use BIC Mapping Designer and open the Mapping that you use in the Module Chain (Should be XML-->Edifact)
    c) Take the Edifact-XML Message from your PI Message Mapping and convert it in the Test Environment of BIC Maping Designer.
    If you get the same error, there's something wrong with your Edifact-XML message
    If the mapping works, there's something wrong in your module configuration. (Maybe you can post your module configuration)
    regards,
    Daniel

  • How to use trigger file functionality in File Adapters - Match file names

    Hi,
    I am using trigger file functionality in File adapters to pick up data files as:-
    <property name="TriggerFilePhysicalDirectory" value="/pub/Dev/eastern/brs/"/>
    <property name="TriggerFile" value="*.trg"/>
    Here any file with .trg extension is taken as a trigger file and File adapter randomly picks up one of the data files.
    My requirement is that the trigger file will be of the same name as that of the data file like:- <data_file>.data <data_file>.trg
    How to implement this feature using trigger file functionality of File adapters??

    The trigger file is any file that indicates(triggers) that the actual data file has been put in ftp location, i.e- determines the state when data file should be read.
    This helps usually when a large data file is being transferred and at that incomplete state the FTP adapter tries to read it(which is not desirable)
    It is configured when you create the ftp adapter service in your process(in wizard) or u can manually configure that in the JCA file for the FTP Adapter service as below:-
    <?xml version="1.0" encoding="UTF-8"?>
    <adapter-config name="FlatStructureIn" adapter="File Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter" UIincludeWildcard="*.txt" adapterRef=""/>
    <endpoint-activation operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
    <property.../>
    <property name="*TriggerFilePhysicalDirectory*" value="/tmp/flat/ArchiveDir"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    Reference: http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10231/adptr_file.htm#CIAJCBGI

  • Handling a payload only if a trigger file is available,

    Hi XIons,
    I have an inbound scenario.
    The flow is:
    X.trg and X.dat files (FTP Location)>Communication channel picks *.trg File> Module read the name of File> Modules picks the .dat file with same name> sends it to FCC in the comm. Channel--> sends to PI.
    The source is a legacy system which send a X.dat (CSV) file to a FTP location.
    when this dat file is complete then a X.trg file is created which confirms the completeness of dat file.
    Now FTP File channel have to pick this trg (trigger) file, read the name of this file and then have to pick the dat file with same name. Then thats dat file will undergo FCC and then finally sent to PI.
    We are trying to build a module to deploy in Comm Channel.
    Please share ur experiences for this scenario.
    Your fast response will be deeply appreciated.
    Regards
    Anand Shankar
    Infosys Technologies Limited.

    Hi Anand.
    Try to develop a new module adapter java.
    Follow the link with the steps:
    How to Create Modules for the J2EE Adapter Engine (NW7.0)
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    How to Create Modules for the J2EE Adapter Engine (NW7.1)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?overridelayout=true
    XI libraries for development
    https://wiki.sdn.sap.com/wiki/display/XI/XIlibrariesfor+development
    Good Luck
    Bruno

  • Trigger file question

    I was wondering if you could provide me some information about trigger files and how they can be sent (or retrieved).
    I created a daily Informatica process that runs at 8 AM, Monday – Saturday, on the dev server. It uses loans_daily_pub_vw and loan_txn_detail as sources. I’d like to include a process that checks trigger files, in case there are any delays in the loads.
    My questions are:
    Are trigger files created when the loans-daily and loan-txn-detail process complete?
    What is the best practice for sending trigger files?
    Can they be ftp’d to another server, or is there an alternate method?
    Thanks

    this is not an oracle question.
    this is an application design issue. if you want to use trigger files (or feel you NEED to because of the limitiation of a legacy system), then you'll need to design and code it.
    from oracle, you might want to use UTL_FILE to create files. DBMS_JOB or DBMS_SCHEDULER (v10) to schedule/run stored procedures. You could use external tables to read in files. and you can use DBMS_SCHEDULER on v10, or stored java procedures on v8-9 to issue o/s commands from oracle.
    Are trigger files created when the loans-daily and loan-txn-detail process complete?
    you decide
    What is the best practice for sending trigger files?
    there aren't any
    Can they be ftp’d to another server, or is there an alternate method?
    depends on how your network is setup, and what's installed on your servers

  • Create a trigger file after successfully processing of a regular file?

    Hi,
    I have 10 differet proxy-tofile scenario interfaces going to one target system (10 different transcational data sets). For each interafce after creating the file (fixed file name file1.txt), PI has to create/append a file called "trigger file" which has different structure with fine name, file creation date/time etc. and kind of file (all or delta) which comes from proxy.
    So if file1.txt (all) has created, after that PI has to create "trigger file" with:
    file1.txt 20110106 all
    So if file2.txt (changes), another interface with different transaction, is created, we need to append "trigger file" with:
    file1.txt 20110106 all
    file2.txt 20110106 delta
    Can I do this scenario without BPM, in Integrated Configiration, we are in PI 7.1 EHP1.
    Regards,
    N@v!n

    Hi All,
    Let me try to put the question differently for the same scenario. I have completed dev with two message mappings, two operation mappings (one for regular file and one for tigger file). In ID, I am using the Integrated Configuration (with multiple receivers; here I created 2 communication components, one for regular file, another one for trigger file). This scenario works fine, creates regular file and trigger file. Only thing is it creates trigger file even regular file fails, we dont want to create a trigger file when the regular file creation fails..... since we have lof of scenario like this, we want to use integrated configuration only......I have tried to use one operation mapping (with multiple message mappings with in it), but looks like Integrated Configuration doesn't support this.
    So if I have one operation mapping with 2 message mappings in it, does operation mapping fail when one of the message mapping fails? At the end all we wanted to do create a file when ever the regular creats successfully. Pleae help me with the design. Let me know if you need more info.
    Thank You,
    N@v!n

  • Using Java Embedding Unzip Code and a Trigger File in a BPEL Process

    Hello,
    Thanks in advance to anyone that contributes with any insight.  It is much appreciated.  Having said that I will get to the crux of my problem.
    I am currently using Oracle 11g.  I have created a SOA composite application that incorporates BPEL and Java.  I have the code needed to unzip and extract compressed folders.  However, when this was first built out using BPEL it automatically created a web service in the "exposed service" lane and not a file adapter which I believe is needed in order to trigger the process via a start.txt file for example.  Based on what I know ... this web service automatically connecting to the BPEL process was simply due to the order of operations, etc.  So by creating a 'read' file adapter first and then creating the BPEL process and selecting the template "Define Service Later", it does not automatcially connect the web service to the BPEL process and it will allow me to connect a file adapter to this BPEL process instead ... great.  When opening up the BPEL file I then connect a recieve component to this file adapter and configure appropriately.
    Essentially, my objective in setting up a trigger to start this unzip process is due to the BPEL process before that outputs or writes the .zip folder to the same directory that I want to poll and/or trigger via a start.txt file.  I can get this process to work with a webservice connecting to the BPEL process and by using a Java Embedded in BPEL file, which in turns calls the package/ class that has the java code needed to unzip.
    For some reason whenever I try to use a file adapter instead of the native web service that gets created (as mentioned above) it doesn't work.  It seems to build or compile just fine however, I am getting errors when I try to deploy.
    Note:  The Java code contains all the paths where the zip file is to be taken from and extracted to.  So because this is in the code I don't need the file adapter to handle this.  I just want to use the file adapter so that I can trigger the process via start.txt or something of that nature.
    Thanks to anyone that has any suggestions.
    Kind Regards,
    Kevin
    Errors when attempting to deploy are as follows:
    [04:12:54 PM] Error deploying archive sca_Job2_UnZip_rev1.0.jar to partition "default" on server soa_server1 [http://WN017A.homedepot.com:8001]
    [04:12:54 PM] HTTP error code returned [500]
    [04:12:54 PM] Error message from server:
    There was an error deploying the composite on soa_server1: Deployment Failed: Error occurred during deployment of component: BPELProcess1 to service engine: implementation.bpel, for composite: Job2_UnZip: ORABPEL-05250
    Error deploying BPEL suitcase.
    error while attempting to deploy the BPEL component file "H:\Oracle\Middleware\user_projects\domains\Dev_Acorde\servers\soa_server1\dc\soa_d78eb301-314c-422a-a748-bcfe7d0906e8"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of BPELProcess1
    This error contained an exception thrown by the underlying deployment module.
    Verify the exception trace in the log (with logging level set to debug mode).
    [04:12:54 PM] Check server log for more details.
    [04:12:54 PM] Error deploying archive sca_Job2_UnZip_rev1.0.jar to partition "default" on server soa_server1 [http://WN017A.homedepot.com:8001]
    [04:12:54 PM] ####  Deployment incomplete.  ####
    [04:12:54 PM] Error deploying archive file:/C:/JDeveloper/mywork/Job2_UnZip/Job2_UnZip/deploy/sca_Job2_UnZip_rev1.0.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

    Just wanted to provide a screenshot of the BPEL file as supporting documentation to better illustrate my issue.
    Thanks so much,
    Kevin

  • Trigger File adapter

    Hi,
    I’m new to XI. I have a problem with the handling of the File Adapter.
    In my scenario a third party system puts a data file into the directory. The directory and file are configured in the file adapter. XI should not transfer the File until the third party system sends a trigger.
    How is it possible to start the transfer in XI by an Abap program ? {Which class is necessary to activate the adapter by program ?}
    Is there a better way ?
    Many Thanks in advance.
    Berthold
    Message was edited by: Berthold Latka

    Hi Berthold
    File adapters can only poll for files using a predefined time interval. There is no way to trigger a file adapter to look for a file.
    So files will always send to XI as soon as they appear, and the poll interval is passed.
    What you can do is build a business process which collects the file and waits for the trigger from R/3. There are some examples in XI SAP BASIS which explains the use of trigger messages.
    Kind regards,
    Christiaan Schaake.

  • Trigger File Generation to a Server from Web Dynpro Application

    Hi Everybody! Hope you had a good new years eve
    Is it possible to generate a File on a Server outgoing from Web Dynpro?
    I tried to use GUI_DOWNLOAD. But as I couldn't use the GUI_DOWNLOAD from the Web Dynpro, I wrote a Report "ZCMI_EXPORT_FILE" that generates a Text-File. When I start the Report by myself, the file gets generated. All fine.
    To be able to generate the File from Web Dynpro, I created a Batch Input Function Module, that I call in the Web Dynpro. The File is not created and it does not show any errors.
    Do you have any idea how i can get this working? I'd also be happy with a different approach.
    Best Regards and Thanks,
    Steffen
    REPORT that is called with Batch Input from Web Dynpro:
    call function 'ZFM_GENERATE_EXPORT'
      exporting
        it_detail_record     = lt_records
        is_export            = gs_export
      importing
        ev_string            = gs_export-document
        et_dataset           = data_tab
      exceptions
        parameter_is_initial = 1
        others               = 2.
    if sy-subrc <> 0.
    endif.
    concatenate '\\SERVER\EXPORT\' gs_export-filename into lv_filename.
    call function 'GUI_DOWNLOAD'
      exporting
        filename                = lv_filename
      tables
        data_tab                = data_tab
      exceptions
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        others                  = 5.
    if sy-subrc <> 0.
      exit.
    endif.

    HI,
    GUI_DOWNLOAD does not get's executed in the Backgroud.
    there is no way to do it as a background job.. create the folder.. transfer the file to the application server in the backgorund using OPEN DATASET... use the tcode CG3Y to download the file from the app server to your folder..

  • BPM design for trigger based file from Oracle

    Hi
    We have one requirement as follows:
    1. We need to receive trigger file from Oracle.
    2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
    3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
    Please suggest design.
    Thanks
    Siva

    Hi Siva,
    1. We need to receive trigger file from Oracle.
    define a sender CC (FILE) which polls a directory every N seconds.
    The receiver of this message should be your BPM.
    2. As soon as we recieved trigger file, it needs to activate all other 10 JDBC adapter channels.
    in your BPM, trigger your 10 sender CC (JDBC). See sap help and blog to know how to trigger externally a CC. Easy to do.
    3. once reciever all 10 RFC channels completed, it needs to pass that trigger file.
    Then always in your BPM, you have to do a correlation on the 10 SQL responses (that's crazy!). Several blogs and threads on this subject.
    And after that, in BPM what do you do of these 10 SQL responses (thats' crazy!) ? do you have to merge data ?
    Welcome to the birthday of a future monster... for dev and maintenance... Sincerely simplify your flow!
    Question: do you really need to have 10 SQL? for your needs, is it not possible to create a stored procedure in database which will do the 10 SQL (with Join tables)... if yes do it, by tis way you will have only one Sender CC (JDBC) to trigger, and no correlation in a BPM. That will greatly simplify your flow.
    Regards
    Mickael

Maybe you are looking for

  • Lion and "powerPC applications no longer supported" with hp Office jet printer

    I have an HP office jet 5510 all in one printer that is no longer compatible with my recent installation of Lion.  The "powerPC applications are no longer supported" prompt comes up when I try to open the app on my dashboard.  Do I need to buy a new

  • Canon Powershot SD600 as video source?

    Currently considering the purchase of a new digital photocamera, the Canon Powershot SD600. One of the things I hope to use it for, is as a 'webcam' ... my Powerbook doesn't have a built-in iSight and I don't use it often enough to actually buy an iS

  • How to access my hard drive when the system does not work

    how to access my hard drive when the system does not work

  • Positioning of OAMessagePromptBean

    Hello, i created OADefaultListBean and OAMessagePromptBean, and attached OADefaultListBean to OAMessagePromptBean. i am trying to display the Prompt string on top of the list-bean (OADefaultListBean) not on its left. Does anyone know how to achieve t

  • Possible to sync iphone calendar over to iCal?

    I manage my calendar/contacts through outlook at work (active sync to iPhone), and would like a copy of them on my iMac. Is it possible to copy them off my iphone and over to iCal/Contacts? I did a quick search and couldn't find anything. thanks