Problem with triggers

An Oracle 8 application isn't working apparently because the triggers are messed up. How can I fix this?

There are a number of ways to do this.
The simplest is to keep an extra column on each table that indicates which table a record originated in. Check this column in your triggers to prevent looping.
Other options would include package variables that you could set or using a third table as a variable.
But the real question, I think, is what you are attempting to do. It seems to me that you are implementing a mutli-master replication system. It is much easier to synchronize two-tables by using Oracle's built-in replication features than it will be by hand.
Steven

Similar Messages

  • Problem with triggering process chain

    Hi
    We have a remote process chain that calls a process chain in another system.The process chain in the other system is not getting triggered with the remote chain.
    We have 3 such remote chains and we are facing such a problem with only one of them.
    The process chain in the other system has a start variant which gets triggered( i suppose) and gives an instance id...the next step in the process chain is to load data into a ODS.Now this step remains yellow forever.When i manually try to schedule this step it gives me records and the request in the monitor screen turns green.But the process chain step continues to remain yellow.
    What can be a way out for triggering the process chain or where could the problem be?
    Please help
    Thanks,
    Suchi

    Hi Suchitra,
    Even though ur process seems to be in yellow your data loading may be completed and the  reason for it may be the delay in activation of ODs by ur PC.
    For your information please go through the below infm provided in SAp Library
    Note when loading into an ODS object and for the subsequent, event-controlled update:
    If you switched on the automatic activation in the ODS maintenance or administration, the monitor status for the request remains yellow after the load was successfully completed. Nevertheless, the subsequent processing for the InfoPackage is started, because the loading process is successfully completed.
    [http://help.sap.com/saphelp_nw04/helpdata/en/65/163d3873130057e10000009b38f842/content.htm]
    I hope ur doubt is clear.
    Regards,
    Rajkandula

  • Weird Problem with triggers

    Hi All,
    I am facing a problem which now I am finding difficult to get to the root cause.
    I have a trigger which inserts a row in a table whenever a column is updated in a table or a new row(s) gets added in the table.However , for update it checks that the updated value should be different from the existing value, if yes, then only it inserts in the Audit table.
    For some reasons I can see same rows in the Audit table with same column values based on applying CreatedOn Desc.
    Table Schema :(deliberately made small for demo)
    CREATE TABLE Relationship
    RelationshipID INT NOT NULL PRIMARY KEY ,
    ProfileStageID INT NOT NULL ,
    CreatedBy VARCHAR(128) NOT NULL,
    CreatedOn DATETIME NOT NULL
    GO
    ALTER TRIGGER [dbo].[Relationship_AuditProfileStageProgress] ON [dbo].[Relationship]
    AFTER INSERT,UPDATE
    AS
    IF UPDATE(ProfileStageID) AND EXISTS (SELECT * FROM inserted I INNER JOIN deleted D ON I.ProfileStageID <> D.ProfileStageID AND I.RelationshipID = D.RelationShipID)
    BEGIN
    INSERT INTO ProfileStageProgress(ProfileStageID,RelationshipID,CreatedBy,CreatedOn)
    SELECT ProfileStageID,RelationshipID,UpdatedBy,GETDATE() FROM INSERTED
    END
    IF EXISTS (SELECT * FROM INSERTED) AND NOT EXISTS (SELECT * FROM DELETED)
    BEGIN
    INSERT INTO ProfileStageProgress(ProfileStageID,RelationshipID,CreatedBy,CreatedOn)
    SELECT ProfileStageID,RelationshipID,CreatedBy,GETDATE() FROM INSERTED
    END
    This is the sample data which is indeed incorrect based on trigger definition :
    ProfileStageProgressID
    ProfileStageID
    RelationshipID CreatedBy
    CreatedOn
    469477 6
    209771 Admin
    2014-05-17 03:59:36.870
    469450 6
    209771 MGDK QA
    2014-05-16 11:59:28.790
    Can anybody give me some insight of what may be happening here.
    Thanks 
    Thanks and regards, Rishabh K

    reason is you're just checking that condition outside using EXISTS so even if there's atleast one record in update with different value it become true and will insert all records from INSERTED. I think what you want is this ie checking condition at the time
    of insert
    ALTER TRIGGER [dbo].[Relationship_AuditProfileStageProgress] ON [dbo].[Relationship]
    AFTER INSERT,UPDATE
    AS
    IF UPDATE(ProfileStageID) AND EXISTS (SELECT * FROM inserted I INNER JOIN deleted D ON I.ProfileStageID <> D.ProfileStageID AND I.RelationshipID = D.RelationShipID)
    BEGIN
    INSERT INTO ProfileStageProgress(ProfileStageID,RelationshipID,CreatedBy,CreatedOn)
    SELECT ProfileStageID,RelationshipID,UpdatedBy,GETDATE()
    FROM INSERTED i
    WHERE EXISTS (SELECT 1
    FROM DELETED D
    WHERE I.ProfileStageID <> D.ProfileStageID AND I.RelationshipID = D.RelationShipID
    END
    IF EXISTS (SELECT * FROM INSERTED) AND NOT EXISTS (SELECT * FROM DELETED)
    BEGIN
    INSERT INTO ProfileStageProgress(ProfileStageID,RelationshipID,CreatedBy,CreatedOn)
    SELECT ProfileStageID,RelationshipID,CreatedBy,GETDATE() FROM INSERTED
    END
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Simple problem with triggers

    Hi all,
    Initially I have written a trigger for testing .But im not able to write it as per the requirement.Actually I have written the trigger for a table "test" when a row is inserted into it then my trigger will insert a row in another table.In the same way if an row is UPDATED then that same field of the same row is to be updated in another table.how can I do this by modifying this trigger code.Im in a confusion of doing this.
    Table: test.
    Name Null? Type
    ID NOT NULL NUMBER(38)
    UNAME VARCHAR2(15)
    PWD VARCHAR2(10)
    Table : test123.
    Name Null? Type
    ID NUMBER
    UNAME VARCHAR2(30)
    PWD VARCHAR2(30)
    the trigger is as follows:
    CREATE OR REPLACE TRIGGER inst_trigger
    AFTER INSERT OR UPDATE
    ON test
    FOR EACH ROW
    DECLARE
         id number;
         uname varchar2(20);
         pwd varchar2(20);
    BEGIN
         id := 1245;
         uname :='abc';
         pwd := 'xyz';
         IF INSERTING THEN
    INSERT INTO test123 VALUES (id,uname,pwd);
         END IF;
    END test_trigger;
    how can i modify this for the above mentioned use.
    Thanks in advance,
    Trinath Somanchi,
    Hyderabad.

    Hallo,
    naturally , you have not assign values directly in trigger. They come automatically
    in trigger with :new - variables.
    CREATE OR REPLACE TRIGGER scott.inst_trigger
    AFTER INSERT OR UPDATE
    ON scott.test
    FOR EACH ROW
    BEGIN
    IF INSERTING THEN
    INSERT INTO scott.test123 VALUES (:new.id,:new.uname,:new.pwd);
    ELSE
    UPDATE scott.test123
    set uname = :new.uname, pwd = :new.pwd
    where id = :new.id;
    END IF;
    END inst_trigger;Nicolas, yes, merge here is very effective, but i think, that OP can starts with simpler version von "upsert".
    Regards
    Dmytro

  • I have problems with triggers

    Hi,
    I want to do this: When a signal reaches an established level, the trigger act and begins the recording data during a time.
    So, im trying to use a trigger fixing a positive value. But the recording data begins when I start the measurement.(clicking the run button).
    How could I do what i wish?
    Other question.
    Is possible to record data when the signal reaches a level and stop the recording when the signal value dicrease? How can I do that? 
    Thanks a lot.

    Hi jcastan,
    The answer to the first of your answers is yes, you should be able to do that.
    Try to configure your task as it appears in the attached snapshot
    "trigger.jpg", just change the triggering value according to your application. It should work, in my case I've wired a square
    waveform to channel no.1 and I am using it to trigger the task.
    The answer to your second question is a litlle bit more tricky, first try to add a Limit
    test (see snapshot "test.jpg"). It is a quite straight forward
    implementation but it may work, in my simple case it showed to behave
    correctly. Test it and let me know if it worked.
    Hope
    you found it helpful.
    Best.
    Attachments:
    test2.JPG ‏183 KB
    trigger.jpg ‏184 KB

  • Intersecting problem with two triggers

    Hello to all professionalists.
    Today I have got a very big problem with triggers.
    I have written an historical function for the application we use. This historical function works while it created triggers on every table that should be audited. There are some specialities like auditing on individual columns but the main reason is the following:
    for each table the auditing is turned on every value that is changed should be written with old and new value to a history Table.
    This works fine except that when there is another trigger on that table (BEFORE ....ROW) that does an UPDATE on another table. Then the auditing is not working as expected. Well, it isn't working at all for that table.
    So my question is if you have had the same experience or if you could tell me some workaround.
    Thank you very, very much
    Henrik Rünger

    I found the fix, go to System Preferences and open Mission Control and uncheck the box to keep monitors as they were (When switching to an application...........)

  • Problem with Roles and Triggers

    I'm having a strange problem with Roles and Triggers in Oracle. It's a little difficult to describe, so bear with me...
    I'm trying to create a trigger that inserts records into a table belonging to a different user/owner. Of course, the owner of this trigger needs rights to insert records into this other table. I find that if I add these rights directly to the owner of the trigger, everything works okay and the trigger compiles successfully.
    However, if I first create a Role and grant the "insert" rights to it, and then assign this role to the owner of the trigger, the trigger does not compile successfully.
    To illustrate this, here's an example script. I'm using Oracle 10g Release 2...
    -- Clean up...
    DROP TABLE TestUser.TrigTable;
    DROP TABLE TestUser2.TestTable;
    DROP ROLE TestRole;
    DROP TRIGGER TestUser.TestTrigger;
    DROP USER TestUser CASCADE;
    DROP USER TestUser2 CASCADE;
    -- Create Users...
    CREATE USER TestUser IDENTIFIED BY password DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS";
    CREATE USER TestUser2 IDENTIFIED BY password DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" QUOTA UNLIMITED ON "USERS";
    CREATE TABLE TestUser.TrigTable (TestColumn VARCHAR2(40));
    CREATE TABLE TestUser2.TestTable (TestColumn VARCHAR2(40));
    -- Grant Insert rights on TestTable to TestRole...
    CREATE ROLE TestRole NOT IDENTIFIED;
    GRANT INSERT ON TestUser2.TestTable TO TestRole;
    -- Add TestRole to TestUser. TestUser should now have rights to INSERT on TestTable
    GRANT TestRole TO TestUser;
    ALTER USER TestUser DEFAULT ROLE ALL;
    -- Now, create the trigger. This compiles unsuccessfully...
    CREATE TRIGGER TestUser.TestTrigger AFTER INSERT ON TestUser.TrigTable
    BEGIN
    INSERT INTO TestUser2.TestTable (TestColumn) VALUES ('Test');
    END;
    When I do a "SHOW ERRORS;" after this, I get:
    SQL> show errors;
    Errors for TRIGGER TESTUSER.TESTTRIGGER:
    LINE/COL ERROR
    2/3 PL/SQL: SQL Statement ignored
    2/25 PL/SQL: ORA-00942: table or view does not exist
    SQL>
    As I said above, if I just add the Insert rights directly to TestUser, the trigger compiles perfectly. Does anyone know why this is happening?
    Thanks!
    Adrian

    Hi Raghu,
    If the insert rights exist only on TestRole, and TestRole is assigned to TestUser, I can do the INSERT statement you suggest with no problems if I just execute it from SQLPlus (logged in as TestUser).
    The question is, why does the same INSERT fail when it's inside the trigger?

  • I'm having an intermittent problem with my midi controllers triggering Mainstage 3. I'm using a PreSonus Firebox audio interface. It's been working fine for months, but now when I first turn on the computer in the morning , I'm not able to trigger Ma

    I’m having an intermittent problem with my midi controllers triggering Mainstage 3.
    I’m using a PreSonus Firebox audio interface.
    It’s been working fine for months, but now when I first turn on the computer in the morning , I’m not able to trigger MainStage from the keyboard.  I tried different midi controllers, different keyboards, different midi cords, and check midi preferences.  The audio interface is working fine and is recogonized, but the midi doesn’twork.  I re-started the computer several times and then finally it miraculously starts working again.
      I’ve been having to this every day now.  Any help or ideas is very much appreciated.

    I Had the same problem with a FireStudio. Try unplugging the FireWire plug and the power plug. Wait for a few seconds, then plug both back in. The light on my FireStudio was flashing blue/red which means "not connecting." I did what I just described, and everything works again. Hope it works for you.

  • Problem with two of my business rule triggers

    Good morning every one,
    I have a small problem with two of my business rule triggers.
    I have these tables:
    pms_activity
    csh_cash
    csh_integrate_leh
    csh_integrate_led
    and my process goes like this:
    upon approval of a row in my pms_activity table I have a trigger that insert a row in my csh_cash - and in the csh_cash table I have a trigger that will insert in the csh_ingerate_leh and csh_integrate_led.
    my problem is pms_activity does generate a row in csh_cash but the trigger in the cash does not fire to generate a row in the csh_integrate_leh and led tables.
    I have generated in the following order after I created my business rule:
    I have generated the table from the designer (server module tab)
    I have generated the CAPI from the head start utility
    I have generated the API from the designer
    I have generated the CAPI from the designer
    I have run the recompil.sql
    I have checked that my business rule trigger is enabled and should run on insert and no where restriction
    === this is my business rule logic ======
    l_rule_ok boolean := true;
    begin
    trace('br_csh001_cev (f)');
    csh_gl_pkg.csh_gen_integ_jvs(p_id
    ,p_ref_num
    ,p_own_id
    ,p_trt_id
    ,p_value_date
    ,p_description
    ,p_amount
    ,p_cur_id
    ,p_gla_dr
    ,p_gla_cr
    ,p_gla_pl
    ,p_gla_rev
    ,p_gla_eqt);
    return l_rule_ok;
    exception
    when others
    then
    qms$errors.unhandled_exception(PACKAGE_NAME||'.br_csh001_cev (f)');
    end br_csh001_cev;
    ==== end =======================
    Any help will be appreciated as I have struggled with this for two days.
    Thanks

    hmmm...
    Try resetting it again and restoring with the same backup file...
    Does the phone work properly once you've reset it before you try restoring? A lot of people here have experienced problems restoring from backups... could be worth forgetting about it and starting from scratch.
    You could try contacting your nearest Nokia Service Centre (www.nokia.com/repair) and see if they can do anything - it may need the firmware reinstalling or upgrading... possibly... give them a call though and see.
    Nokia History: 3110, 5110, 7110, 7110, 3510i, 6210, 6310i, 5210, 6100, 6610, 7250, 7250i, 6650, 6230, 6230i, 6260, N70, N70, 5300, N95, N95, E71, E72
    Android History: HTC Desire, SE Xperia Arc, HTC Sensation, Sensation XE, One X+, Google Nexus 5

  • URGENT!  Problems with On-Commit and Key-Commit triggers!!

    Hi there,
    We are having a problem with our form actually saving a value to the database after the commit_form is given.
    When we hit the Save Button (which triggers the Key-Commit, and that in turn triggers the On-Commit trigger) we want a populated global variable to save to the database. Now when we hit Save, we can see the field get populated properly with this Global Variable (Global.Last_Tckt_Read), BUT it doesn't save to the database.
    Here is the code from the On-Commit trigger:
    IF :cg$bf_meter.closing_ticket_issued = 'N'
    THEN
    :CG$bf_meter.opening_meter_reading := :GLOBAL.LAST_TCKT_READ;
    :CG$bf_meter.opening_meter_reading_date := :GLOBAL.LAST_TCKT_DATE;
    :CG$bf_meter.closing_meter_reading_date := :CG$bf_meter.last_ticket_date;
    :GLOBAL.PREV_METER_READING := :CG$BF_METER.LAST_TICKET_READING;
    :GLOBAL.WINDOW_ACTIVE_CHECK := 'true';
    :GLOBAL.FTDAYCHM_SAVED := 'true';
    commit_form;
    ELSE
    :GLOBAL.PREV_METER_READING := :CG$BF_METER.LAST_TICKET_READING;
    :GLOBAL.WINDOW_ACTIVE_CHECK := 'true';
    :GLOBAL.FTDAYCHM_SAVED := 'true';
    commit_form;
    END IF;
    The code in the Key-Commit trigger is just commit_form;. Now, the code from the On-Commit seems to work fine if its in the Key-Commit trigger -- BUT we need to use the On-Commit in case the user exits the Form with the Exit Button on the toolbar or "X" on the title bar (Neither the Exit Button and the "X" will call the Key-Commit trigger).
    Any ideas how we can get this data value to actually SAVE in the database??
    Thanks for any help -- please respond, this deadline has already passed!
    Mike

    Well, I can't say I understand what you want, but:
    1) if you have only commit_form in key-commit - then you do not need this trigger. key-commit will fire when F10 (commit) is pressed, but since it is doing the same - there is no need.
    2) why don't you populate your block values to be saved right in SAVE button trigger and issue commit_form in the same trigger?
    Then you can have key-commit to cover the same functionality for F10 with code:
    go_item('save');
    execute_trigger('when-button-pressed');
    3) I cannot get the point of the "close" stuff - on close you want to check for changes or not? and to allow the user to exit with or without saving?

  • Triggering problems with IMAQ PCI 1411 using NI-IMAQ 2.6 drivers

    I am having problems with the NI-IMAQ triggering mechanisms. I would like to use imgSessionWaitSignalAsync to register a call-back function to be repeatedly called on rising edges on the external trigger line. Now the external trigger line is connected to a photocell that is low when there are no objects in front of it and is high when there is an object in front of it. Unfortunately, when running my application, the callback function is not always triggered when an object moves in front of the photocell, and it is often triggered when no object is in front of the photocell. The callback function is not called anywhere else in the code.
    An engineer at my company hooked up an oscilloscope to the trigger l
    ine and we found that the photocell performs as expected. So I am looking for help to ensure that every time an object starts to pass in front of the photocell, the callback function will be triggered.
    System Details:
    Windows 2000 PC
    Visual C++ 6.0
    2x IMAQ PCI 1411 installed(one is revision A, the other is revision C.) I have the same problem even if I switch to the other card.
    NI-IMAQ 2.60.0 drivers
    Thanks in advance,
    Michael

    Bruce,
    In fact that was my problem. The XC-73 operates at 30 Hz. My strobe
    lighting was not triggered at 30 Hz. Once they matched, the
    interlacing problem I described went away.
    -Shehrzad
    Bruce Ammons wrote in message news:<506500000005000000634D0000-1004225886000@exc​hange.ni.com>...
    > Shehrzad,
    >
    > What kind of lighting are you using? I have seen variations like you
    > describe when using fluorescent lighting, and also with incandescent
    > lighting when the frame rate didn't match the power frequency. I
    > suspect you are right about the lighting. I can't think of any other
    > reasons for the problem you described.
    >
    > Bruce

  • Problems with IP Phones registration to CUCME on SG200-50P

    Problems with IP Phones registration to CUCME on SG200-50P
    System setup:
    - Router Cisco 2811 with IOS 12.4(24)T5 Advanced IP Services, CUCME 7.1, DHCP Server
       with HWIC-4ESW
    - Switches:
       - old - SLM224P
       - new - SG200-50P (SLM2048PT), OS v1.3.2.02
    - IP Phones 7911 and 7931, OS v8.4.2
    One VLAN (for desktops and IP Phones) and one IP subnet, no voice VLAN.
    Network diagram:
    C2811---HWIC-4ESW---SWITCH---IPPhones
    Problem description:
    1. In the old setup with SLM224P everything works fine.
       Connected phones almost immediately (1-2 sec. after power up) get ip address, configuration and registers to CUCME.
    2. When switch is changed to new SG200-50G:
       - ip phones get their ip address and tftp configuration very slowly - about 10-20 seconds
       - ip phones cant register to CUCME at all. On the router with SCCP debugging turned on there is no sing of registration attempt
       - after reconnecting the old SLM224P situation backs to normal
    Things that have been checked or tried without success:
    - ports speed and duplex auto, correct detection - although not tested with manual settings
    - CDP/LLDP on/off
    - smartport mode auto and most static settings, also with disabled smartport
    - power cycle / reset
    - spanning tree and port security settings
    - solutions from that post - https://supportforums.cisco.com/thread/2232161
    None of the above methods worked.
    The only action that allowed ip phones to register was changing smartport role to static IPPhone + Desktop.
    After that when phone was disconnected and then reconnected the problem exists again - no registration (IP Phone status DECEASED in CUCME). Same with power cycle/reset.
    Please advice.
    Thanks in advance.

    1 - You have created the voice vlan?
    Nope, flat network, one ip subnet (10 hosts and 10 phones)
    2 - Have you set a phone on an untagged access port for the voice vlan to see if it works?
    Yep, phones are connected to untagged access ports of the one and only vlan
    3 - Have you tried to set the auto voice vlan on the switch so it dynamically assigns the role for ip phone + desktop?
    Not sure about auto voice vlan setting, although there was no triggers to AVV - no static voice vlan, no CDP/VSDP advertisements of voice vlan.
    We've tested static and auto smartport roles (independently of auto voice vlan feature) with successful auto-detection.
    The switch was pretty much in default out-of-the-box config (beside management parameters).
    4 - When rebooting the switch, you did ensure to save the start up to running config?
    Yes, running to startup
    5 - Have you manually set spanning tree PORT FAST for the phone ports?
    No, we haven't tested that. But portfast should be set automatically for the desktop and ip phone smartport roles.

  • Problems with creation of catalogue XPGrpwise and temporary

    Problems with creation of catalogue XPGrpwise and temporary files.
    I use GroupWise 8.01 and WinXP (SP2), OpenOffice 3.1.
    Why at opening files in Library, temporary files are not created in catalogue C:\Documents and Settings\Jon Smith\Local Settings\Temp\XPGrpwise, and created in catalogue C:\Documents and Settings\Jon Smith\My Documents. That causes problems. How to change a situation that worked as it is necessary.
    Catalogue XPGrpWise is created and leaves duly in catalogue C:\Documents and Settings\Jon Smith\Local Settings\Temp\.

    Cvetaev,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Problem with dynamic LOV and function

    Hello all!
    I'm having a problem with a dynamic lov in APEX 3.0.1.00.08. Hope you can help me!
    I have Report and Form application. On the Form page i have a Page Item (Popup Key LOV (Displays description, returns key value)).
    When i submit the sql code in the 'List of vaules defention' box. I get the following message;
    1 error has occurred
    LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    When i excecute the code below in TOAD or in the SQL Workshop it returns the values i want to see. But somehow APEX doesn't like the sql....
    SELECT REC_OMSCHRIJVING d, REC_DNS_ID r FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
    returns_dns_lov_fn is a function, code is below;
    CREATE OR REPLACE FUNCTION DRSSYS.return_dns_lov_fn (p2_dns_id number)
    RETURN dns_table_type
    AS
    v_data dns_table_type := dns_table_type ();
    BEGIN
    IF p2_dns_id = 2
    THEN
    FOR c IN (SELECT dns_id dns, omschrijving oms
    FROM d_status dst
    WHERE dst.dns_id IN (8, 10))
    LOOP
    v_data.EXTEND;
    v_data (v_data.COUNT) := dns_rectype (c.dns, c.oms);
    END LOOP;
    RETURN v_data;
    END IF;
    END;
    and the types;
    CREATE OR REPLACE TYPE DRSSYS.dns_rectype AS OBJECT (rec_dns_id NUMBER, rec_omschrijving VARCHAR2(255));
    CREATE OR REPLACE TYPE DRSSYS.dns_table_type AS TABLE OF dns_rectype;
    I tried some things i found on this forum, but they didn't work as well;
    SELECT REC_OMSCHRIJVING display_value, REC_DNS_ID result_display FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
    SELECT REC_OMSCHRIJVING display_value d, REC_DNS_ID result_display r FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) order by 1
    SELECT a.REC_OMSCHRIJVING display_value, a.REC_DNS_ID result_display FROM
    TABLE(CAST(return_dns_lov_fn(:P2_DNS_ID) AS dns_table_type)) a order by 1
    Edited by: rajan.arkenbout on 8-mei-2009 14:41
    Edited by: rajan.arkenbout on 8-mei-2009 14:51

    I just had the same problem when I used a function in a where clause.
    I have a function that checks if the current user has acces or not (returning varchar 'Y' or 'N').
    In where clause I have this:
    where myFunction(:user, somePK) = 'Y'
    It seems that when APEX checked if my query was valid, my function triggered and exception.
    As Varad pointed out, check for exception that could be triggered by a null 'p2_dns_id'
    Hope that helped you out.
    Max

  • Problem with set_item_instance_property and set_lov_property

    Hello guys,
    I am using oracle forms 6i and new to it. I am having a multi data block.
    I am facing a problem when I try to set the item instance property with respect to the list type.
    1) Basically, I am having a list item having three types MANUAL, INVOICE and BOE. All are independent of each other. I am facing the problem with the MANUAL type.
    I have written this code on When-Validate-Trigger of the list item as well as When-List-Changed. Also I am not setting the properties of any items initially(neither on When-New-Form-Instance nor on When-New-Block-Instance).
    if block.doc_type = 'MANUAL' then
    set_item_instance_property('BLOCK.VENDOR_NO', to_number(:system.cursor_record), REQUIRED,PROPERTY_TRUE);
    end if;
    But I am getting this warning/error frm 41383 - no such property for set_item_instance_property on both the triggers for the first time when I open the form and thereafter. During the same form session, if I click on the next line it shows a message Field cannot be empty and directs to the item where I compulsory need to insert a value. I also tried using to_number(:system.trigger_record) but getting the same issue. There are many more items I need to set the same property for.
    2)The invoice item on the block/form has a LOV. Another requirement is when I select 'MANUAL' , that LOV should not appear on selection of 'MANUAL' type and the user should be able to insert the value manually and validate manually. I did use set_lov_property, but did not get the correct usage. Please assist as soon as you can.
    Edited by: 1005292 on May 20, 2013 12:04 PM

    Just out of my interest I would like to know what you exactly meant by "The :SYSTEM.CURSOR_RECORD reflects where the navigation cursor is; which could be different from the record that is initiating the event." in your reply.If you look at the Forms Help for both objects, you will see that...
    SYSTEM.CURSOR_RECORD represents the number of the record where the cursor is located. This number represents the record's current physical order in the block's list of records. The value is always a character string.
    SYSTEM.TRIGGER_RECORD represents the number of the record that Form Builder is processing. This number represents the record's current physical order in the block's list of records. The value is always a character string. Through PL/SQL you can send (using the GO_ITEM, GO_BLOCK and GO_RECORD built-ins) the interenal Forms Cursor to a different item, block or record within the current block. If, you GO to a different block or record in the same body of code and you then evaluated the :SYSTEM.CURSOR_RECORD and compared it with the :SYSTEM.TRIGGER_RECORD you would find that they are generally different.
    2) In response to the second one, do you want to say that when it I select MANUAL I do not use the set_item_property OR use this property and attach an LOV which does not return anything OR use this property, give the name of the same of the same LOV,I am using and set PROPERTY_FALSE. First a litte back ground. When an Item has an LOV assigned to it, Oracle Forms automatically displays what it calls the "LOV List Lamp" in the status bar. With Forms 9i and higher, it displays and "List of Valu..." in the status bar when an item has an LOV assigned to it. Items can have an LOV assigned during design-time or during run-time. You cannot, however, unassign an LOV during Run-time becuase the SET_ITEM_PROPERTY built-in requires you to pass a valid LOV object name.
    Well, as I was writing this, it occured to me that you will not be able to set the LOV assigned to your multi-row item at run-time either because once you assign an LOV to an item in a multi-row block, all occurances of the Item will have the LOV assigned. This being the case, I would recommend using a button and give it the appearance of enabled or disabled by using the VISUAL_ATTRIBUTE property and add code to the button so that if the row status is MANUAL then nothing happens. Using this method, you would create two Visual Attribute (VA) objects; ENABLED and DISABLED. The ENABLED VA would make the button look like a normal button while the DISABLED VA would make the button look like it is disabled (grey out button text, etc).
    I would also like to know when to use set_lov_property and if you could explain in brief with an example.The only time I have used the SET_LOV_PROPERTY() built-in is when I needed to change the Record Group query assigned to the LOV. We have a form where depending on the "Action" selected, the LOV for a certain item needed to change. The values returned by the LOV were still assigned to the same block items, so rather than create multiple LOVs and set the Column Mapping for each LOV, I just create a Record Group object for each action and then used the SET_LOV_PROPERTY() built-in to change the LOV TITLE and GROUP_NAME. This way, I was able to reuse the LOV and it's existing column mappings while changing the record group that provided the data for the LOV.
    The problem lies when I am entering the fields after the invoice number. The fields before the invoice no including the field of invoice no hold the value entered but when I click/press a tab key to go on to the next field the values in the earlier fields(i.e fields before invoice no and invoice no field) disappear i.e. the values do not hold their place and again prompts me from start to enter the vendor no.Are you navigating to a new row/record? That could explain the disappearing data. If not, then I would look for a trigger on the item you're navigating too or for a Block level When-New-Item-Instance trigger that has code that sets the items to null. It sounds like something in the design is causing the field values to disappear (get set to NULL) so I would look at what happens in your form when a navigation event occurs.
    @Andreas - actually, REQUIRED is a valid property for the Set-Item-Instance-Property() built-in. ;)
    Hope this helps,
    Craig...

Maybe you are looking for

  • How to programatically get a Java version (Not default one) ?

    Hi, Java Guru, Does anyone know how to programatically get a Java verstion through its full path ? For example, there are 5 JVM installed on a user's machine: JRE1 JRE2 JRE3 JRE4 JRE5 How do you know the Java version under JRE3 ? From command line, y

  • DVD Help

    I'm having a problem with my disc drive. It's reading CD's, but having trouble with DVD's. Sometimes it will load them, but the majoity of the time it'll just eject them. I did the PRAM and SMC resets, i.e. talking out the battery while the comp is o

  • Firefox won't open when clicked on

    It does the windows loading symbol and then doesn't open. Only just installed it as I'm currently using google chrome and it won't let me open it.

  • Portable Font Problem

    Hi, We are trying to differentiate required fields from non-required fields in detail windows by bolding the field names for those fields that are required to save a record. We are using Portable, system default, bold, size 12 font for the required f

  • Title vs name of file

    I created a files in itunes and changed the titles, I doubled up some of the numbers by accident. I used Adobe bridge to rename the files in sequential order, however when I import them into Itunes it still displays them with the old title. If I get