Losing values on insert

Hi there
We have a data entry page which takes input from a user and then inserts the data into the database when the user presses the create button. Each time we insert data on this screen, the results differ. Sometimes the create button inserts all of the fields, and other times only one field is inserted or all fields except for one is inserted. Other times, the insert doesn't even occur.
Has anyone else come across this problem before?

Heidi,
How did you build this insert screen? Also, can you verify your browser's cache is not playing tricks on you?
Sergio

Similar Messages

  • NULL values are inserted into interface table for read only columns

    Hi, I developed a custom Integrator where some of the columns has to be displayed as read only in the layout. I am using SQL content to populate the data. When I upload the data NULL values are inserted into table interface? Is there any work around for this?
    Thanks
    Edited by: user593879 on Jan 12, 2010 7:21 PM

    Doesn't WebADI drive you insane at times?
    I must say, when it's all working it looks great and it is very user friendly (end-user that is, NOT for developers!) but before you get to that stage… please please Oracle invest some time making Web ADI a bit more logical an coherent, get the obvious bugs out, please let us not have to update BNE tables anymore to get things done.
    Anyway, I sorted this one out by setting the Width to zero (0) in the Layout. HTH.

  • Why cannot I use hidden or display only item to store value for insert?

    hi, Gurus:
    I have a question:
    I implemented a form with report region in a page, the update works OK, but the add function has a problem:
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)
    Many Thanks in advance.
    Sam

    Hi,
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)I think both hidden and display items have attributes that can cause problems because of different ways these items function than non-hidden and non-display-only items function. Display Only items have a "Setting" of "Save Session State" Yes/No? That can be a problem.
    Would you do this? Make these items regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.
    Howard
    Congratulations. Glad you found the solution.
    Edited by: Howard (... in Training) on Apr 11, 2013 10:26 AM

  • I Cant insert all values to the table But only Default Values r inserted?

    Hai,
    i can insert only default values to the database. Other values are not shown in DB.
    Steps I have done so far:
    I have created EO based on VO and VO has the query : select * from emp. Attached to AM.
    That AM is attached to the Page. The page consists of employeed details and SAVE button.
    Set controller for that page and CO-PR calls create method in AM .
    Default values for who columns and SLNo also set through sequence.
    In CO-PFR I call apply method which commits the data.
    when i run the page and giving values it is not inserted into table but only default values are inserted.
    I checked with System.out.println(getattribute("my attr").toString()). It send output correctly.
    But y other values are not inserted.?
    Anybody plz plz help me in this regard. I am struggling with this for last 1 week. I have to apply this to another realtime scenorio? Deadline is near.
    Regards,
    Lakshmi Chandiran

    Hai Prince,
    Thanks for your immediate response. pls find my codes written in EO,AM,CO.
    In VO i havent added anythig xcept the query.
    The following fields are only getting inserted in the table.
    My EOImpl code:
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    System.out.println("NOW I AM IN CREATE METHOD");
    OADBTransaction transaction = getOADBTransaction();
    Number EMP_ID = transaction.getSequenceValue("Employeeid");
    setEmpId(EMP_ID);
    setCreationDate(transaction.getCurrentDBDate());
    setStartDate(transaction.getCurrentDBDate());
    setLastUpdateDate(transaction.getCurrentDBDate());
    setCreationDate(transaction.getCurrentDBDate());
    VO:
    select * from emp1
    AM:
    public void saveForm()
    OAViewObjectImpl empvo = getEMP_VO();
    System.out.println("NOW I AM IN AM SAVEFORM OF EMTS");
    if ( !empvo.isPreparedForExecution())
    empvo .executeQuery();
    Row prow = empvo .createRow();
    empvo .insertRow(prow);
    prow.setNewRowState(Row.STATUS_INITIALIZED) ;
    System.out.println("NOW I AM IN ROW CREATED");
    public void commitdata()
    System.out.println("commitMethod()") ;
    getDBTransaction().commit();
    CO:PR & PFR:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    if(!pageContext.isFormSubmission())
    pageContext.getApplicationModule(webBean).invokeMethod("saveForm",null);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule EMP_AM = pageContext.getApplicationModule(webBean);
    OAViewObject vo = (OAViewObject)EMP_AM.findViewObject("EMP_VO");
    if ( pageContext.getParameter("BtnSave") != null )
    pageContext.getApplicationModule(webBean).invokeMethod("commitdata");
    s1 = (String)vo.first().getAttribute("Empname");
    s12 = (String)vo.first().getAttribute("Emptype");
    s3 = (String)vo.first().getAttribute("Emporg");
    s4 = (String)vo.first().getAttribute("Empcity");
    System.out.println(" values are " + s1+s2+s3+s4);
    here i can get the values correctly printed in output as entered in the form.
    I dont know where the problem is.
    plz help me.
    Thanks in advance,
    Regards,
    Lakshmi Chandiran

  • Initialize sub sequence column values on insert?

    I asked this on stack overflow, but it was recommended that I also ask here.
    http://stackoverflow.com/questions/12982875/initialize-sub-sequence-column-values-on-insert-oracle
    I would like my table to sequence its "order by" column based on it's TEMPLATE_ID. I would like this to happen on insert (via an insert trigger, probably). For example, if I run the following inserts, I should get the following table values.
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (1, 1)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (2, 1)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (3, 1)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (4, 2)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (5, 2)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (6, 2)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (7, 2)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (8, 3)
    ID TEMPLATE_ID ORDER_BY
    1           1        1
    2           1        2
    3           1        3
    4           2        1
    5           2        2
    6           2        3
    7           2        4
    8           3        1I first tried to create this trigger, but it gives me an error when I insert.
    create or replace
    trigger TEMPLATE_ATTRIBUTES_AF_INS_TRIG
       after insert on TEMPLATE_ATTRIBUTES
       for each row
    begin
        if :NEW.ORDER_BY is null then
           update TEMPLATE_ATTRIBUTES
           set ORDER_BY = (select coalesce(MAX(ta.ORDER_BY), 0) + 1 from TEMPLATE_ATTRIBUTES ta where ta.TEMPLATE_ID = :NEW.TEMPLATE_ID)
           where ID = :NEW.ID;
        end if;
    end;The error it gives me is: "table TEMPLATE_ATTRIBUTES is mutating, trigger/function may not see it"
    So I need a different way to build this trigger. And I also need it to "thread safe" so that if these two inserts occur on different sessions at the same time, then the resulting records will still get different "ORDER_BY" values:
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (1, 1)
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (2, 1)
    Edit:
    I tried the common work around for the "table is mutating, trigger/function may not see it" and the work around "worked" but it was not "thread safe." I tried to add locking but it gave me another error on insert
    create or replace package state_pkg
    as
      type ridArray is table of rowid index by binary_integer;
      newRows ridArray;
      empty   ridArray;
    end;
    create or replace trigger TEMPLATE_ATTRIBUTES_ORDER_BY_TB4
    before insert on TEMPLATE_ATTRIBUTES
    begin
      state_pkg.newRows := state_pkg.empty;
    end;
    create or replace trigger TEMPLATE_ATTRIBUTES_ORDER_BY_TAF1
    after insert on TEMPLATE_ATTRIBUTES for each row
    begin
      if :NEW.ORDER_BY is null then
        state_pkg.newRows( state_pkg.newRows.count+1 ) := :new.rowid;
      end if;
    end;
    create or replace trigger TEMPLATE_ATTRIBUTES_ORDER_BY_TAF2
    after insert on TEMPLATE_ATTRIBUTES
    declare
      v_request     number;
      v_lockhandle varchar2(200);
    begin
      dbms_lock.allocate_unique('TEMPLATE_ATTRIBUTES_ORDER_BY_lock', v_lockhandle);
      while v_request <> 0 loop
        v_request:= dbms_lock.request(v_lockhandle, dbms_lock.x_mode);
      end loop;
      begin
        for i in 1 .. state_pkg.newRows.count loop
          update TEMPLATE_ATTRIBUTES
          set ORDER_BY = (select coalesce(MAX(q.ORDER_BY), 0) + 1 from TEMPLATE_ATTRIBUTES q where q.TEMPLATE_ID = (select q2.TEMPLATE_ID from TEMPLATE_ATTRIBUTES q2 where q2.rowid = state_pkg.newRows(i)))
          where rowid = state_pkg.newRows(i);
        end loop;
        v_request:= dbms_lock.release(v_lockhandle);
      EXCEPTION WHEN OTHERS THEN
        v_request:= dbms_lock.release(v_lockhandle);
        raise;
      end;
    end;This gives me:
    ORA-04092: cannot COMMIT in a trigger ORA-06512: at "SYS.DBMS_LOCK", line 250 ORA-06512: at "TEMPLATE_ATTRIBUTES_ORDER_BY_TAF2", line 5 ORA-04088: error during execution of trigger 'TEMPLATE_ATTRIBUTES_ORDER_BY_TAF2' ORA-06512
    Edit 2: The ORDER_BY column must be an updateable column. ID actually uses a sequence and before insert trigger to set its values. I thought I was simplifying my question when I included it in the insert examples, but that was incorrect. ORDER_BY's initial value is not really related to ID, but rather to what order the records are inserted. But ID is sequenced so you can use that if it helps.

    Check here below:
    create table TEMPLATE_ATTRIBUTES
    ( ID           INTEGER
    , TEMPLATE_ID  INTEGER
    , ORDER_BY     INTEGER
    CREATE OR REPLACE TRIGGER templ_attr_bf_ins_trg
       BEFORE INSERT
       ON template_attributes
       FOR EACH ROW
    BEGIN
       IF :new.order_by IS NULL
       THEN
          SELECT NVL (MAX (ta.order_by), 0) + 1
            INTO :new.order_by
            FROM template_attributes ta
           WHERE ta.template_id = :new.template_id;
       END IF;
    END;
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (1, 1);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (2, 1);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (3, 1);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (4, 2);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (5, 2);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (6, 2);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (7, 2);
    INSERT INTO TEMPLATE_ATTRIBUTES (ID, TEMPLATE_ID) VALUES (8, 3);
    SELECT * FROM TEMPLATE_ATTRIBUTES;
    Output:
            ID TEMPLATE_ID   ORDER_BY
             1           1          1
             2           1          2
             3           1          3
             4           2          1
             5           2          2
             6           2          3
             7           2          4
             8           3          1
    {code}
    Let me also comment that I don't like this solution. It might conflict with multiuser access.
    If you just need the column to order the table you can use a sequence and then order you table by template_id, order_by (generated by a sequence).
    In this way you will not have a problem with multiuser access. Do you care that order_by column is not starting from 1 for each template_id and it has "holes" in the sequence for that template_id?
    Regards.
    Al
    Edited by: Alberto Faenza on Oct 22, 2012 5:11 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Reading BFile datatype value to insert corresponding value into blob

    Hi,
    I have oracle 10.2.0 database.
    I have this table with 3 columns of datatypes
    TableA(id, Blob, BFile)
    now i have pdf files stored in a directory for every id which ranges from 1 till 100.
    for example for id=10, the pdf file name is cr10.pdf
    except that for some id there is no correpsonding pdf's.
    and i have a written a query where for a particular id, i link the corresponding pdf into the BFile. now is there a way where i can view the value of the bfile locator and find whether the bfile is null or not(i mean whether there is a pdf or not existing for that particular id)
    what i need to do is, based on the bfile value i will insert the pdf into the blob column.
    so based on the bfile value(ie whethe rthe pdf exisit or not) i will open the pdf and read the contents into the blob column.
    and somehow i have figure out that a pdf is not exisiting based on the bfile value and then insert a null into the blob column instead of getting an error by trying to read a pdf which doesn't exist.
    Can someone help me, how to find out existance of a file based on bfile value and insert value into blob.
    I want this is script to be automated instead of checking manually a file exists or not.
    Thanks,
    Philip.

    Hi,
    I have oracle 10.2.0 database.
    I have this table with 3 columns of datatypes
    TableA(id, Blob, BFile)
    now i have pdf files stored in a directory for every id which ranges from 1 till 100.
    for example for id=10, the pdf file name is cr10.pdf
    except that for some id there is no correpsonding pdf's.
    and i have a written a query where for a particular id, i link the corresponding pdf into the BFile. now is there a way where i can view the value of the bfile locator and find whether the bfile is null or not(i mean whether there is a pdf or not existing for that particular id)
    what i need to do is, based on the bfile value i will insert the pdf into the blob column.
    so based on the bfile value(ie whethe rthe pdf exisit or not) i will open the pdf and read the contents into the blob column.
    and somehow i have figure out that a pdf is not exisiting based on the bfile value and then insert a null into the blob column instead of getting an error by trying to read a pdf which doesn't exist.
    Can someone help me, how to find out existance of a file based on bfile value and insert value into blob.
    I want this is script to be automated instead of checking manually a file exists or not.
    Thanks,
    Philip.

  • How to retrieve value from insert statement

    hi,
    how can i get a certain value from insert statement and store it in a variable.
    suppose i am inserting emp_no , emp_name , emp_salary to employee table
    and i want to store the emp_name in a variable for other processing,
    how can i accomplish this ? i'm guessing that i have to use trigger,
    but dont know the procedure .
    any help will be greatly appreciated
    thanks

    insert into <table> valiues (....) returning <expression> into <variable>
    You could and should have found this using the SQL Language reference manual
    or
    http://www.morganslibrary.org/reference/insert.html
    Sybrand Bakker
    Senior Oracle DBA

  • Value Mapping Insert Error

    Hi
    I am sendind an item value mapping from R3 to XI and I get this error:
    <ns:ValueMappingReplicationFault xmlns:ns="http://sap.com/xi/XI/System">
    - <standard>
      <faultText>A value is missing for content of Identifier in item 0.</faultText>
    - <faultDetail>
      <text />
      <id>7</id>
      </faultDetail>
      </standard>
    - <addition>
      <ItemNr>0</ItemNr>
    - <Item>
      <Operation>Insert</Operation>
      <GroupID>037dd9b01a3111da8abef522ac127968</GroupID>
      <Context>http://sap.com/xi/XI</Context>
      <Identifier scheme="BS_PEPE" agency="Company" />
      </Item>
      </addition>
      </ns:ValueMappingReplicationFault>
    The code in R3 is this one
    REPORT  Z_XI_REPLICATE_VALUE_MAPPING.
    data: My_ZCO_MI_CONSULTA_SERIAL type ref to
                    CO_SVMR_VALUE_MAPPING_REP_SYNC,
          in type SVMR_VALUE_MAPPING_REP_RESP,
          out type SVMR_VALUE_MAPPING_REPLICATION,
          vIdentifier type SVMR_VALUE_MAPPING_IDENTIFIER,
          vItem type SVMR_VALUE_MAPPING_REP_ITEM,
          vItemLst type SVMR_VALUE_MAPPING_REP_TAB,
          vList type SVMR_VALUE_MAPPING_REP_LIST,
          lo_sys_exception   TYPE REF TO cx_ai_system_fault.
    try.
        create object My_ZCO_MI_CONSULTA_SERIAL.
        vIdentifier-scheme = 'BS_PEPE'.
        vIdentifier-agency = 'Company'.
        vIdentifier-value = '122'.
        vItem-Group_id = '037dd9b01a3111da8abef522ac127968'.
        vItem-operation = 'Insert'.
        vItem-context = 'http://sap.com/xi/XI'.
        vItem-Identifier = vIdentifier.
        append vItem to vItemLst.
        vList-item = vItemLst.
        out-VALUE_MAPPING_REPLICATION = vList.
        call method My_ZCO_MI_CONSULTA_SERIAL->EXECUTE_SYNCHRONOUS
          EXPORTING
            output = out
          IMPORTING
            input  = in.
      CATCH cx_ai_system_fault INTO lo_sys_exception.
        write: /'Error Text   --> ',lo_sys_exception->errortext.
        write: /'Error Code   --> ',lo_sys_exception->code.
        exit.
    ENDTRY.
    write: /'ESN_STATUS --> ',in-STATUS.
    The message sent to XI and I see in the sxmb_moni in R3 is this one
    <?xml version="1.0" encoding="utf-8" ?>
    - <nr1:ValueMappingReplication xmlns:nr1="http://sap.com/xi/XI/System">
    - <Item>
      <Operation>Insert</Operation>
      <GroupID>037dd9b01a3111da8abef522ac127968</GroupID>
      <Context>http://sap.com/xi/XI</Context>
      <Identifier scheme="BS_PEPE" agency="Company">122</Identifier>
      </Item>
      </nr1:ValueMappingReplication>
    When I try to delete a Group it works but not when I want to insert an individual item.
    What am I doing wrong?
    Thanks
    Regards

    Hi
    There is a field call CONTROLLER with this structure:
    FIELD     FIELDNAME     CHAR     30     0     Field Name
    VALUE     PRX_CONTR     CHAR     1     0     Field Control in XML Data Stream (=> Type Group SAI)
    But in SAP documentacion does not say any references to this field and how to fill them.
    I am asbolute sure I filled all the mandatory fields.
    Thanks
    Regards

  • Use session state values to set column value during insert/update

    I am building an APEX 4.2 application that uses the canned Data Loading control to upload csv data to a table.  I have modified the 'Select Data Source' page of the workflow and it now contains three LOV's that the user selects values from.  The selected values are stored in Session State.  As I'm new to APEX, I do not know how to reference Session State objects in the context of the Data Loading workflow so that the appropriate columns are set with the correct values.  My assumption is that the columns that are apart of the insert statement reside in a collection somewhere.  I just don't know how to loop through the collection, determine the correct column, and then set that column's value equal to the corresponding LOV value in Session State.

    Scott,
    This is in version 2.2.1 and there are no caching features available.
    The application does require login.
    I'm playing around with the APP_UNIQUE_PAGE_ID right now but I am finding that even in the builder if I edit the attributes of a report column and then try to edit another column it will bring up the last column I edited. Even if I use the record navigation buttons next to the Apply Changes button it will keep bringing me the same page over and over unless I constantly refresh the pages.
    Greg

  • How to insert the Formatted date value and insert into the database

    Hi All,
    I am having requirement of inserting the date value in to the datbase. I'm already getting the value from file as MM-DD-YYYY. Getting exception while transforming the values through the transform activity. I'm using format fate function but it is inserting null value in to the database.
    Any help from anyone would bve appreciated.
    Thanks,
    CH

    Hi,
    your input date format is fixed right? So, in the transform you can split each your date, which is in 'MM-DD-YYYY' format ... extract day, month, year.
    After that ... just put these values in order acording to the format of 'xsd:date' data type which is '[-]CCYY-MM-DDZ'.
    XPath function 'xp20:format-dateTime()' works only with 'xsd:dateTime' data type, which has format '[-]CCYY-MM-DDThh:mm:ssZ'.
    So, in your case it could be:
    <xsl:variable name="day" select="substring($inputDate,4,2)"/>
    <xsl:variable name="month" select="substring($inputDate,1,2)"/>
    <xsl:variable name="day" select="substring($inputDate,7,4)"/>
    <xsl:variable name="outputDate">
    <xsl:value-of select="$year"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$month"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$day"/>
    </xsl:variable>
    Regards,
    Martin.

  • Static Decimal value in insert query

    HI am going to insert decimal value in table but i got this error" Arithmetic overflow error converting numeric to data type numeric."
    HERE  val one is a decimal value how can do this?
    INSERT INTO TBL(CON,VAL)
    SELECT ID,'2.0' FROM TBL1

    Chino,
    SHud eb a problem with the precision value of your column. Try increasing the same. The following example shud help:
    --case 1
    declare @tab table (id decimal(3,2),name varchar(100))
    --precision=1 scale=2
    insert @tab select 51.987 , 'jk'
    select * from @tab
    Msg 8115, Level 16, State 8, Line 2
    Arithmetic overflow error converting numeric to data type numeric.
    --case 2
    declare @tab table (id decimal(4,2),name varchar(100))
    --precision=2 scale=2
    insert @tab select 51.987 , 'jk'
    select * from @tab
    Works Fine
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • How to get auto-increment value after insert on ACCESS db?

    When you insert a new record to a table with an auto-incrementing key, how do you find the value for the row you just inserted? This works differently with different databases. I know how it's done on ORACLE and mySql.
    How does it work with ACCESS through ODBC? How about MSSQL?

    I have discovered there's a LAST aggregate function which when I've tested it gets the just inserted auto-increment, but I'm not sure if it's reliable. You have to do:
    SELECT LAST(index-field) FROM table
    That ought to be faster than MAX, which I've noticed some people use. Persumable LAST will get the value from the last row in the table's natural order.
    In fact an auto-increment field has no business filling in missing slots since the main point is a a foreign key in other tables and a foreign key pointing to a deleted table row ought to be invalidated, not point to some unrelated successor record.
    I could use a separate table as a source of counters, of course, though that's one more call. In either case I'm worried about thread safety. In Oracle there are special sequence objects for this purpose which are incremented and read atomically. I'm not sure if the access driver transaction handling works adequately.
    Perhaps the safest approach might be to use a separate sequencer table and Java sychronisation to serialise access to each row in the sequencer table (assuming all the access is from the same app).

  • Setting data values on insert with a form

    I have a form I am using to insert records into a table, and I want to be able to set the value for a certain column ( in this case status) to be dependent on the a value that another column is set to. The specific case here is I have an application users table so if I get a request for a user asking for lookup privilege I want to status field to be set to approved other requests should have status set to pending.
    I have tried adding a process and doing an update to the status based on the value of the role, but it seems that the role is null when it gets to the process. I am merely referencing the column of the form. In this case :P7_ROLE.
    Any help would be appreciated.
    John

    For anyone who looked at this, I found my problem. The process I created was at the wrong sequence and was executed after the page cache was cleared.
    Newbie mistake:)

  • How to assign value from insert statement to variable from a trigger

    Hi,
    I got this really annoying problem and I don't know if I am doing it correctly.
    I have a BEFORE INSERT trigger on a table. When someone executes an insert statement I want to grab the value of a column from that statement and assign it to a variable and then do stuff with it. I'm stuck on the assignment.. look below..
    CREATE OR REPLACE TRIGGER CARS.geotest2_trigger
    BEFORE INSERT ON CARS.GEO_TEST2
    FOR EACH ROW
    DECLARE
    v_chainkey nchar(32);
    v_chainkey2 nchar(32);
    not_exists EXCEPTION;
    BEGIN
    :NEW.CHAINKEY := v_chainkey;
    SELECT GEO_TEST.CHAINKEY INTO v_chainkey2 FROM GEO_TEST WHERE GEO_TEST.CHAINKEY = v_chainkey;
    IF v_chainkey2 = '' or v_chainkey2 is null THEN
    RAISE not_exists;
    ELSE
    INSERT INTO GEO_TEST2 VALUES(:NEW.CHAINKEY, :NEW.BLA, :NEW.FOO);
    END IF;
    EXCEPTION
    WHEN not_exists THEN
    RAISE_APPLICATION_ERROR(-20010, 'Chainkey does not exist in parent table GEO_TEST');
    END;
    I keep getting this error
    Error: ORA-04098: trigger 'CARS.GEOTEST2_TRIGGER' is invalid and failed re-validation
    SQLState: 42000
    ErrorCode: 4098

    It isn't assigning because v_chainkey is not at the left hand side of the assignment statement.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> declare
      2    x  number := 5;
      3    y  number;
      4  begin
      5    x := y; -- does not assign anything to y; assigns NULL to x,
      6            -- because y is NULL at this point
      7            -- so, essentially the value 5 of x is *LOST* now
      8    dbms_output.put_line('x = '||x);
      9  end;
    10  /
    x =
    PL/SQL procedure successfully completed.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G>In any case, here's what you are probably looking for:
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> drop table geo_test;
    drop table geo_test
    ERROR at line 1:
    ORA-00942: table or view does not exist
    test@ORA10G> drop table geo_test2;
    drop table geo_test2
    ERROR at line 1:
    ORA-00942: table or view does not exist
    test@ORA10G>
    test@ORA10G> create table geo_test (chainkey nchar(32));
    Table created.
    test@ORA10G> insert into  geo_test (chainkey) values ('a');
    1 row created.
    test@ORA10G> insert into  geo_test (chainkey) values ('');
    1 row created.
    test@ORA10G>
    test@ORA10G> create table geo_test2 (chainkey nchar(32), bla number(1), foo number(1));
    Table created.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G> CREATE OR REPLACE TRIGGER geotest2_trigger
      2  BEFORE INSERT ON GEO_TEST2
      3  FOR EACH ROW
      4  DECLARE
      5    v_chainkey2  nchar(32);
      6    not_exists   EXCEPTION;
      7  BEGIN
      8    SELECT GEO_TEST.CHAINKEY INTO v_chainkey2 FROM GEO_TEST WHERE nvl(GEO_TEST.CHAINKEY,'~') = nvl(:new.chainkey,'~');
      9    IF v_chainkey2 is null THEN
    10      RAISE not_exists;
    11    END IF;
    12  EXCEPTION
    13    WHEN not_exists THEN
    14      RAISE_APPLICATION_ERROR(-20010, 'Chainkey does not exist in parent table GEO_TEST');
    15  END;
    16  /
    Trigger created.
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values ('b',1,1);
    insert into geo_test2 (chainkey,bla,foo) values ('b',1,1)
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "TEST.GEOTEST2_TRIGGER", line 5
    ORA-04088: error during execution of trigger 'TEST.GEOTEST2_TRIGGER'
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values (null,1,1);
    insert into geo_test2 (chainkey,bla,foo) values (null,1,1)
    ERROR at line 1:
    ORA-20010: Chainkey does not exist in parent table GEO_TEST
    ORA-06512: at "TEST.GEOTEST2_TRIGGER", line 11
    ORA-04088: error during execution of trigger 'TEST.GEOTEST2_TRIGGER'
    test@ORA10G>
    test@ORA10G> --
    test@ORA10G> insert into geo_test2 (chainkey,bla,foo) values ('a',1,1);
    1 row created.
    test@ORA10G>
    test@ORA10G>
    test@ORA10G>pratz
    I think the sole purpose of that "not_exists" exception is this -
    If you try to insert a NULL value for GEO_TEST2.CHAINKEY, then this trigger will throw an error even if at least one NULL value exists in GEO_TEST.CHAINKEY column.
    Not sure if that's something that you wanted.
    Message was edited by:
    pratz

  • Default values on insert

    This has probably been asked and answered, but I couldn't find the answer
    when searching the newsgroups. On most of my database tables, there is a
    date column to store the date when a row was added (it is never changed
    after insert). Without Kodo JDO, we would just set the default value for
    the column in the database. What is the easiest solution for this with
    Kodo?

    Is the only way to do what I want is to use InstanceCallbacks?Yeah, I would recommend using jdoPreStore() to set it to the current
    date.
    The other option is to have a trigger in the database itself override
    the value of the "date_created" field to the current time upon insert.
    In article <[email protected]>, Frank Riley wrote:
    Tom Davies <[email protected]> wrote in
    news:b5o7dg$gak$[email protected]:
    Frank Riley wrote:
    This has probably been asked and answered, but I couldn't find the
    answer when searching the newsgroups. On most of my database tables,
    there is a date column to store the date when a row was added (it is
    never changed after insert). Without Kodo JDO, we would just set the
    default value for the column in the database. What is the easiest
    solution for this with Kodo?You can set a default in the constructor of your persistent class:
    class Foo {
    public Foo(String v)
    if (v == null)
    v = "xyz";
    private String v;
    }But, for what I'm doing, this would set the field to the time the object
    was created, not the time the object was persisted to the database. Is
    the only way to do what I want is to use InstanceCallbacks?--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

Maybe you are looking for

  • There is a partfile open in mozilla/how do I close programme to delete the file/I already restarted computer

    I have windows 7 and mozilla firefox. when I try to delete one particular file from desktop it says it cannot be removed as it is open in mozilla firefox programme. I have restarted computer but still it wont go. How do I close mozilla and reopen it

  • MY IPOD TOUCH IS IN RECOVERY MODE

    MY IPOD IS IN RECOVERY MODE.IT HAS A CONNECTING TO ITUNES LOGO I TRIED REBOOTING IT IT DOES NOT WORK I TRIED ATLEAST SEARCHING FOR DEVICE WITH ITUNES IT DOESN'T APPEAR. I TRIED PRETTY MUCH WHAT ADVICE I HAVE BEEN GIVING ANY OTHER IDEAS PLEASE HELP!!

  • Is there a limit to number of recipients for an email?

    I need to send the same email to about 250 people. Is there a limit to the number of recipients Mail can handle in the BCC field? At the moment I can get all the address's from a spreadsheet as Comma separated text. Will this pasted into the BCC fiel

  • Depreciation run show different period

    My OAAQ result is 2008, I create and capitalize one asset in Apr. 2009, the depreciation method is straight line, The planned depreciation for May 2009 is 9 dollars. but when I run AFAB, it shows no result (the list contains no result), the detail is

  • IDVD how to set chapters markers according to the day

    iDVD wont let me set chapters markers according to the day of the trip. No good by minutes! I did have markers in the imported iMovie which have been ignored.