Formula calculated database field tries to insert null

Good Morning,
I have 3 database text items Amount , rate and result.
I input the two values (Amount and rate) and using the formula property "result" gets the calculated value.
On display all the values are shown correctly but when trying to save my information the text field "result" is trying to insert null.
Any suggestions?
Forms 11g
Thank you in Advance

794018 wrote:
Good Morning,
I have 3 database text items Amount , rate and result.
I input the two values (Amount and rate) and using the formula property "result" gets the calculated value.
On display all the values are shown correctly but when trying to save my information the text field "result" is trying to insert null.Formula item should not be database item. And also inserting result column value into database is not good idea.
Then after if you want to save it. create result database item and write trigger (When-Validate-Item) on both amount and rate filed and at trigger code, write
:result:=:amount*:rate;To display the result on form, create non database item and change property to formula and write the formula.
Hope this will help you
If someone's response is helpful or correct, please mark it accordingly.

Similar Messages

  • Database Adapter: How to Insert when one column is an identity column

    Hi everyone
    I'm developing a BPEL process who uses a database adapter to insert a row in a table of an SQL Server database. The problem is that the database adapter tries to insert a null value into the field that is the primary key of the table so the process fails. This is because I don't want to specify any value to this field because this field is specified in sql server as an identity column so this field doesn't need to have a value provided.
    I suppose the only solution is to set the database adapter to not insert any value to this field but how can i do that? is there any way to make the database adapter to insert data in only a few fields of a table and not in all fields, trying to insert null in these fields that no data have been provided?
    Thank You Very Much!

    In JDev->Applications Navigator->your project->Application Sources->Toplink->toplink_mappings.
    Upon selecting "toplink_mappings" in the structure window you will see the package. Expand to see your tables. Double click your table and it will open file in main area. Select your field that has identity column. And at the botton you will see "Use Sequencing" check box make sure you uncheck it.
    This will solve your problem.
    Dipal

  • Why JD is trying to insert fields not selected?

    Hi,
    My table has a default value for a column which is not null.
    (sysdate for the record creation date).
    When I insert a record through SQLPlus without selecting this
    column, this columns gets populated with the sysdate. The same
    works with Forms 4.5 also.
    But when I do the same thing with JDeveloper, the database is
    throwing back an error ORA-01400 Null cannot be inserted in to
    the database.
    The Query statement in the error (BEGIN INSERT...) shows all the
    fields in the table, though I haven't chosen the created date
    field. (nor a couple of other fields). Why JD is trying to
    insert values to the fields that are not there in the query and
    not selectd.
    Now what do I do with this??
    Can u tell me whether this JDeveloper tool is meant for
    developing serious applications.
    Gopal.
    null

    Hi,
    Bug for sure!. Because this tool is full of them! What I would
    like to know is the possibility of getting a patch. Is there any
    plan?
    One more thing. I think I have understood what is happening in
    this situation. Irrespective of what columns I select in the
    query, the entire metadata about the table comes and sits in the
    xml file. In my specific case, I tried to delete the attribute
    for created date from the xml file. Still it was trying to insert
    the value. Later, I found the notnull constraint in the xml file
    for this column. When I deleted that attribute also, it worked
    properly. I suspect that the insert statement is created by
    parsing the xml file. In that case the bug is not in IB data
    access layer. It is in creating the xml file itself.
    Hope u can throw more light in to this.
    --Gopal
    Oracle JDeveloper Team wrote:
    : This is a bug in the InfoBus data access layer. The suggested
    : workaround is to substitute the default value into the insert.
    : - PSW
    : Gopal (guest) wrote:
    : : Hi
    : : I used the queryInfo editor of the rowsetinfo. Once I browsed
    : the
    : : table, selected the required columns and pasted it to query.
    : : Second time,
    : : I just keyed in the columns and table in the appropriate
    places
    : : in
    : : the queryinfo editor. Results were same in both the cases.
    The
    : : query info
    : : in the code or in the editor shows only columns that I have
    : : selectd.
    : : Gopal
    : : JDev Team (guest) wrote:
    : : : How did you set up the query statement in JDev?
    : : : - PSW
    : : : Gopal (guest) wrote:
    : : : : Hi,
    : : : : My table has a default value for a column which is not
    : null.
    : : : : (sysdate for the record creation date).
    : : : : When I insert a record through SQLPlus without selecting
    : : this
    : : : : column, this columns gets populated with the sysdate. The
    : : same
    : : : : works with Forms 4.5 also.
    : : : : But when I do the same thing with JDeveloper, the
    database
    : is
    : : : : throwing back an error ORA-01400 Null cannot be inserted
    in
    : : to
    : : : : the database.
    : : : : The Query statement in the error (BEGIN INSERT...) shows
    : all
    : : : the
    : : : : fields in the table, though I haven't chosen the created
    : : date
    : : : : field. (nor a couple of other fields). Why JD is trying
    to
    : : : : insert values to the fields that are not there in the
    query
    : : and
    : : : : not selectd.
    : : : : Now what do I do with this??
    : : : : Can u tell me whether this JDeveloper tool is meant for
    : : : : developing serious applications.
    : : : : Gopal.
    : Oracle Technology Network
    : http://technet.oracle.com
    null

  • Error while trying to Insert a pdf file in database

    Hi All,
    I have sent this problem to Informix. By any chance if you had faced the same problem and found the solution, pls send mail to [email protected]
    Thanks
    Babu
    Hi there,
    I tried to insert a pdf file in to Informix database. I followed the guidelines
    given in the "InformixJDBC Driver
    Programmer's Guide". Actually my program works if i use
    PreparedStatement.setBytes method. But why
    PreparedStatement.setBinaryStream method is not working????.
    Here is the code snippet.....
    Connection conn = null;
    PreparedStatement ps = null;
    try
    File ff = new File("C:\\test.pdf");
    InputStream value = null;
    FileInputStream fileinp = new FileInputStream(ff);
    value = (InputStream) value;
    int len = (int) ff.length();
    System.out.println("len: " + len);
    conn = connect();
    String sql = "INSERT INTO dbep04m@inf10004:pg_wip_t (c_db,n_object,u_img) VALUES (\"2\",?,?)";
    if (conn != null)
    long stTime = System.currentTimeMillis();
    ps = conn.prepareStatement(sql);
    for (int ii=1;ii<=10000;ii++)
    ps.setInt(1,ii);
    ps.setBinaryStream(2,value,len);
    int rtVal = ps.executeUpdate();
    //System.out.println("return value" + rtVal);
    ps.close();
    conn.close();
    long endTime = System.currentTimeMillis();
    System.out.println("Total time taken for this run: " + (endTime-stTime)/(1000) + " seconds");
    catch (FileNotFoundException ex)
    ex.printStackTrace();
    catch (IOException ex)
    ex.printStackTrace();
    catch (SQLException ex)
    ex.printStackTrace();
    finally
    try
    if (ps != null)
    ps.close();
    if (conn != null)
    conn.close();
    catch (SQLException ex)
    ex.printStackTrace();
    I am getting the following error message.......
    java.sql.SQLException: Insufficient Blob data
    at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java)
    at com.informix.jdbc.IfxSqli.sendStreamBlob(IfxSqli.java, Compiled Code)
    at com.informix.jdbc.IfxSqli.sendBlob(IfxSqli.java, Compiled Code)
    at com.informix.jdbc.IfxSqli.sendBind(IfxSqli.java, Compiled Code)
    at com.informix.jdbc.IfxSqli.sendExecute(IfxSqli.java)
    at com.informix.jdbc.IfxSqli.sendCommand(IfxSqli.java)
    at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.java)
    at com.informix.jdbc.IfxResultSet.executeUpdate(IfxResultSet.java)
    at com.informix.jdbc.IfxStatement.executeUpdateImpl(IfxStatement.java)
    at com.informix.jdbc.IfxPreparedStatement.executeUpdate(IfxPreparedStatement.java)
    at com.aexp.eaim.iu.isp.testcase.InsertBlob.insertUsingSql(InsertBlob.java, Compiled Code)
    at com.aexp.eaim.iu.isp.testcase.InsertBlob.main(InsertBlob.java:194)
    Here is the example given in the "Informix JDBC Driver Programmer's Guide". In the line maked bold, the blob size was hard coded as 10. Then
    why you are trying to find the file length???.
    try
    stmt = conn.createStatement();
    stmt.executeUpdate("create table tab1(col1 byte)");
    catch ( SQLException e)
    System.out.println("Failed to create table ..." + e.getMessage());
    System.out.println("Trying to insert data using Prepare Statement ...");
    try
    pstmt = conn.prepareStatement("insert into tab1 values (?)");
    catch (SQLException e)
    System.out.println("Failed to Insert into tab:" + e.toString());
    File file = new File("data.dat");
    int fileLength = (int) file.length();
    InputStream value = null;
    FileInputStream fileinp = null;
    int row = 0;
    String str = null;
    int rc = 0;
    ResultSet rs = null;
    System.out.println("Inserting data ...\n");
    try
    fileinp = new FileInputStream(file);
    value = (InputStream)fileinp;
    catch (Exception e) {}
    try
    pstmt.setBinaryStream(1,value,10); //set 1st column
    catch (SQLException e)
    System.out.println("Unable to set parameter");
    set_execute();
    public static void set_execute()
    try
    pstmt.executeUpdate();
    catch (SQLException e)
    System.out.println("Failed to Insert into tab:" + e.toString());
    e.printStackTrace();
    Best Regards
    Babu

    sorry!!!. There is an error in the code
    old code :
    value = (InputStream) value ;
    should be code :
    value = (InputStream) fileinp;

  • Insert Image to table from a Non Database Field

    Hallo,
    db- 9i EE R2
    forms - 6i R2
    OS - W2003
    I have a requirement to upload Images to the database from forms.
    I planned to keep the transaction data and the Images separately in different tables with a reference.
    So, I created the Image field (BLOB)  with a Non Database Field in the Form and use a button to upload the Image. (using READ_IMAGE_FILE).
    I tried to insert the Image to the Actual Image table in PRE-INSERT Trigger at block level.
    But I was not able to Insert the using reference method.  (Cannot compile the PRE-INSERT)
          INSERT INTO IMAGE_TB (ID,IMAGE)
           VALUES (IMAGE_SEQ.NEXTVAL, :ITINERARY_MAP.IMAGE);
    So, Please help me to insert a image to different table from a Non Database Field?
    Thanks

    I don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.

  • To insert " NULL " in MS SQL Database

    Hi Friends,
    We have a scenario where a decimal value is sent from the source and it has to be updated in the MS SQL Database accordingly. If the data is sent for the decimal field, the decimal value gets updated.
    We need to insert " NULL " in the database, if no data is passed for that particular field.
    Kindly help us in achieving this functionality.
    Regards,
    Sherin Jose P

    in the adapter -> processing tab use the option
    XML Schema Interpreter
    Field
    Entry
    Key Tags Mandatory
    Set the indicator to specify that there must be conditions in the key tag.
    Interpretation of Empty String Values
    Specify how empty text fields are to be handled.
    u25CF      NULL value
    In the case of INSERT and UPDATE statements, empty fields are handled like NULL fields (do not exist) and are not inserted in the database.
    u25CF      Empty string
    In the case of INSERT and UPDATE statements, empty texts are inserted in the columns.
    http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/content.htm

  • Oracle error ORA-01461when trying to insert into an ORACLE BLOB field

    I am getting Oracle error ‘ORA-01461: can bind a LONG value only  for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (<1K) picture BLOB.(JPG). Any ideas?
    BTW, when using a SQL Server datasource using the same code.... everything works with no problems.
    ORACLE version is 11.2.0.1
    The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)
    Here is my code:
    <cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))>
    <cfif file_mime EQ 'jpg'><cfset file_mime = 'jpeg'></cfif>
    <cfset file_mime = 'data:image/' & file_mime & ';base64,'>
    <cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")>
    <cfset ramfile = "ram://" & postedXMLRoot.objname.XmlText>
    <cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true">
    <cffile action="readbinary" file="#ramfile#" variable="image_bin">
    <cffile action="delete" file="#ramfile#">
    <cfquery name="InsertImage" datasource="#datasource#">
    INSERT INTO test_images
    image_blob
    SELECT
    <cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB">
    FROM          dual
    </cfquery>

    Can't you use "alter index <shema.spatial_index_name> rebuild ONLINE" ? Thanks. I could switch to "rebuild ONLINE" and see if that helps. Are there any potential adverse effects going forward, e.g. significantly longer rebuild than not using the ONLINE keyword, etc? Also wondering if spatial index operations (index type = DOMAIN) obey all the typical things you'd expect with "regular" indexes, e.g. B-TREE, etc.

  • "The selected cells are read-only" error on Custom Field when trying to insert in Datasheet mode

    I have a custom field that works completely fine. Yesterday our QA team found out that when trying to insert in Datasheet format, the error "The selected cells are read-only" was thrown. Any ideas? I tried passing the following property to my fldtypes_field.xml file:
        <Field Name="ReadOnly">FALSE</Field>
    No luck.Victor Palma

    Unfortunately it did not work. I also developed the code and access the field and checked its property called "ReadOnlyField"  which is already set to false.
    Below is the xml that i am using. Can you please share the xml that you had used?
    <?xml version="1.0" encoding="utf-8"?>
    <FieldTypes>
      <FieldType>
        <Field Name="TypeName">MyCustomField</Field>
        <Field Name="ParentType">Text</Field>
        <Field Name="TypeDisplayName"> My Custom Field</Field>
        <Field Name="TypeShortDescription"> My Custom Field</Field>
        <Field Name="AllowBaseTypeRendering">True</Field>
        <Field Name="ReadOnlyField">False</Field>
        <Field Name="UserCreatable">TRUE</Field>
        <Field Name="ShowInListCreate">TRUE</Field>
        <Field Name="ShowInSurveyCreate">TRUE</Field>
        <Field Name="ShowInDocumentLibraryCreate">TRUE</Field>
        <Field Name="ShowInColumnTemplateCreate">TRUE</Field>
        <Field Name="FieldTypeClass">My Assembly Information goes here</Field>
      </FieldType>
    </FieldTypes>

  • Number database field treated as String in formula when using 64bit runtime

    Hey just a quick shout out to those with the above problem or those following the now "closed but unanswered" thread by the same name - if you're getting "A string is required here" error messages after switching over to the 64-bit runtime, or other weird loss of formatting issues, then try turning off the "Verify on First Refresh" or "Verify Stored Procedures on First Refresh" options in File | Report Options... as the case may be.

    Previous post was here.
    Number database field treated as String in formula when using 64bit runtime
    Thanks for the find ezachman.

  • Trying to store a custom tag in a database field

    I have a simple custom tag that displays an image.  We'll call it <cf_checkmark>.  All it does is display a nice little checkmark.  Saves me from having to rewrite the <img src="...."> tag over and over and over.  I want to store this tag in a database field, so it is returned as a value in my query results.  (I'm not storing the code in the database, just the text "<cf_checkmark>").  Only problem is coldfusion doesn't render the custom tag when I output the result.  The tag is there, it's just not rendering or executing.  If I do a View Source I can see <cf_checkmark> in the source.  It just doesn't execute or render.
    My guess is that ColdFusion executes all the cf code before it outputs the query results.  Therefore it doesn't recognize the text in the query result as a custom tag.  Is there any way to get this to work?

    Write it to a file and cfinclude the file.
    But for one line of code, why bother.

  • How to insert null in C++ Class library

    I am using oo4o Class library. I am inserting arrays into the database
    This is my code (it is simplified):
    // C++ Code
    OStartup();
    oRes = m_o_Session.Open(); // m_o_Session is OSession // oRes is oresult
    oRes = m_o_db.Open(m_o_Session,sSource,sUser,sPassword); // m_o_db is ODatabase
    oRes = m_o_db.BeginTrans();
    // the insert proccess
    // Add Params
    OParameterCollection oParamCol = oDB.GetParameters();
    OParamArray o_NUM_INDEX_Ary = oParamCol.AddTable("xi_lv_NUM_INDEX",OPARAMETER_INVAR,OTYPE_NUMBER,10);
    OParamArray o_TEXT_Ary = oParamCol.AddTable("xi_sv_TEXT",OPARAMETER_INVAR,OTYPE_VARCHAR2,10,250);
    OParamArray o_NUMBER_OPT_Ary = oParamCol.AddTable("xi_dv_NUMBER_OPT",OPARAMETER_INVAR,OTYPE_NUMBER,10);
    for(int i =0;i<10;i++){
    o_NUM_INDEX_Ary.SetValue(i,i);
    o_TEXT_Ary.SetValue("asdasd",i);
    o_NUMBER_OPT_Ary.SetValue(??????,i);
    oRes = oDB.ExecuteSQL("INSERT INTO GEN_TABLE_TEST_T (NUM_INDEX,TEXT,NUMBER_OPT) VALUES (:xi_lv_NUM_INDEX,:xi_sv_TEXT,:xi_dv_NUMBER_OPT)");
    oParamCol.Remove("xi_lv_NUM_INDEX");
    oParamCol.Remove("xi_sv_TEXT");
    oParamCol.Remove("xi_dv_NUMBER_OPT");
    oRes = m_o_db.CommitTrans();
    oRes = m_o_db.Close();
    m_o_Session.Close();
    OShutdown();
    my question is where I marked ?????? I want to insert null to a numeric field
    I tried to put NULL instead of ?????? - does not work
    I tried to put OValue initialized with null instead of ?????? - does not work
    and I need to send him in the insert Sql because sometimes it does not null and i have to give him value.
    thanks is advance
    Yoav

    Just create an empty OValue object:
    OValue nullv; // construct null value
    then call the appropriate SetValue method...
    xxx.SetValue(nullv);
    Should do it.

  • JDev 9i RC2 Failure when trying to insert a row with DATATAGS

    500 Internal Server Error
    oracle.jbo.JboException: Need the datasource property defined if not used
    within a DefinitionIterate, a RowSetIterator or a Row tag
    This is the error message occuring when i do the following
    I was trying to insert a record via DataTags (JBO Datatags in JDeveloper 9i
    Release Candidate 2).
    The following should show you the details
    <body bgcolor=#CCCCCC>
    <br>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <br>
    <jbo:ApplicationModule id="am"
    configname="PrevDoc.PrevDocModule.PrevDocModuleLocal" username="zode"
    password="zode"/>
    <br>
    <jbo:DataSource id="ds" appid="am" viewobject="MicEindocView">
    </jbo:DataSource>
    <br>
    <center>
    <p><b>MicEindocView Search Results</b></p>
    <br>
    <jbo:Row id="newRow" datasource="ds" action="Create" />
    <jbo:SetAttribute dataitem="Efdsid" value="9999" />
    <jbo:SetAttribute dataitem="Efdmandant" value="55" />
    <jbo:SetAttribute dataitem="Efdwerk" value="00" />
    <jbo:SetAttribute dataitem="Efdperiode" value='200204' />
    <jbo:SetAttribute dataitem="Efdvssart" value='AWB' />
    <jbo:SetAttribute dataitem="Efdvssnr" value='TEST WEB JODE' />
    </jbo:Row>
    <jbo:Commit appid="am" />
    <jbo:ReleasePageResources releasemode="Stateless"/>
    </center>
    </body>
    </html>
    These fields are not null fields in the database. At least this fields must be
    entered.
    Can you please tell me the reason why the above error occurs at any time??
    Thanks
    I appreciate all your help on this issue.
    Thanks a lot

    Josef,
    Remove the closing slash in this tag.
    <jbo:Row id="newRow" datasource="ds" action="Create" />
    I am sure you meant to close it with the </jbo:Row> some lines below.
    That explain the complaint of the setAttributeTag missing their context.
    Charles.

  • Field not in "Insert Group" list

    I need to group a report's results based on a field, but that field is not listed among the fields in the "Insert Group" dialog.  What are some reasons a field would not show up there, despite being in the Database Fields list in Field Explorer?

    If the field is a memo field or if you are trying to insert a formula as a group then the formula should not contain any summaries and evaluation function like whieprintingrecords; Also you cannot insert a group on formula that doen't contain any database field.
    regards,
    Raghavendra.G

  • Formula calculation doubt ?!

    Hello ,
    Can we make a database item in a form store a formula calculation ..?
    :ITEM_QTY * :ITEM_PRICEor we have 2 make it displayed...!
    Regards,
    Abdetu...

    An item in a Data Block does not have to be displayed/visible in your form in order to stored/hold a formula calculation value. Create a test form which displays the calculation field initially so you know it is working correctly. Then set the "Canvas" property to NULL for the item and add a button that displays the value of the non-displayed calculated item in a Message(). When you click the button, you will see the value displayed! ;-)
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Oct 29, 2010 8:48 AM

  • Xml file, non database field etc..

    Hi,
    There is a requirement for putting a non database field in an
    infobus grid control and populating it with some value at the
    runtime. As this is not directly available in gridcontrol, many
    have tried using a join query as I could see from the
    postings.(Like select deptcode,desc from emp, dept where
    emp.deptcode = dept.deptcode). This works well when the data is
    queried from the database. But when a new deptcode is entered, it
    is not possible to get the corrosponding value from the database
    and show it on this field, as u get readonly attribute error.
    Even if u explicitly change the attribute to updateable the error
    will remain as such.
    The cause of this problem, I have tracked down to the xml file.
    The entity for the updateable table (in this case EMP) does not
    have the attribute for deptdesc. If this is manually added, it is
    possible to add values to the deptdesc column. The catch is when
    inserting a row to the database. All the attributes in the
    entity
    will appear in the insert statement and u end up with an invalid
    column name error for the deptdesc column.
    Seeing this consistant behaviour, I assume that the insert
    statement is created by parsing the xml file. Had there been an
    attribute value in the xml file for insert into database (just
    like IsNotNull etc.. perhaps IsUpdateable which can be set
    manually), while parsing this attribute can be removed.
    To do this I would like to know where this xml parser is
    implemented in jdev. Is it possible for me to change its
    behaviour or can I expect to get a patch for this? This
    functionaliy is very much essential for me, as I am in the middle
    of a very large project using jdev2.0. I don't mind implementing
    it, if the source is available.
    Any helpful suggestions, comments are welcome. Sorry for the long
    post and thanks
    --Gopal
    null

    I don't think it will work with a non-db-item. But you could create a separate block based on your image_tb-table, use read_image_file on the then db-based-column and then simpy issue a commit_form.

Maybe you are looking for

  • FTP Adapter in clustered/HA environment

    We are deploying a clustered environment and are noticing that the FTP adapter seems to be running in both servers. I deployed a listening channel using the VIP connection. It activated the FTP channel on one server but the other server is giving inv

  • Belle & Orange UK N8

    Was Orange UK forgotten about in all this? When I called Orange about the update they didn't have a clue and I don't see them anywhere in the list. Anyone work for or have contacts in Nokia or Orange UK that can confirm they are working on getting th

  • IWeb 08 Blog links not working in Safari

    I just published several blogs on my site and i cannot see the posts using Safari. Works fin with FireFox and IE. Any suggestions?

  • How to create monitor based on the data collected by rule?

    I have an application which comes with a built-in command: GetBackLogNm.exe. Running this command can get the current backlog number in the system. Now I need to create a monitor which should trigger the alert if the backlog keeps increasing for 2 ho

  • Huge tracts of white space padding in topics

    Mostly whenever there is a javascript call, like for a fixed sized popup. This is no a huge problem, but it seems that this also causing trailing spaces after the link to disappear and that is a problem.