Cannot Save NULL value to database

I cannot save a null value through the data tab in the multi-row updates pane. It always gives me an error such as "Invalid number". It works fine through normal SQL update statement. Is there a preference somewhere to turn this on?
thanks in advance
Paul P

Hi Paul,
Just use the backspace key to obliterate any existing value -- that makes it null. Afterwards, if you refresh or close/reopen the object, the data tab will display any null as the value set in Tools | Preferences | Database | Advanced | Display Null Value As .
Regards,
Gary
SQL Developer Team

Similar Messages

  • HELP NEEDED !! Null values in Database

    Hi there !!
    I need help with EJB 3.0 passing null values to database. The situation looks like that :
    I have created EJB entity class called "Osoba.java", it is in relation
    with "Rola.java" (one to many). Each Object of class Osoba can have
    many Roles. Then I created "OsobaServiceBean.java " I included it with
    metod "CreateUnregisteredOsoba(Osoba , Boolean)". From "flex" level I
    call this bean - call is accepted, and as a result new object of class Osoba is added to database. Problem is that only one column is filled in table,
    dispite that in service bean I enforce it to fill all columns (see
    source code - file OsobaServiceBean.java , method
    createUnregisteredOsoba() )
    I provided source code here :
    FILE Rola.java
    package test.granite.ejb3.entity ;
    import javax.persistence.Basic;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.ManyToOne;
    @Entity
    public class Rola extends AbstractEntity {
    private static final long serialVersionUID = 1L;
    @Basic
    private String login = new String("");
    @Basic
    private String rola = new String("");
    @Basic
    private String roleGroup = new String("");
    @Basic
    private Boolean zatwierdzony = new Boolean(false);
    @ManyToOne(optional=false)
    private Osoba osoba;
    public Boolean getZatwierdzony() {
    return zatwierdzony;
    public void setZatwierdzony(Boolean zatwierdzony) {
    this.zatwierdzony = zatwierdzony;
    public String getLogin() {
    return login;
    public void setLogin(String login) {
    this.login = login;
    public String getRola() {
    return rola;
    public void setRola(String rola) {
    this.rola = rola;
    public Osoba getOsoba() {
    return osoba;
    public void setOsoba(Osoba osoba) {
    this.osoba = osoba;
    public String getRoleGroup() {
    return roleGroup;
    public void setRoleGroup(String roleGroup) {
    this.roleGroup = roleGroup;
    FILE Osoba.java
    package test.granite.ejb3.entity ;
    import java.util.HashSet;
    import java.util.Set;
    import javax.persistence.Basic;
    import javax.persistence.CascadeType;
    import javax.persistence.Entity;
    import javax.persistence.FetchType;
    import javax.persistence.OneToMany;
    @Entity
    public class Osoba extends AbstractEntity {
    private static final long serialVersionUID = 1L;
    @Basic
    private String imie;
    @Basic
    private String nazwisko;
    @Basic
    private String login;
    @Basic
    private String haslo;
    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER,
    mappedBy="osoba")
    private Set<Rola> role = new HashSet<Rola>();
    @Basic
    private String email;
    @Basic
    private String nrTelefonu;
    @Basic
    private int rokStudiow;
    public String getPelneImie() {
    StringBuilder sb = new StringBuilder();
    if (imie != null && imie.length() > 0)
    sb.append(imie);
    if (nazwisko != null && nazwisko.length() > 0) {
    if (sb.length() > 0)
    sb.append(' ');
    sb.append(nazwisko);
    return sb.toString();
    public String getImie() {
    return imie;
    public void setImie(String imie) {
    this.imie = imie;
    public String getNazwisko() {
    return nazwisko;
    public void setNazwisko(String nazwisko) {
    this.nazwisko = nazwisko;
    public String getLogin() {
    return login;
    public void setLogin(String login) {
    this.login = login;
    public String getHaslo() {
    return haslo;
    public void setHaslo(String haslo) {
    this.haslo = haslo;
    public Set<Rola> getRole() {
    return role;
    public void setRole(Set<Rola> role) {
    this.role = role;
    public String getEmail() {
    return email;
    public void setEmail(String email) {
    this.email = email;
    public String getNrTelefonu() {
    return nrTelefonu;
    public void setNrTelefonu(String nrTelefonu) {
    this.nrTelefonu = nrTelefonu;
    public int getRokStudiow() {
    return rokStudiow;
    public void setRokStudiow(int rokStudiow) {
    this.rokStudiow = rokStudiow;
    FILE OsobaServiceBean.java
    package test.granite.ejb3.service;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Set;
    import javax.annotation.security.RolesAllowed;
    import javax.ejb.Local;
    import javax.ejb.Stateless;
    import javax.persistence.Query;
    import org.jboss.annotation.security.SecurityDomain ;
    import test.granite.ejb3.entity.Osoba;
    import test.granite.ejb3.entity.Rola;
    @Stateless
    @Local(OsobaService.class)
    @SecurityDomain("other")
    public class OsobaServiceBean extends AbstractEntityService implements
    OsobaService{
    private static final long serialVersionUID = 1L;
    public OsobaServiceBean() {
    super();
    public List<Osoba> findAllOsoba() {
    return findAll(Osoba.class);
    @SuppressWarnings("unchecked")
    public List<Osoba> findAllOsoba(String name) {
    Query query = manager.createQuery (
    "select distinct p from Osoba p " +
    "where upper(p.imie) like upper('%" + name + "%')
    or upper(p.nazwisko) like upper('%" + name + "%')"
    return query.getResultList();
    public Osoba createOsoba(Osoba person) { // pozwalamy
    tworzyc zeby niezalogowany
    return manager.merge (person); //
    uzytkownik utworzyl osobe
    } // ale
    osoba ta i tak nie bedzie jeszcze
    // zatwierdzona
    @RolesAllowed({"unregistered"})
    public Osoba createUnregisteredOsoba(Osoba person, boolean
    zatwierdzony) {
    Rola niezarejestrowany = new Rola();
    niezarejestrowany.setRola("user");
    niezarejestrowany.setOsoba(person);
    niezarejestrowany.setRoleGroup("Roles");
    niezarejestrowany.setLogin(person.getLogin());
    niezarejestrowany.setZatwierdzony(zatwierdzony);
    Set<Rola> role = new HashSet<Rola>();
    role.add(niezarejestrowany);
    // Arrays;
    Object a[] = role.toArray();
    Rola temp;
    temp = (Rola)a[0];
    System.out.println("Login = " + temp.getLogin() + //
    added only for check !!
    "Rola = " + temp.getLogin() +
    "Zatwierdzony = " +
    temp.getZatwierdzony() +
    "Rolegroup = " + temp.getRoleGroup());
    person.setRole (role);
    return manager.merge(person); //
    uzytkownik utworzyl osobe
    } // ale
    osoba ta i tak nie bedzie jeszcze
    public Osoba modifyOsoba(Osoba person) {
    return manager.merge(person);
    @RolesAllowed({"admin"})
    public void deleteOsoba(Osoba person) {
    person = manager.find(Osoba.class, person.getId());
    manager.remove(person);
    public void deleteRola(Rola rola) {
    rola = manager.find(Rola.class, rola.getId());
    rola.getOsoba().getRole().remove(rola);
    manager.remove(rola);
    DATABASE LISTING :
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    | id | ENTITY_UID | version | rola |
    zatwierdzony | osoba_id | login | RoleGroup |
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    | 1 | | NULL | unregistered |
    | 0 | unregistered | Roles | NULL |
    | 33 | eee91bd9-8c5f-4154-8260-3cac9a18eb97 | 0 | user |
    | 34 | NULL | NULL |
    | 32 | a7ed4e8d-a1ba-473a-921c-73c8f8f89efb | 0 | user |
    | 33 | NULL | NULL |
    -----------------------------------------------------------------+----------\
    --------------------------------------------------------+
    The row numer 1 is added by hand and it works. row number 33 and 32
    are added to database by method CreateUnregisteredOsoba. As you can
    see fields login as well as Roles and RoleGroup are empty (NULL). What
    Im doing wrong ?
    Thanks for your help -
    Roman Kli&#347;
    PS. Table Osoba works fine - everything is added as I want.

    I solved problem.
    The reason why EJB had not added anything to database NULL was becouse wrong names of class. Ive refactored whole class Rola.java to RolaClass.java and suddenly it worked.
    True reason is still unknown but most importent is that it works.
    Thanx for reading topic - hope next time someone will answer my questions.
    By !!

  • Unable to save Sequence value to Database

    Hi,
    I am trying to pupulate a sequence value so that I can use it as primary key along with the combination of other columns later. My problem is that the sequence value is getting populated on the page with the right value, But is not getting saved to the database. The Column is there in the VO. The column is blank on the table. When I print it(System.out.println("Seq=" + xSeq.getText(pageContext));), the value is null. Can anyone please advice what I am doing wrong OR if I am missing anything here.
    Thanks
    Ali
    My CO file:
    ============
    package lac.oracle.apps.lac.jobperf.server.webui;
    import oracle.apps.fnd.common.VersionInfo;
    import oracle.apps.fnd.framework.webui.OAControllerImpl;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OADialogPage;
    import oracle.apps.fnd.framework.webui.TransactionUnitHelper;
    import oracle.jbo.domain.Number;
    import oracle.apps.fnd.common.MessageToken;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
    import oracle.apps.fnd.framework.webui.beans.layout.OAMessageComponentLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import com.sun.java.util.collections.HashMap;
    import oracle.bali.share.util.IntegerUtils;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    * Controller for ...
    public class ReviewCreateCO extends OAControllerImpl
    public static final String RCS_ID="$Header$";
    public static final boolean RCS_ID_RECORDED =
    VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
    * Layout and page setup logic for a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    OAApplicationModule am; // dave
    OADBTransaction oadbxn; // dave
    oracle.jbo.domain.Number Seq;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    // Always call this first
    super.processRequest(pageContext, webBean);
    am = pageContext.getApplicationModule(webBean); // dave
    oadbxn = am.getOADBTransaction(); // dave
    OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();
    OAMessageComponentLayoutBean mainRn = (OAMessageComponentLayoutBean)pageLayout.findIndexedChildRecursive("MainRN");
    // If isBackNavigationFired = false, we are here after a valid navigation
    // (the user selected the Create Review button) and we should proceed
    // normally and initialize a new Review.
    if (!pageContext.isBackNavigationFired(false))
    // We indicate that we are starting the create transaction(this
    // is used to ensure correct Back button behavior).
    TransactionUnitHelper.startTransactionUnit(pageContext,"jobperfCreateTxn");
    // This test ensures that we don't try to create a new review if we
    // had a JVM failover, or if a recycled application module is activated
    // after passivation. If this things happen, BC4J will be able to find
    // the row you created so the user can resume work.
    if (!pageContext.isFormSubmission())
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    // String Seq = (String)oadbxn.getValue("Seq");
    oracle.jbo.domain.Number Seq = oadbxn.getSequenceValue("lac.LAC_CM_PERF_REVIEW_SEQ");
    OAMessageStyledTextBean xSeq = (OAMessageStyledTextBean)mainRn.findIndexedChildRecursive("Seq");
    xSeq.setText(Seq.toString());
    am.invokeMethod("createReview",null);
    // Initialize the ApplicationpropertiesVO for PPR.
    // am.invokeMethod("init");
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext,"jobperfCreateTxn", true))
    // We got here through some use of the browser "Back" button, so we
    // want to display a stale data error and disallow access to the page.
    // if this were a real application, we would propably display a more
    // context-specific message telling the user she can't use the browser
    //"Back" button and the "Create" page. Instead, we wanted to illustrate
    // how to display the Applications standard NAVIGATION ERROR message.
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    } // end processRequest()
    * Procedure to handle form submissions for form elements in
    * a region.
    * @param pageContext the current OA page context
    * @param webBean the web bean corresponding to the region
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    {    //super.processFormRequest(pageContext, webBean);
    // Always call this first.
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();
    OAMessageComponentLayoutBean mainRn = (OAMessageComponentLayoutBean)pageLayout.findIndexedChildRecursive("MainRN");
    // Pressing the "Apply" button means the transaction should be validated
    // and committed.
    // OAPageLayoutBean pageLayout = pageContext.getPageLayoutBean();
    // String Seq = SeqText.getText(pageContext);
    oadbxn.putValue("Seq", Seq);
    am = pageContext.getApplicationModule(webBean);
    oadbxn = am.getOADBTransaction();
    if (pageContext.getParameter("Apply") != null)
    // Generally in the tutorial application and the labs, we've illustrated
    // all BC4J interaction on the server (except for the AMs, of course). Here,
    // we're dealing with the VO directly so the comments about the reasons
    // why we're obtaining values from the VO and not the request make sense
    // in context.
    OAViewObject vo = (OAViewObject)am.findViewObject("jobperfVO1");
    // Note that we have to get this value from the VO because the EO will
    // assemble it during its validation cycle.
    // For performance reasons, we should generally be calling getEmployeeName()
    // on the EmployeeFullVORowImpl object, but we don't want to do this
    // on the client so we're illustrating the interface-appropriate call. If
    // we implemented this code in the AM where it belongs, we would use the
    // other approach.
    String employeeName = (String)vo.getCurrentRow().getAttribute("FullName");
    // We need to get a String so we can pass it to the MessageToken array below. Note
    // that we are getting this value from the VO (we could also get it from.
    // the Bean as shown in the Drilldwon to Details lab) because the item style is messageStyledText,
    // so the value isn't put on the request like a messaqeTextInput value is.
    String employeeNumber = (String)vo.getCurrentRow().getAttribute("EmployeeNumber");
    //ma String employeeNum = String.valueOf(employeeNumber.intValue());
    //ma Number employeeNumber = (Number)vo.getCurrentRow().getAttribute("EmployeeNumber");
    //ma String employeeNum = String.valueOf(employeeNumber.intValue());
    // Simply telling the transaction to commit will cause all the Entity Object validation
    // to fire.
    // Note: there's no reason for a developer to perform a rollback. This is handled by
    // the framework if errors are encountered.
    OAMessageStyledTextBean xSeq = (OAMessageStyledTextBean)mainRn.findIndexedChildRecursive("Seq");
    System.out.println("Seq=" + xSeq.getText(pageContext));
    am.invokeMethod("apply");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "jobperfCreateTxn");
    // Assuming the "commit" succeeds, navigate back to the "Search" page with
    // the user's search criteria intact and display a "Confirmation" message
    // at the top of the page.
    MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName),
    new MessageToken("EMP_NUMBER", employeeNumber) };
    OAException confirmMessage = new OAException("PER", "LAC_FWK_TBX_T_EMP_CREATE_CONF", tokens,
    OAException.CONFIRMATION, null);
    // Per the UI guidelines, we want to add the confirmation message at the
    // top of the search/results page and we want the old search criteria and
    // results to display.
    pageContext.putDialogMessage(confirmMessage);
    HashMap params = new HashMap(1);
    // Replace the current employeeNumber request parameter value with "X"
    params.put("employeeNumber", "employeeNumber");
    // IntegerUtils is a handy utility
    params.put("employeeNumber",IntegerUtils.getInteger(5));
    pageContext.forwardImmediately(
    "OA.jsp?page=/lac/oracle/apps/lac/jobperf/webui/jobperfPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    params, //null,
    false, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES);
    else if (pageContext.getParameter("Cancel") != null)
    am.invokeMethod("rollbackReview");
    // Indicate that the Create transaction is complete.
    TransactionUnitHelper.endTransactionUnit(pageContext, "jobperfCreateTxn");
    pageContext.forwardImmediately("OA.jsp?page=/lac/oracle/apps/lac/jobperf/webui/jobperfPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    false, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    } // end processFormRequest()
    }

    Hi Tapash,
    Thanks for all of you guys(Tapash/Sumit/user550094) help. The sequence is working and also populating the values in the table when I do not have any validation checks imposed on it.
    If I add any validations as mentioned in the exercise for create page where it checks if the sequence can be updated while null and so on... and throws appropriate exception. I get error. That is the code that I mentioned above.
    Here is the validation code for EOImpl:
    As mentioned below in order for the code to compile and work I had to comment the "throw new OAAttrvalException". If I uncomment the
    "throw new OAAttrvalException" part, it gives me the following error while compiling:
    "Error(796,13): method getPrimarykey not found in class lac.oracle.apps.lac.jobperf.schema.server.jobperfEOImpl"
    public void setSeq(Number value)
    // Because of the declaritive validation that you specified for this attribute,
    // BC4J validates that this can be updated only on a new line, and that this,
    // mandatory attribute cannot be null. This code adds the additional check
    // of only allowing an update if the value is null to prevent changes while
    // the object is in memory.
    if (getSeq() != null)
    /* throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), //getSeq(), // EO name
    getPrimarykey(), // EO PK
    "Seq", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_NO_UPDATE"); // Message name */
    if (value != null)
    // Seq ID must be unique. To verify this, check both the
    // entity cache and the database. In this case, it's appropriate
    // to use findByPrimaryKey() because you're unlikely to get a match, and
    // and are therefore unlikely to pull a bunch of large objects into memory.
    // Note that findByPrimaryKey() is guaranteed to check all employees.
    // First it checks the entity cache, then it checks the database.
    OADBTransaction transaction = getOADBTransaction();
    Object[] employeeKey = {value};
    EntityDefImpl empDefinition = jobperfEOImpl.getDefinitionObject();
    jobperfEOImpl Seq =
    (jobperfEOImpl) empDefinition.findByPrimaryKey(transaction, new Key(employeeKey));
    if (Seq != null)
    /* throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // .getSeq(), // EO name
    getPrimaryKey(), // EO PK
    "Seq", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_UNIQUE"); // Message name */
    // Note that this is the point at which the value is actually set on the EO cache
    // (during the scope of setAttributeInternal processing). If you don't make this
    // call after you perform your validation, your value will not be set correctly.
    // Also, any declarative validation that you define for this attribute is executed
    // within this method.
    setAttributeInternal(SEQ, value);
    } // end SetSeq
    I am sorry if I have confused you. I really did not mean to do it.
    Thanks,
    Ali

  • Cannot display NULL values as 0

    I am trying to display a count by dates (which I am grouping by), but when the value is null, nothing displays and the dates are not displayed either. I want to display every date in the range entered in the prompt and its respective count, even if the count is '0', I want to see a '0'.
    I have tried every suggestion posted on this forum for that same issue and nothing has worked.
    I have checked the boxes under Report Options for 'Convert Database NULL values to Default' and 'Convert Other NULL Values to Default'. I had also created a formula for the count and had selected 'Default Values For Nulls', and that didn't work either.
    Can someone suggest something else I may need to check on my report? I can't find any solution,and I'm desperate at this point.
    Thanks.

    You can do so but using a stored procedure.I have done this...since I have got the same requirement.
    I am pasting a sample of the stored procedure.This stored procedure is created in Oracle.
    create or replace procedure          call_as_all_dates(
    allDates IN OUT PKG_PCI_Compliance.allDates,
    bDate IN solidcor.AS_SS_EVENTS.EVT_TIMESTAMP%TYPE,
    eDate IN solidcor.AS_SS_EVENTS.EVT_TIMESTAMP%TYPE
    as
    dateDiff number;
    begin
    dateDiff :=TRUNC(TO_NUMBER(SUBSTR((eDate-bDate),1, INSTR(eDate-bDate,' '))));
    open allDates FOR select rownum,0 as custID,to_char(null) as gName,to_char(null) as hName,trunc(bDate+ rownum) AS_DATE,to_char(null) as uName,to_char(null) as
    evtName,to_char(null) as evtObject from sys.all_objects where rownum<dateDiff
    union all
    select rownum,asCust.ID,asGroup.NAME,ssEvents.HOST_NAME,ssEvents.evt_timestamp,ssEvents.evt_username,ssEvents.EVT_DISPLAY_NAME,ssEvents.EVT_OBJECT from  solidcor.as_solidifier_groups asGroup inner join solidcor.as_ssgrp_ss_assoc ssGrpAssoc on (asGroup.GROUP_ID= ssGrpAssoc.GROUP_ID) right outer join solidcor.as_solidifiers asSf on (ssGrpAssoc.SS_ID=asSf.SS_ID) right outer join solidcor.as_ss_events ssEvents on (asSf.UUID=ssEvents.HOST_UUID) right outer join solidcor.AS_CUSTOMERS asCust on (ssEvents.CUSTOMER_ID=asCust.ID) where ssEvents.EVT_NAME in ('FILE_ATTR_SET_UPDATE', 'FILE_ATTR_CLEAR_UPDATE', 'ACL_MODIFIED', 'ACL_MODIFIED_UPDATE', 'FILE_CREATED', 'FILE_DELETED', 'FILE_MODIFIED', 'FILE_ATTR_MODIFIED', 'FILE_RENAMED', 'FILE_CREATED_UPDATE', 'FILE_DELETED_UPDATE', 'FILE_MODIFIED_UPDATE', 'FILE_ATTR_MODIFIED_UPDATE', 'FILE_RENAMED_UPDATE', 'FILE_SOLIDIFIED', 'FILE_RESOLIDIFIED', 'FILE_UNSOLIDIFIED', 'FILE_ATTR_CLEAR', 'FILE_ATTR_SET');
    end;
    Regards,
    Amrita

  • Value "null" is displayed when retrieving null values from database

    Hi,
    I'm retrieving a record from Oracle database using a ResultSet rs and displaying the values on screen. Some of the columns do not have any data.
    The statements are:
    ResultSet rs
    st=con.createStatement();
    rs=st.executeQuery(............)
    out.println("<input name='punch_line' type='text' value='"+rs.getString(7)+"'>");
    The problem is that there is no value in the database column rs.getString(7). Ideally when the value is null, the field should not display anything. But in my case it is displaying the text "null".
    Can anyone let me know how can I display a blank value instead of displaying the text "null"?
    Thanks,
    Sridhar

    api >
    String getString(int columnIndex)
    Gets the value of the designated column in
    column in the current row of this ResultSet object as
    a String in the Java programming language.
    so null is returned as string object..NO.
    http://java.sun.com/j2se/1.5.0/docs/api/java/sql/ResultSet.html
    Returns:
    the column value; if the value is SQL NULL, the value returned is null
    The Java literal null is returned, not the String "null". The JDBC API provides a method wasNull() to detect if the previous accessed column returned a SQL NULL.

  • Send Email and automatically save new value into database

    Hi,
    I think this is a very unique problem, hope that anyone could help me. I tried to send email notification using pl/sql block (check_delay) as below. Please focus to this section first, from the pl/sql:
    Problem 1
    --> if emp_rec.OVERDUE_AMOUNT_PAID is not null then
    dbms_output.put_line('emp_rec.payment_progress_id ' || emp_rec.payment_progress_id || crlf);
    select c.PAYMENT_PROGRESS into payment_progress from credit_sales c where c.PAYMENT_PROGRESS_ID = emp_rec.payment_progress_id;
    payment_ratio := (payment_progress/emp_rec.invoice_amount);
    dbms_output.put_line('count ratio progress payment to invoice amount ' || payment_ratio || crlf);
    dbms_output.put_line('payment progress ' || payment_progress || crlf);
    Here, sql checks whether overdue amount is being paid in progress from payment_overdue table..then creates variables for ratio(payment_ratio) and progress payment amount(payment_progress). After that if payment_ratio < 0.1 it must sends email notification to customer_id and customer_representative_id. However, it does NOT send notification to
    customer_id! How do I amend the code so that customer_id will get the notification too?
    Problem 2
    In problem 2, please focus to :
    -->if emp_rec.OVERDUE_AMOUNT_PAID is null then
    If customer does not pay any amount, sql will first checks whether delay between scheduled payment date and current system is more than 3 days..
    dbms_output.put_line('count days delay ' || round(sysdate - to_date(emp_rec.scheduled_payment_date)) || crlf || crlf);
    if round(sysdate - to_date(emp_rec.scheduled_payment_date)) >3 then
    After that, sql will counts how many times customer delays. If first time, the notification will count notification as number 1..and update remark column with the message and count value as below..
    select count(a.payment_overdue_id) as count into count from payment_overdue a where a.customer_id = emp_rec.CUSTOMER_ID and a.invoice_no = emp_rec.invoice_no;
         dbms_output.put_line('update remark : '||emp_rec.remark);
    update PAYMENT_OVERDUE set remark='Reminder notice no '||count where payment_overdue_id=emp_rec.payment_overdue_id;
    Finally, notification to be sent to customer with the message format as below..
    email_to:=emp_rec.customer_id||default_email;
    select b.INVOICE_NO into invoice_no from INVOICE b where b.INVOICE_ID = emp_rec.INVOICE_ID;
    subj:='Reminder to make payment for Invoice No '||invoice_no;
    mesg:='Kindly make payment for your amount outstanding as per Invoice No '||invoice_no||'. Reminder notice no '||count;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    Unfortunately, no email notification being sent to customer with this message format.. Please help me to make customer to receive the notification with this format.
    Kindly, thank you so much for you guys to help me solve these two problems, Problem 1 and Problem 2....
    Thank you.
    CREATE OR REPLACE PROCEDURE TEST.check_delay AS
    NO binary_float;
    CURSOR emp_cur is
    select * from PAYMENT_OVERDUE where FLAG=3 and STATUS='OUTSTANDING';
    emp_rec emp_cur%rowtype;
    email_to varchar2(200);
    default_email varchar2(200);
    mesg varchar2(4000);
    invoice_no varchar2(100);
    subj varchar2(4000);
    payment_progress binary_float;
    payment_ratio binary_float;
    count number;
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    BEGIN
    default_email:='@test.com';
    FOR emp_rec in emp_cur
    LOOP
    if emp_rec.OVERDUE_AMOUNT_PAID is null then
    dbms_output.put_line('count days delay ' || round(sysdate - to_date(emp_rec.scheduled_payment_date)) || crlf || crlf);
    if round(sysdate - to_date(emp_rec.scheduled_payment_date)) >3 then
         select count(a.payment_overdue_id) as count into count from payment_overdue a where a.customer_id = emp_rec.CUSTOMER_ID and a.invoice_no = emp_rec.invoice_no;
         dbms_output.put_line('update remark : '||emp_rec.remark);
    update PAYMENT_OVERDUE set remark='Reminder notice no '||count where payment_overdue_id=emp_rec.payment_overdue_id;
         email_to:=emp_rec.customer_id||default_email;
    select b.INVOICE_NO into invoice_no from INVOICE b where b.INVOICE_ID = emp_rec.INVOICE_ID;
    subj:='Reminder to make payment for Invoice No '||invoice_no;
    mesg:='Kindly make payment for your amount outstanding as per Invoice No '||invoice_no||'. Reminder notive no '||count;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    end if;
    end if;
    if emp_rec.OVERDUE_AMOUNT_PAID is not null then
    dbms_output.put_line('emp_rec.payment_progress_id ' || emp_rec.payment_progress_id || crlf);
    select c.PAYMENT_PROGRESS into payment_progress from credit_sales c where c.PAYMENT_PROGRESS_ID = emp_rec.payment_progress_id;
    payment_ratio := (payment_progress/emp_rec.invoice_amount);
    dbms_output.put_line('count ratio progress payment to invoice amount ' || payment_ratio || crlf);
    dbms_output.put_line('payment progress ' || payment_progress || crlf);
    if payment_ratio < 0.1 then
    email_to:=emp_rec.customer_id||default_email;
    select b.INVOICE_NO into invoice_no from INVOICE b where b.INVOICE_ID = emp_rec.INVOICE_ID;
    subj:='Reminder to settle outstanding amount for Invoice No '||invoice_no;
    mesg:='Kindly settle your outstanding payment as per Invoice No '||invoice_no;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    email_to:=emp_rec.customer_representative_id||default_email;
    subj:='Reminder to settle outstanding amount for Invoice No '||invoice_no;
    mesg:='Kindly settle your outstanding payment as per Invoice No '||invoice_no;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    end if;
    if (payment_ratio < 0.5 && payment_ratio > 0.1) then
    select b.INVOICE_NO into invoice_no from INVOICE b where b.INVOICE_ID = emp_rec.INVOICE_ID;
         email_to:=emp_rec.customer_id||default_email;
    subj:='Reminder to settle outstanding amount for Invoice No '||invoice_no;
    mesg:='Kindly settle your outstanding payment as per Invoice No '||invoice_no;
    dbms_output.put_line('Sending email to ' || email_to || ' subject: ' || subj);
    e_mail_message(email_to,email_to,subj,mesg);
    end if;
    end if;
    END LOOP;
    END;
    /

    Hi BownieCross;
    If you are using a local database file in your project the following may be the cause.
    From Microsoft Documentation:
    Issue:
    "Every time I test my application and modify data, my changes are gone the next time I run my application."
    Explanation:
    The value of the Copy
    to Output Directory property is Copy
    if newer or Copy
    always. The database in your output folder (the database that’s being modified when you test your application) is overwritten every
    time that you build your project. For more information, see How
    to: Manage Local Data Files in Your Project.
    Fernando (MCSD)
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects
    and unknown namespaces.

  • How to handle Null value in Database Adapter

    I configured the DA Adapter, with operation type as "Perform an Operation on a Table - Select" and added few where clause parameters (StreetNo, StreetName city, country, state, zipcode)too.
    If we won't enter any value for any of the column in the table (S_ADDR_PER) is taking as NULL, so what happening is, if i give "%" or if i leave as "blank" to those columns(input for where clause parameter). The DB adapter not fetching any records. Any help to handle this situation.
    I need query like this...
    select * from S_ADDR_PER where city like '%' AND state is NULL AND addr_line_2 like '%';
    seems.... I can't use the pure SQL option since i don't know which column will be null. Some case the addr_line_2 column will be NULL in table, in some other case the state or city column will be null.

    Hi,
    you can handle null with date like this , If it doesn't wortk for you then please explain your problem.
    select NVL(to_char(sysdate,'DD-MON-YY'),'Not Recorded')
    from dual
    NVL(TO_CHAR(
    08-NOV-05
    select NVL(to_char(NULL,'DD-MON-YY'),'Not Recorded')
    from dual
    SQL> /
    NVL(TO_CHAR(
    Not Recorded
    Regards

  • Batch details window cannot save UDF value

    Hi experts!
      Did anybody else experience that if you want to update a user defined field of a batch in 'Batch details' window, it pretends as everything was saved successfully, but UDF values are not saved in fact. I tried it with 8.81 PL05 (and earlier versions as well)
      I found a note (1431365) of a similar problem but it is about the General update button of "Batch management" window, and this note suggests to use "Batch details" instead. Quite weird that updating (normal update, not global) a UDF value in "Batch management" window seems to work fine for me, the modified value can be seen on "Batch details" window.
    Regards: Gergő

    Well, originally our customer recorded this behavior on 8.8 PL20 (8.80.238)
    I tried it on almost the same database, in our developer environment, that has slightly different patch level: PL21.
    Then i tried with a 8.81 PL05 database too. There are some addon installed, but none of them was running, and i could not find any formatted search on this window.
    But i suppose i figured out what happened.
    For updating UDF i always switch on the user defined fields window (Ctrl-shift-U), and use this window. I did so in this case as well. (and our customer did so)
    But now i realized that in this case UDF-s appears on the native window as well. We have to scroll down to see them, that's why i hadn't realized them before. Those fields work fine. I guess you used those fields too. Can you confirm it?
    Regards, Gergo

  • How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working 10g

    Hi,
    How to Replace Null Value as 0 in an OBIEE11g Pivot Table? it's working in obiee10g version.
    We have tried below methods
    1) criteria tab and edit the ‘column properties’ associated with your fact measure. Choose the ‘Data Format’ tab, tick to override the default format and choose ‘Custom’.
    It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
    E.g. if you want zeros (0) instead of null then enter:
    #,##0;-#,##0;0
    2) in that formula columns we have put it below case condition also ,
    Measure Column: Nom_amt --> edit formulas
    CASE WHEN Nom_amt IS NULL THEN 0 ELSE Nom_amt END
    3) we have uncheked IS NULL check box in the admin tool also
    I tried above formats still it's not working for me..kindly help me on this..
    thanks to do the needfull
    Best Regards,
    R.Devarasu

    Hi,
    Null value in database displaying as 0 in report, I need to keep value as in database, and I have one calculated row which is based on null values should also null in report.
    but it showing 0 for null values also so, my calculated row showing wrong result.
    my report is like
    col1 col2
    ABC 0
    BCD 12
    DEF -12 --this is calculated row.
    I require result like:
    col1 col2
    ABC null
    BCD 12
    DEF null --this is calculated row.
    Please let me know how I can achieve this.
    Thanks,
    Rahul

  • JDBC Receiver Adapter with Null Value

    HI,
    I have configured ID for JDBC Receiver. In my communication channel, I already check Integration of Empty String Values = Null Value. However, when I check the result from audit log, it still shows that SAP XI sends the null value to database. In my understanding, it should not send the field which has null value (It shouldn't be included in sql statement).
    I check this with other scenario. With the same check at Integration of Empty String Values = Null Value, it doesn't send null value to database. It happens only with my first scenario.
    Have anyone ever been through this before? Any suggestion please?
    Thanks,
    Pavin

    Hi,
    1. The occurrence is 0...1
    2. This is the first result with null value (Please see field Error)
    UPDATE EXPCRM_T_CustomerProfile SET RequestID=455, RecordNo=1, SAPCustomerCode=0001000344, Error=NULL, Status=2, UpdateDateTime=12/03/2008 13:45:03 WHERE (RequestID=455 AND RecordNo=1)
    Then, I change the option from Null Value to Empty string. This is the result.
    UPDATE EXPCRM_T_CustomerProfile SET RequestID=455, RecordNo=1, SAPCustomerCode=0001000344, Error=', Status=2, UpdateDateTime=12/03/2008 13:46:12 WHERE (RequestID=455 AND RecordNo=1)
    Field Error Change from NULL to '
    The expected result from me is that field Error should not exist at all. Please help.
    Thanks,
    Pavin

  • SharePoint List Form using InfoPath 2010 "Cannot insert the value NULL into column 'tp_DocId', table 'Content_SP_00003.dbo.AllUserData'; column does not allow nulls"

    I am experiencing issue with my SharePoint site , when I am trying to add new Item in List . Error given below :--> 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 SharePoint Server Logging Correlation Data 9gc5 Verbose Thread change; resetting trace
    level override to 0; resetting correlation to e2e9cddc-cf35-4bf8-b4f3-021dc91642da c66c2c17-faaf-4ff9-a414-303aa4b4726b e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 Document Management Server Document Management 52od
    Medium MetadataNavigationContext Page_InitComplete: No XsltListViewWebPart was found on this page[/sites/00003/Lists/PM%20Project%20Status/NewForm.aspx?RootFolder=&IsDlg=1]. Hiding key filters and downgrading tree functionality to legacy ListViewWebPart(v3)
    level for this list. e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.17 w3wp.exe (0x1B94) 0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Starting correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.17 w3wp.exe (0x1B94)
    0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Ending correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.31 w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High System.Data.SqlClient.SqlException: Cannot insert
    the value NULL into column 'tp_DocId', table 'Content_SP_00003.dbo.AllUserData'; column does not allow nulls. INSERT fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
    stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavi... e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015
    08:23:36.31* w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High ...or runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
    Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,
    RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand
    command, CommandBehavior behavior,

    Are you trying to setup P2P? Could you explain the process you followed completely? By anychance you create the backup and then created the publication?
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • System.ArgumentNullException: Value cannot be null.

    We have an application that utilizes the WCF-OracleDB adapter on a send port connecting to an Oracle database. The application sends insert statements to a stored procedure that inserts the data into one of the tables. The table has a column for City Fee
    Amount that allows NULL values. The schema that we populate the insert statement into contains a corresponding node called "P_CITY_FEE_AMT", that node is also set to allow null values. WE are running into an intermittent issue in which an error message
    is returned to BizTalk stating the value for field P_CITY_FEE_AMT cannot be NULL. We are not seeing any error messages in the Oracle database so it appears the error is being generated by the adapter. Any ideas as to why it would be generating an error like
    this when the schema and the target table both allow NULL values for this field?
    Error Message:
    A message sent to adapter "WCF-OracleDB" on send port "SendSproc" with URI "oracledb://test" is suspended.
    Error details: Microsoft.ServiceModel.Channels.Common.XmlReaderParsingException: The value for field "P_CITY_FEE_AMT" is invalid. ---> System.ArgumentNullException: Value cannot be null.
    Parameter name: numStr
    at Oracle.DataAccess.Types.OracleDecimal..ctor(String numStr, String format)
    at Microsoft.Adapters.OracleCommon.OracleCommonMetadataUtils.CreateParameterValue(OracleDbType oracleType, Object xmlValue, OracleConnection dbConn, Boolean ignoreLOB, String fieldName)
    --- End of inner exception stack trace ---
    Server stack trace:
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
    at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
    at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
    at System.ServiceModel.Channels.ServiceChannel.EndRequest(IAsyncResult result)
    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at System.ServiceModel.Channels.IRequestChannel.EndRequest(IAsyncResult result)
    at Microsoft.BizTalk.Adapter.Wcf.Runtime.WcfClient`2.RequestCallback(IAsyncResult result)
    MessageId: {A4503B09-51A0-48B7-915C-753100D250A7}
    InstanceID: {D8DC8808-41B9-47CC-A790-ACA0963E5BFE
    Insert Message:
    <ns0:TSA103 xmlns:ns0="http://Microsoft.LobServices.OracleDB/2007/03/BIZTALK/Procedure">
    <ns0:P_CITY_FEE_AMT/>
    <ns0:P_NO_LOCATIONS_NBR>1</ns0:P_NO_LOCATIONS_NBR>
    <ns0:P_STATE_FEE_AMT>12.00</ns0:P_STATE_FEE_AMT>
    <ns0:P_DOC_LOC_NBR_REGION>1234567890</ns0:P_DOC_LOC_NBR_REGION>
    <ns0:P_DLN_OCCUR_ID_REGION>0</ns0:P_DLN_OCCUR_ID_REGION>
    <ns0:P_REGION_CD>MAR</ns0:P_REGION_CD>
    <ns0:P_UPDATE_IF_EXISTS_INDC>N</ns0:P_UPDATE_IF_EXISTS_INDC>
    </ns0:TSA103>
    Thanks, Bruce

    Hi Bruce,
    Have you configured SOAP Action Header property at WCF-OracleDB send port.
    Refer the post->
    https://social.msdn.microsoft.com/Forums/en-US/238fdee1-564e-45cc-be96-6215af682b1e/exception-on-outbound-map-with-wcforacledb-adapter-at-send-port-in-biztalk-2010?forum=biztalkr2adapters
    For the alternate solution you can also refer the workaround mentioned here ->
    Error while inserting NULL value to Oracle database table using BizTalk
    Rachit
    Please mark as answer or vote as helpful if my reply does

  • How to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.

    how to transfer database table contain null values, primary key, and foreign key to the another database in same server. using INSERT method.  thanks

    INSERT targetdb.dbo.tbl (col1, col2, col3, ...)
       SELECT col1, col2, col3, ...
       FROM   sourcedb.dbo.tbl
    Or what is your question really about? Since you talke about foreign keys etc, I suspect that you want to transfer the entire table definition, but you cannot do that with an INSERT statement.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Deployement & "Value cannot be null"

    Hello,
    When I try to deploy a stored procedure in .net on oracle, I've got a message, when I click on "Finish", "Value cannot be null"
    This message append while I would like to "copy assembly only" & "copy assembly and compile stored procedures"
    Have you got any idea to enable to deploy?
    tanks

    Can you provide the c# or vb.net code of your .net stored procedure ?
    Have you installed Oracle Database Extensions for .NET on your db server ?

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

Maybe you are looking for

  • Project issues

    I've been running into issues while using Final Cut Pro 7. My specs & details are below. Currently, FCP has been quitting on me while I'm editing. This particular project is being edited off of a 4TB G-RAID, with close to 1TB of free space. The proje

  • ALV Display Variant copying between programs

    There is a report program say PROGRAM1 whose ALV display variants we want to copy to the ALV display variants of another program say PROGRAM2. Both these program share the same ALV output structure design. My questions are 1) Can the display variants

  • Problem with Forte Express, on priorities of the ORDERBYconstraints .

    In my businessModel I've got 2 Tables : Table MACHINE : - MACHINE_ID, MACHINE_NAME, MACHINE_BRAND, MACHINE_MODEL, USERS_ID (which is a foreign key of the table USERS.) Table ACTIVITY : - ACTIVITY_ID, ACTIVITY_NAME. In my applicationModel I've got a b

  • Xsql servlet: creating pdf output

    hello, is it possible to create pdf output with the xsql servlet??? i know that html is possible. i'm a beginner.. thanks cleo

  • Transferring Email from Outlook 2007 to a new iMac running Leopard

    I previously decided to make the jump from Windows Vista Ultimate to a new iMac several months ago and was just waiting for the release of Leopard. It was my understanding that the transfer would be seamless. But I recently read an article by Walt Mo