Help: cant get values from a resultset

i have a class that contains all my MySQL statement and i am trying to use the results found from one of my select statements to pass on into another class which displays the results in a gui form. Here is my query:
public void profile(String user)
        try
             Class.forName(driver);
             Connection con = DriverManager.getConnection( url,db_user, db_pass);
             String username, name, email, dob, bio, gender, homepage, number;
             //find username and select all details
             String find = "SELECT Username, Full_name, Email, dob, Biography, Gender, Homepage, Contact_number FROM users WHERE Username = ? ";
             PreparedStatement ps1 = con.prepareStatement(find);
             ps1.setString(1, user);
            ResultSet rs = ps1.executeQuery();
            while(rs.next())
                //retreive information from the server
                username = rs.getString(1);
                name  = rs.getString(2);
                email  = rs.getString(3);
                dob = rs.getString(4);
                bio = rs.getString(5);
                gender = rs.getString(6);
                homepage = rs.getString(7);
                number = rs.getString(8);
                User_Profile profile = new User_Profile(username, name, email, dob, bio, gender, homepage, number);
                JOptionPane.showMessageDialog(null, username + bio + email, null, JOptionPane.ERROR_MESSAGE);
              con.close();
        catch( Exception e )
                 e.printStackTrace();
                 JOptionPane.showMessageDialog(null, "error," + e.getMessage(), null, JOptionPane.ERROR_MESSAGE);
    }As you can see, i am trying to pass on the variables username, name, etc to a new instance of my user_profile class but it doesnt for some reason. i dont get any comple errors so thats ok. i created messege dialog box from within the while statement above to see if a value is stored, and yes their is a value stored in my variables
below is the user profile class which shows my constructor that suppose to get the values from the query class in this code entered above       User_Profile profile = new User_Profile(username, name, email, dob, bio, gender, homepage, number);
    protected String username;
    protected String FullName;
    protected String Email;
    protected String DOB;
    protected String Biography;
    protected String Gender;
    protected String Homepage;
    protected String Con_Number;
    protected String crnt_user;
public User_Profile(String user, String name, String email, String dob,
                            String bio, String gender, String homepage, String number)
        initComponents();
        addWindowListener( this );
        //get values from sql query and store them here.
        this.username = user;
        this.FullName = name;
        this.Email = email;
        this.DOB = dob;
        this.Biography = bio;
        this.Gender = gender;
        this.Homepage = homepage;
        this.Con_Number = number;
     }the code below is used to display one of the values received from the query class, in this case returns null..
txt_name.setText(username)

Does the user String match the database String
exactly?
Some databases are case sensative.Sorry posted before done.
Also, ensure you do not have trailing spaces in one or both. I remember Oracle had this problem a few years ago using the Type 4 driver but not through ODBC.

Similar Messages

  • Help with getting values from request. Very Strange!!

    Hello,
    My very strange problem is the following.
    I have created three dynamic list boxes. When the user select
    the first list box, the second becomes populated with stuff
    from a database. The third becomes populated when the second
    is selected. Now, I have used hidden values in order for
    me to get the selected value from the first listbox. The
    following code is my first listbox:
    <SELECT NAME="resources" onChange="document.hiddenform.hiddenObject.value = this.option [this.selectedIndex].value; document.hiddenform.submit();">
    <OPTION VALUE =""> Resource</OPTION>
    <OPTION VALUE ="soil"> Soil </OPTION>
    <OPTION VALUE ="water"> Water </OPTION>
    <OPTION VALUE ="air"> Air </OPTION>
    <OPTION VALUE ="plants"> Plants </OPTION>
    <OPTION VALUE ="animals"> Animals </OPTION>
    </SELECT>
    I use the getRequest method to get the value of hiddenObject.
    At this time I am able to get the value of hiddenObject to populate
    the second list box.
    But, when the user selects an item from the second list box
    and the second form is also submitted,
    I lose the value of hiddenObject. Why is this??
    The code to populate my second listbox is the following:
    <SELECT NAME ="res_categories" onChange="document.hiddenform2.hiddenObject2.value = this.options[this.selectedIndex].value; document.hiddenform2.submit(); ">
    <OPTION VALUE ="" SELECTED> Category</OPTION>
    Here I access a result set to populate the list box.
    Please help!!

    Form parameters are request-scoped, hence the request.getParameter("hiddenObject"); call after the submission of the second form returns a null value because the hiddenObject parameter does not exist within the second request.
    A solution would be to add a hiddenObject field to your second form and alter the onChange event for res_categories to read
    document.hiddenform2.hiddenObject.value=document.1stvisibleformname.resources.option[document.1stvisibleformname.resources.selectedIndex].value;
    document.hiddenform2.hiddenObject2.value = this.options[this.selectedIndex].value;
    document.hiddenform2.submit();You will then come across a similar problem with your third drop-down if indeed you need to resubmit the form...
    A far better approach would be to create a session scoped bean, and a servlet to handle these requests. Then when the servlet is called, it would set the value of the bean property, thus making it available for this request, and all subsequent requests within the current session. This approach would eliminate the need for the clunky javascript, making your application far more stable.

  • How do I get values from a resultset using JDOM?

    I am very new to this and I dont have the slightest idea how to retrive values from a result and create a XML tree using JDOM
    Can someone please help me?
    I have the JDOM Parser installed on my machine.
    This is my code so far:
    import org.jdom.input.*;
    import org.jdom.*;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Display extends HttpServlet {
    public void doPost(HttpServletRequest rq, HttpServletResponse rs) throws IOException, ServletException
    rs.setContentType("text/html");
    PrintWriter out = rs.getWriter();
    try {
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         Connection listcars_con = DriverManager.getConnection("jdbc:odbc:Cars");
         Statement listcars_statement = listcars_con.createStatement();
         ResultSet listcars_rs = listcars_statement.executeQuery("Select CarNr FROM cars");
    //Load the appropriate driver, establish a connection and create a statement which is used to execute the query that returns all the
    //columns from the cars table
    Document doc = new Document(new Element("rootElement"));
              listcars_statement.close();
              listcars_con.close();
    //close the connections
    catch (ClassNotFoundException cnfe)
    System.err.println(cnfe);
    } catch (SQLException sqlex) {
    System.err.println(sqlex);
    } catch (Exception er) {
    er.printStackTrace();
    } //closing bracket for doPost method
    } //closing bracket for class definition

    ResultSet object has nothing to do with XML... so the only way to it
    is just read each row/column in your resultset and then create
    XML record based on structure of your resultset - annoying job...
    Also you can try to use tool developed by Oracle which based
    on SQL select statement parses resultset into XML...
    Paul

  • Need Help to get value from MessageChoice and pass it to another MesgChoice

    Hi All,
    How to get a value from a messageChoice1 in CO into a variable. Once the messageChoice1 is selected i need to pass this variable into a VO whereClause and the page get refreshed, so that another messageChoice2 in the same page will have the values based on the messageChoice1 value.
    Kindly give me your suggestions.
    Thanks and Regards,
    Myvizhi

    I think you want to do a nested loop within each Item in the data provider, to pull out each child's (series1, series2, etc). "label" attribute.

  • Help on getting value from string

    Hello can someone please help me with my code?
    I would like to know how to get a value in a string as an integer type
    This is what I have so far
    String x = "12345";
    for(int f=0; f<5; f++){
    int c = stringDigits.charAt(f);     
    sum += c;                
    However the sum does not turn out to be 1+2+3+4+5 = 15 because the value of c will always turn out to be 48 more than it is supposed to be
    for example when f = 1 then c would = 49
    f = 2 then c would = 51
    Thank you very much for your help

    int i = Integer.parseInt(x);
    Will convert the String to an integer.The original poster was looking for a way to convert a single digit in a string to its numeric value, not to convert the whole string to an integer.
    I forgot to mention that this is contained in the
    java.text package, so you will need to
    import java.text.*;Integer is in the java.lang package, so no import is necessary.

  • Need help Take out the null values from the ResultSet and Create a XML file

    hi,
    I wrote something which connects to Database and gets the ResultSet. From that ResultSet I am creating
    a XML file. IN my program these are the main two classes Frame1 and ResultSetToXML. ResultSetToXML which
    takes ResultSet & Boolean value in its constructor. I am passing the ResultSet and Boolean value
    from Frame1 class. I am passing the boolean value to get the null values from the ResultSet and then add those
    null values to XML File. When i run the program it works alright and adds the null and not null values to
    the file. But when i pass the boolean value to take out the null values it would not take it out and adds
    the null and not null values.
    Please look at the code i am posing. I am showing step by step where its not adding the null values.
    Any help is always appreciated.
    Thanks in advance.
    ============================================================================
    Frame1 Class
    ============
    public class Frame1 extends JFrame{
    private JPanel contentPane;
    private XQuery xQuery1 = new XQuery();
    private XYLayout xYLayout1 = new XYLayout();
    public Document doc;
    private JButton jButton2 = new JButton();
    private Connection con;
    private Statement stmt;
    private ResultSetToXML rstx;
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));
    contentPane = (JPanel) this.getContentPane();
    xQuery1.setSql("");
    xQuery1.setUrl("jdbc:odbc:SCANODBC");
    xQuery1.setUserName("SYSDBA");
    xQuery1.setPassword("masterkey");
    xQuery1.setDriver("sun.jdbc.odbc.JdbcOdbcDriver");
    contentPane.setLayout(xYLayout1);
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    xQuery1.setSql("Select * from Pinfo where pid=2 or pid=4");
    jButton2.setText("Get XML from DB");
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(java.lang.ClassNotFoundException ex) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(ex.getMessage());
    try {
    con = DriverManager.getConnection("jdbc:odbc:SCANODBC","SYSDBA", "masterkey");
    stmt = con.createStatement();
    catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton2_actionPerformed(e);
    contentPane.add(jButton2, new XYConstraints(126, 113, -1, -1));
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton2_actionPerformed(ActionEvent e) {
    try{
    OutputStream out;
    XMLOutputter outputter;
    Element root;
    org.jdom.Document doc;
    root = new Element("PINFO");
    String query = "SELECT * FROM PINFO WHERE PID=2 OR PID=4";
    ResultSet rs = stmt.executeQuery(query);
    /*===========This is where i am passing the ResultSet and boolean=======
    ===========value to either add the null or not null values in the file======*/
    rstx = new ResultSetToXML(rs,true);
    } //end of try
    catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    ======================================================================================
    ResultSetToXML class
    ====================
    public class ResultSetToXML {
    private OutputStream out;
    private Element root;
    private XMLOutputter outputter;
    private Document doc;
    // Constructor
    public ResultSetToXML(ResultSet rs, boolean checkifnull){
    try{
    String tagname="";
    String tagvalue="";
    root = new Element("pinfo");
    while (rs.next()){
    Element users = new Element("Record");
    for(int i=1;i<=rs.getMetaData().getColumnCount(); ++i){
    tagname= rs.getMetaData().getColumnName(i);
    tagvalue=rs.getString(i);
    System.out.println(tagname);
    System.out.println(tagvalue);
    /*============if the boolean value is false it adds the null and not
    null value to the file =====================*/
    /*============else it checks if the value is null or the length is
    less than 0 and does the else clause in the if(checkifnull)===*/
    if(checkifnull){ 
    if((tagvalue == null) || tagvalue.length() < 0 ){
    users.addContent((new Element(tagname).setText(tagvalue)));
    else{
    users.addContent((new Element(tagname).setText(tagvalue)));
    else{
    users.addContent((new Element(tagname).setText(tagvalue)));
    root.addContent(users);
    out=new FileOutputStream("c:/XMLFile.xml");
    doc = new Document(root);
    outputter = new XMLOutputter();
    outputter.output(doc,out);
    catch(IOException ioe){
    System.out.println(ioe);
    catch(SQLException sqle){

    Can someone please help me with this problem
    Thanks.

  • How to get the values from the resultset???

    I have a problem with this code given below,
    i am executing an sql query which return a union of values from two tables.
    the problem here is how do i read the values from the resultset.
    here is the code....
    package com.webserver;
    import java.sql.*;
    public class UnionDemo{
    public static void main(String args[]){
    Connection connection =null;
    Statement statement =null;
    ResultSet rs =null;
    try{
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    connection = DriverManager.getConnection("jdbc:oracle:thin:@:1521:ORCL","scott","tiger");
    statement = con.createStatement();
    rs = statement.executeQuery("(select tablename from node where appid=432) union (select tablename from uomnode where appid=432)");
    ResultSetMetaData rsmd = rs.getMetaData();
    int numberOfColumns = rsmd.getColumnCount();
    while (rs.next()){
    System.out.println(rs.getString(1));
    // instead of rs.getString(1) I also used rs.getString("tablename") but of no success....
    }//end of while
    }catch(Exception exp){
    exp.printStackTrace();
    finally{
    try{
    if (rs!=null) rs.close();
    if (statement!=null) statement.close();
    if (con!=null) con.close();
    }catch(Exception exp1){
    exp1.printStackTrace();
    }//end of finally
    }//end of main
    }//end of class
    when i execute this program i get an oracle error ORA-01009
    which says (java.sql.SQLException: ORA-01009: missing mandatory parameter)
    can anyone help to retrieve the values from this resultset...
    thanx

    [cut]
    i am executing an sql query which return a union of
    values from two tables.
    the problem here is how do i read the values from the
    resultset.[cut]
    When the error occours?
    1) Executing query ?
    2) Retrieving the field from the resultSet ?
    3) ecc. ?
    BTW, first of all, try to execute the query removing the parenthesis
    of the two select statement. I know that there are some problem
    with the oracle jdbc driver about them.
    Hope it helps.

  • How to get values from resultset when using subquery???

    Hi ,
    I have a problem in executing sql query from java.
    I am executing an sql query which return a intersection of values from 3 tables.
    Here is the query I am using
    select id from dps_user where id in (select b.id from dps_user b,laserlink c
    where c.userid='univ.'||b.login and c.status in(1,3,8,9,10)
    intersect
    select b.id from dps_user b,laserlink c
    where c.userid=b.login and c.status in(1,3,8,9,10)).
    this query is working fine from sql .
    when I am trying to excute the same query from java nothing is coming into resultset.
    String ISP_AND_EMAIL="select id "+
                             " from dps_user where id in (select b.id from dps_user b,laserlink c "+
                                  "where c.userid='"+"univ.'"+" ||b.login and c.status in(1,3,8,9,10)"+
                                  " intersect "+
                                  " select b.id from dps_user b,laserlink c"+
                                  " where c.userid=b.login and c.status in(1,3,8,9,10))";
              System.out.println(ISP_AND_EMAIL);
              rs=stmt.executeQuery(ISP_AND_EMAIL);
    How to use concatinate string (|| ) in java.
    can anyone help to retrieve the values from this resultset...
    Thanks

    concatnation is done using + in java.
    I am doubtful about the following line where there may be error
    "where c.userid='"+"univ.'"+" ||b.login and c.status in(1,3,8,9,10)"+
    I don't know if the univ. is a string or some variable.I need more clarification on this line,then i may help u.
    thx

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • LoaderInfo get values from EMBED and OBject Tag (not FlashVars)

    hi
    i try get values from object and embed tags like bgColor and
    allowFullScreen
    but i cant find how i can it
    loaderInfo.parameters return only flashVars
    if some body know it please help
    thank you
    Sonettic Cinema
    Project

    <forward name="success" path="/jsp/success.jsp" redirect="true" />
    but when success.jsp page gets called its not displaying the username and usertype values on page.The request has been redirected to success.jsp(*redirect="true"*) and hence the attributes stored in request object will not be available in success.jsp. Use Session to store login user information instead.

  • Need help to set values from web.xml in a jsp class

    Hey :-)
    I`m trying to get value from my web.xml file into a jsp class. The problem is that the value always retur null. My web.xml file is replaced in the WEB-INF directory where should be. Here is my web.xml
    <servlet>
    <servlet-name>Html</servlet-name>
    <servlet-class>Html</servlet-class>
    <init-param>
    <param-name>html_test</param-name>
    <param-value>Value I want have in my jsp class
    </param-value>
    </init-param>
    </servlet>
    And her i my java class who don`t work:
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.ServletConfig;
    public class Html extends BodyTagSupport
    String title="";
    String html_test;
    ServletConfig config;
    public void doInitBody() throws JspException
    html_test = config.getInitParameter("html_test");
    }//End of method doInitBody()
    public int doStartTag() throws JspException
    try
    JspWriter out = pageContext.getOut();
    out.print( "<HTML>\n" );
    out.print( "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" );
    out.print( "<BODY>\n" );
    out.print( "<BR><H1>" + html_test + "</H1>" );
    And here are my html_test variable return null.
    I hope somone can help me, duke dollars will be given away for the solution answer.
    paulsep

    Nothing seems to work, have change the string and rewritten the web.xml file to:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
              <context-param>
                   <param-name>html_test</param-name>
                   <param-value>Value I want have in my jsp class</param-value>
              </context-param>
    </web-app>

  • Getting values from a datagrid to an ArrayCollection

    Hi, I have a drag and dropable datagrid. I fill it with rows of data from another datagrid. Finally, my application demands savings the data from the datagrid into an array collection along with the index of each row. How do i get values from a datagrid into an arrayCollection variable? Please help me..!

    Whatever is dropped into the DataGrid automatically goes into its dataProvider property, typically an ArrayCollection. Just access the data grid's dataProvider property to see the values.

  • Get value from  APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.

    Hello.
    Help. Help. Help.
    I have to get value from APEX_ITEM.SELECT_LIST_FROM_QUERY - column on a report.
    SELECT DISTINCT ROLE AS GET_ROLE,
    JOB AS GET_JOB,
    APEX_ITEM.SELECT_LIST_FROM_QUERY
    ( 1, '%', 'SELECT DISTINCT CODE c,
    MODE m
    FROM T2
    WHERE ROLE = ' || ROLE ) AS GET_CODE
    FROM T1
    WHERE AGE >30 AND
    SEX = 'M' ;
    I was trying to use javascript :
    for (var i = 0; i < selectlist_name.options.length; i++)
    if (selectlist_name.options[ i ].selected)
    result=selectlist_name.options;
    But I don't know is that correct:
    "selectlist_name" - APEX_ITEM.F01
    (of my APEX_ITEM.SELECT_LIST_FROM_QUERY)?

    Just as a note, but you want to make sure your APEX_ITEM call is closed. The code snippet you posted isn't complete.
    APEX_ITEM.SELECT_LIST_FROM_QUERY(6,c020, 'select DISTRIBUTION_NAME, DISTRIBUTION_NAME from DISTRIBUTIONS','style="", SEQ_ID   <-- No closing )In the documentation - http://www.utoug.org/i/doc/api099.htm - (though it isn't necessarily the easiest to read) it gives this explanation of the syntax:
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
    p_idx IN NUMBER,
    p_value IN VARCHAR2 DEFAULT,
    p_query IN VARCHAR2,
    p_attributes IN VARCHAR2 DEFAULT,
    p_show_null IN VARCHAR2 DEFAULT,
    p_null_value IN VARCHAR2 DEFAULT,
    p_null_text IN VARCHAR2 DEFAULT,
    p_item_id IN VARCHAR2 DEFAULT,
    p_item_label IN VARCHAR2 DEFAULT,
    p_show_extra IN VARCHAR2 DEFAULT)
    RETURN VARCHAR2;
    What you want to look at is p_value to set an initial value. It should come from your data, but you could consider doing an NVL or DECODE to substitute your default.
    In this case it would modify your query to be:
    SELECT distinct apex_item.hidden(1, seq_id), c003,c004,c005, c006,
          APEX_ITEM.SELECT_LIST_FROM_QUERY(6,c020, 'select DISTRIBUTION_NAME, DISTRIBUTION_NAME from DISTRIBUTIONS','style=""),
          SEQ_ID
      FROM APEX_collections
    WHERE collection_name = 'ARGYLL_INVOICES'
    order by seq_id If the value is always NULL, you can use the p_show_null, p_null_value, and p_null_text to put in a "default"
    SELECT distinct apex_item.hidden(1, seq_id), c003,c004,c005, c006,
          APEX_ITEM.SELECT_LIST_FROM_QUERY(6,NVL(c020,0), 'select DISTRIBUTION_NAME, DISTRIBUTION_NAME from DISTRIBUTIONS','style="",YES, 100, 'Default'),
          SEQ_ID
      FROM APEX_collections
    WHERE collection_name = 'ARGYLL_INVOICES'
    order by seq_id

  • How to get values from an IFrame...

    Hi everyone. I have come to a complete stop i my project and need to ask the following: How do i get the values from an IFrame.
    Situation: I have a main.jsp page that contains an IFrame(data.jsp). Data.jsp is basically made up of a bunch of checkboxes. The state of these boxes(checked or unchecked) is determined and set by a JAVA program and the results are then stored in a StringBuffer. Contents of Stringbuffer could look something like this: <tr><input type='checkbox' name='box0' CHECKED></tr>.
    The StringBuffer in then presented in the IFrame(data.jsp) like so: <%=res.getInfo()%>
    The user should be able to check or uncheck the boxes from the main.jsp page then when pressing a submit button the changes should be stored in a DBase.
    After the submit button have been pressed i go into my Servlet's doPost() method for some basic processing. This is were the problem starts. I usally use HttpServletRequest.getParameter(String param) to get values from the main.jsp page. But these checkboxes are stored in the IFrame, so how do i go about to retrieve the values from data.jsp from the doPost() method or in some other way maybe. This is quite urgent and i hope that i have explained the scenario in enough detail.
    Any help would be greatlly apritiated.
    Best regards
    Peter

    Hello
    Just try this link
    http://www.faqts.com/knowledge_base/view.phtml/aid/13758/fid/53
    HTH

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

Maybe you are looking for

  • Database connection question...

    i am using Java 1.5.0_06 and to connect to MySQL database i use Connector/J and the following code: try { Class.forName("com.mysql.jdbc.Driver"); } catch(java.lang.ClassNotFoundException e) { System.err.print("Main: ClassNotFoundException: "); System

  • Excise duty manual entry - standard conditions

    Hi All i want enter  excise duty manually for Ex  JEXC- IN Manual Excise(% basis), simillerly i need standard conditions for per qty basis or even fixed value basis becose  i want update registers(if i am taking  credit). if i am not getting any cred

  • Firefox 4 hangs when removing attachments from Outlook Express email

    When I open an email in Outlook Express 6 (Windows XP Pro) and try to drag & drop an attachment to the desktop with Firefox 4 open in the background, my computer hangs. This only happens when FF4 is open - I have no problem removing attachments with

  • IMac 5,1

    I have computer iMac 5,1 But I lost the CD to the support application Can you help me to get other this CD this is information for this iMac :- -      Model Name : iMac -      Model Identifier : iMac 5,1 -      Memory : 2 GB -      Processor Speed :

  • How do I remove the stolen mode on my recovered iPhone 4s?

    I had lost my iPhone 4s hence I reported it stolen/lost (mode) in my iCloud. The phone was rendered useless and was returned to me. How do I turn off the stolen or lost mode so i could efficiently use this phone again? Please urgent help is needed. T