Inconsistent results from sql DB 11.2.0.2

can anyone see why the statement below would return no data?
SELECT CUSTOMER_NAME,
     CUSTOMER_NUMBER,
     CUSTOMER_ID
FROM APPS.RA_CUSTOMERS
WHERE (UPPER(CUSTOMER_NAME) LIKE 'B%'
AND      (CUSTOMER_NAME LIKE 'b%'
OR          CUSTOMER_NAME LIKE 'B%'))
ORDER BY CUSTOMER_NAME
when this one does
SELECT CUSTOMER_NAME,
     CUSTOMER_NUMBER,
     CUSTOMER_ID
FROM APPS.RA_CUSTOMERS
WHERE (CUSTOMER_NAME LIKE 'b%'
OR          CUSTOMER_NAME LIKE 'B%')
ORDER BY CUSTOMER_NAME
Thanks

Both the queries seem to be the same,
Both of them should return same data. Please double check(any un committed data etc). Post the table data here.
why dont you just use this?
SELECT CUSTOMER_NAME, CUSTOMER_NUMBER, CUSTOMER_ID
  FROM APPS.RA_CUSTOMERS
WHERE UPPER (CUSTOMER_NAME) LIKE 'B%'
ORDER BY CUSTOMER_NAMEG.

Similar Messages

  • Inconsistent results from CallableStatement

    We are getting inconsistent results from a call to an Oracle database. We have a CallableStatement that returns 4 INTEGERs.
    It runs perfectly if I run the Oracle procedure directly from the sql command line and then call it from the java code.
    However if I recompile the Oracle stored procedures and execute the Callable Statement (without first running it from sql) then I am getting incorrect results...1,2,1,1 is being returned instead of 1,2,0,3. Are these results being cached somewhere???
    We are using Oracle 8.1.7, JDK 1.3.1, and Oracle thin driver 8.1.7.
    The code is as follows:
    <pre>
    private CallableStatement autoLBNumbersNeeded;
    private void prepareStatements(){
         autoLBNumbersNeeded=dbConnection.prepareCall("{CALL
         pkg_scheduler.pr_auto_lb_nos(?,?,?,?)}");
         autoLBNumbersNeeded.clearParameters();
         autoLBNumbersNeeded.registerOutParameter(1, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(2, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(3, java.sql.Types.INTEGER);
         autoLBNumbersNeeded.registerOutParameter(4, java.sql.Types.INTEGER);
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    </pre>
    The Oracle procedure is
    <pre>
    PROCEDURE proc1( p_parm_1 OUT NUMBER, p_parm_2 OUT NUMBER, p_parm_3
    OUT NUMBER, p_parm_4 OUT NUMBER)
    AS
    BEGIN
    -- Get Counts
    SELECT COUNT(*)
    INTO p_parm_1
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_2
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_3
    FROM blah ......
    SELECT COUNT(*)
    INTO p_parm_4
    FROM blah ......
    EXCEPTION
    blah .......
    END proc1;
    </pre>
    Can anyone help?
    Many thanks
    Fionnuala

    Hi
    Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
    </pre>

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Inconsistent Results from dbms_output.get_lines

    Hi,
    I am getting inconsistent results from using dbms_output.get_lines.
    I'm using get_lines in a procedure A that executes a function B to test if the function returns 0 or > 0 to indicate validity of my data. In that function, I use dbms_output.put_lines to communicate data points that I want to use. My procedure A does a get_lines after executing function B then either logs the lines into a table or sends an email.
    Right now, get_lines is behaving sporadically for me. Sometimes I the chararr returns some lines while other times it doesn't. The strange thing is numlines does return a value, and it's the value that I expected.
    Can someone please help?
    Thanks.

    Use parameters or even global package variables to transport data from one procedure to the other. dbms_output is not meant for this, it will not work.

  • Odd results from SQL statement in JSP

    Hi.
    Getting very strange results from my SQL statement housed in my JSP.
    the last part of it is like so:
    "SELECT DISTINCT AID, ACTIVE, REQUESTOR_NAME, ..." +
    "REQUESTOR_EMAIL" +
    " FROM CHANGE_CONTROL_ADMIN a INNER JOIN CHANGE_CONTROL_USER b " +
    "ON a.CHANGE_CTRL_ID = b.CHANGE_CTRL_ID " +
      " WHERE UPPER(REQUESTOR_NAME) LIKE ? ";   I've set the following variables and statements:
    String reqName = request.getParameter("requestor_name");
    PreparedStatement prepstmt = connection.prepareStatement(preparedQuery);
    prepstmt.setString(1, "%" + reqName.trim().toUpperCase() + "%");
    ResultSet rslts = prepstmt.executeQuery();
    rslts.next();
    int aidn = rslts.getInt(1);          
    int actbox = rslts.getInt(2);     String reqname = rslts.getString(3).toUpperCase();
    String reqemails = rslts.getString(4);
    String bizct = rslts.getString(5);
    String dept = rslts.getString(6);
    String loc = rslts.getString(7);
    Date datereq = rslts.getDate(8);
    String busvp = rslts.getString(9);
    AND SO ONSo then I loop it, or try to with the following:
    <%
      try {
      while ((rslts).next()) { %>
      <tr class="style17">
        <td><%=reqname%></td><td><%=reqemails %></td><td><%=bizct %></td>td><%=dept %></td>
       <td><%=aidn %></td>
      </tr>
      <%
    rslts.close();
    selstmt.close();
    catch(Exception ex){
         ex.printStackTrace();
         log("Exception", ex);
    %>AND so on, setting 13 getXXX methods of the 16 cols in the SQL statement.
    Trouble is I'm getting wildly inconsistent results.
    For example, typing 'H' (w/o quotes) will spit out 20 duplicate records of a guy named Herman, with the rest of his corresponding info correct, just repeated for some reason.
    Typing in 'He' will bring back the record twice (2 rows of the complete result set being queried).
    However, typing in 'Her' returns nothing. I could type in 'ell' (last 3 letters of his name, Winchell) and it will again return two duplicate records, but typing in 'hell' would return nothing.
    Am I omitting something crucial from the while statement that's needed to accurately print out the results set without duplicating it and that will ensure returning it?
    There's also records in the DB that I know are there but aren't being returned. Different names (i.e. Jennifer, Jesse, Jeremy) won't be returned by typing in partial name strings like Je.
    Any insight would be largely appreciated.
    One sidenote: I can go to SQL Plus and accurately return a results set through the above query. Having said that, is it possible the JDBC driver has some kind of issue?
    Message was edited by:
    bpropes20
    Message was edited by:
    bpropes20

    Am I omitting something crucial from the while
    statement that's needed to accurately print out the
    results set without duplicating it and that will
    ensure returning it?Yes.
    In this code, nothing ever changes the value of reqname or any of the other variables.
      while ((rslts).next()) { %>
      <tr class="style17">
        <td><%=reqname%></td><td><%=reqemails %></td><td><%=bizct %></td>td><%=dept %></td>
       <td><%=aidn %></td>
      </tr>
      <%
    } You code needs to be like this:while (rslts.next()) {
      reqname = rslts.getString(3).toUpperCase();
      reqemails = rslts.getString(4);
      bizct = rslts.getString(5);
      dept = rslts.getString(6);
      loc = rslts.getString(7);
      datereq = rslts.getDate(8);
      busvp = rslts.getString(9);
    %>
      <tr class="style17">
        <td><%=reqname%></td><td><%=reqemails %></td><td><%=bizct %></td>td><%=dept %></td>
       <td><%=aidn %></td>
      </tr>
      <%
    There's also records in the DB that I know are there
    but aren't being returned. Different names (i.e.
    Jennifer, Jesse, Jeremy) won't be returned by typing
    in partial name strings like Je.Well, you're half-right, your loop won't display all the rows in the result set, because you call rslts.next(); once immediately after executing the query. That advance the result set to the first row; when the loop is entered, it starts displaying at the 2nd row (or later if there are more next() calls in the code you omitted).

  • Whitespace in xml result from SQL Utility

    We're currently using the XML SQL Utility (ver XSU12, 8.1.7 database) with PL/SQL. We're able to successfully retrieve XML based result from the database.
    However, almost a fourth of the document that's returned from the utility in CLOB is whitespace, which is not necessary in our application. Is there any way we can suppress this whitespace, so that the resulting document trasferred over the network is kept the smallest possible.
    Thanks in advance
    Murthy Jarugumilli

    Use one of the XPath string functions. I don't have my reference book here but the one you want is called something like normalize-text, so look it up in your reference. Your element would then look something like this:
    <xsl:value-of select="/results/record[normalize-text(id)=12]"/>

  • Inconsistent results from rpm

    Hi Oracle Forums,
         I am installing packages required for Oracle Database 11gR2, and am having problems with rpm responses.
         When I query rpm about a package, it tells me that the package is not installed. When I go to install the package, rpm informs me that the package is already installed. An example is shown below:
    [root@OELVM02 Server]# uname -a
    Linux OELVM02.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:37:40 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# pwd
    /media/OL5.8 x86_64 dvd 20120229/Server
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# ls -alrt binutils-2.17.50.0.6-20.el5.x86_64.rpm
    -rw-r--r-- 1 root root 3069914 Dec 28  2011 binutils-2.17.50.0.6-20.el5.x86_64.rpm
    [root@OELVM02 Server]#
    [root@OELVM02 Server]#  rpm -q ./binutils-2.17.50.0.6-20.el5.x86_64.rpm
    package ./binutils-2.17.50.0.6-20.el5.x86_64.rpm is not installed
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# rpm -ivh ./binutils-2.17.50.0.6-20.el5.x86_64.rpm
    warning: ./binutils-2.17.50.0.6-20.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
    Preparing...                ########################################### [100%]
            package binutils-2.17.50.0.6-20.el5.x86_64 is already installed
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# rpm -q ./binutils-2.17.50.0.6-20.el5.x86_64.rpm
    package ./binutils-2.17.50.0.6-20.el5.x86_64.rpm is not installed
    [root@OELVM02 Server]#     I do not understand the inconsistent results that rpm is giving me.
         Any help would be greatly appreciated
         Thanks
         Gavin

    Hi Avi,
         Thanks for your quick response!!
         The Oracle documentation requires that both the 32 and 64 bit rpm's be installed for some packages. In the below scenario, is rpm telling me that both 32 and 64 bit packages are installed?
    [root@OELVM02 Server]# uname -a
    Linux OELVM02.localdomain 2.6.32-300.10.1.el5uek #1 SMP Wed Feb 22 17:37:40 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# pwd
    /media/OL5.8 x86_64 dvd 20120229/Server
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# ls -alrt *glibc-2*
    -rw-r--r-- 1 root root 1544040 Nov 18  2010 compat-glibc-2.3.4-2.26.x86_64.rpm
    -rw-r--r-- 1 root root 1069214 Nov 18  2010 compat-glibc-2.3.4-2.26.i386.rpm
    -rw-r--r-- 1 root root 5607577 Feb 26  2012 glibc-2.5-81.i686.rpm
    -rw-r--r-- 1 root root 4997627 Feb 26  2012 glibc-2.5-81.x86_64.rpm
    [root@OELVM02 Server]#
    [root@OELVM02 Server]# rpm -q glibc-2.5-81.i686
    glibc-2.5-81
    [root@OELVM02 Server]#
    [root@OELVM02 Server]#  rpm -q glibc-2.5-81.x86_64
    glibc-2.5-81
    [root@OELVM02 Server]#
    [root@OELVM02 Server]#     Thanks heaps
         Gavin

  • Different Results from SQL-Query in Oracle 10.2 and  Oracle 11.2

    Look at the following example:
    CREATE TABLE GZP_PLAN (GZP_ID
    NUMBER(9) NOT NULL, PARENT_GZP_ID NUMBER(9),
    CONSTRAINT GZP_PLAN_PK1 PRIMARY KEY(GZP_ID)
    USING INDEX
    TABLESPACE USERS
    TABLESPACE USERS;
    insert into GZP_PLAN values(1,NULL);
    CREATE TABLE GZP_WB (OBJECTID NUMBER
    NOT NULL, GZP_ID NUMBER(10),
    CONSTRAINT GZP_WB_PK1_1 PRIMARY KEY(OBJECTID)
    USING INDEX
    TABLESPACE USERS
    TABLESPACE USERS;
    insert into GZP_WB values(1,1);
    CREATE OR REPLACE VIEW VW_GZP (GZP_ID1) AS
    SELECT xxx.gzp_id
    FROM gzp_plan xxx
    WHERE gzp_id IN (
    SELECT MAX (z.gzp_id) zzz
    FROM gzp_plan z
    START WITH z.gzp_id = xxx.gzp_id
    CONNECT BY PRIOR gzp_id = parent_gzp_id);
    -- query
    select a.* from GZP_WB a where gzp_id in (select gzp_id1 from vw_gzp);
    Result in Oracle 10.2. (Windows Server 2003 32-bit, Oracle 10.2.0.2 or Oracle 10.2.0.5, Enterprise Edition)
    OBJECTID     GZP_ID
    *1 1*
    Result in Oracle 11.2 (Windows Server 2008 64-bit, Oralcle 11.2.0.2, Enterprise Edition or Standard Edition One)
    no rows selected
    The result of the following queries are identical in Oracle 10.2 and 11.2
    SQL> select * from GZP_WB where to_char(gzp_id) in
    2 (select to_char(gzp_id1) from vw_gzp);
    OBJECTID GZP_ID
    1 1
    SQL>
    SQL> select a.* from GZP_WB a, vw_gzp b where a.gzp_id=b.gzp_id1;
    OBJECTID GZP_ID
    1 1

    The solution is Oracle 11.2.0.3 - patchset released 11th November.

  • Inconsistent results from AlphaComposite and AffineTransform

    I'm developing a game using Java, and I've run into a fairly major issue. On my primary development machine, I can use combinations of AlphaComposite.SRC_IN and AffineTransforms with rotation just fine (I'm using the composite to create a lighting overlay for the game by drawing light beams onto the alpha channel of an all-black image buffer). On my other computer, while the image itself rotates and draws on the alpha channel fine, the computer also completely clears a bounding rectangle around the rotated image.
    The first computer (the one for which this works) has a GeForce 8800GTS video card, while the second has an older Radeon 9700. The first computer also has the most recent version of the JDK (6). Could either of these factors make the difference?
    edit: Upgrading to JDK 6 fixed it. Will need to include a notice about upgrading to JDK 6 with the game, probably.
    Message was edited by:
    Hyouko

    Hi
    Yes I have a debug line that prints them out in the doAutoLoadBalancing method - this is the point where I am diagnosing the problem. It only prints the correct results after I have already run the procedure from the SQL command line.
    public UserNumber[] doAutoLoadBalancing () throws SQLException {
    autoLBNumbersNeeded.clearParameters();
    autoLBNumbersNeeded.execute();
    mwFF = autoLBNumbersNeeded.getLong(1);
    mwHF = autoLBNumbersNeeded.getLong(2);
    wmFF = autoLBNumbersNeeded.getLong(3);
    wmHF = autoLBNumbersNeeded.getLong(4);
    autoLBNumbersNeeded.clearParameters();
    if (m_cat.isDebugEnabled()) {m_cat.debug("mwFF: "+mwFF+"; mwHF: " +mwHF+"; wmFF: "+wmFF+"; wmHF: "+wmHF);}
    </pre>

  • Creating JTree with results from SQL Query

    I have the following source in SQLJ:
    String temp=null;
    iter1 it1;
    iter2 it2;
    #sql it1={select id,fdn,level from groups connect by prior fdn=parent_fdn start with fdn='/' };
    while(it1.next())
    System.out.println(it1.id()); // Display Parent
    temp=it1.fdn();
    #sql it2= {select clli from nes where parent_fdn=:temp order by clli };
    while(it2.next())
    System.out.println(it2.clli());//Display Child of above Parent if any
    My problem is to construct a Tree GUI using JTree from the above
    code with the same hierarchy of parent-child relationship.
    I have tried every possible solution using Vectors,Hashtables,String Arrays etc but have not come up with a successful solution so far
    IF ANYONE HAS A SOLUTION PLEASE HELP ME WITH AN EXAMPLE.
    Thank You
    Sharath

    sharathkv,
    Your issue seems to be in figuring out an algorithm to convert row-based SQL resultsets to a hierarchical data structure suitable for display in a tree.
    Run the jython (www.jython.org) app below: it simulates doing just that. jython is indentation-sensitive, so you'll need to exercise care when copying. If copy-paste to a text editor doesn't work, copy-paste to a HTML-aware editor (even Outlook Express, if on Windows), then copy from there and paste in a text editor.
    --A
    This is a jython (www.jython.org) app that illustrates
    converting row-based data (eg. a SQL resultset) to a custom
    hierarchical data structure, and displaying it in a JTree.
    from javax.swing import *
    from javax.swing.tree import *
    import java
    def getSQLRows():
        Simulates a SQL resultset.
        Columns fdn and parent-fdn indicate parent/child relationships.
        rows = [
            # id, fdn, parent-fdn, level
              [1, '/', None, 1]
            , [2, '/fruits', '/', 2]
            , [3, '/colors', '/', 2]
            , [4, '/sports', '/', 2]
            , [5, '/fruits/apples', '/fruits', 3]
            , [6, '/fruits/oranges', '/fruits', 3]
            , [7, '/colors/red', '/colors', 3]
            , [8, '/colors/blue', '/colors', 3]
            , [9, '/sports/petanc', '/sports', 3]
            , [10, '/sports/rugby', '/sports', 3]
        return rows
    def convertRowsToHierarchy(rows):
        Converts row-based results to hierarchical structure.
        Uses known parent/child relations present in rows.
        root = None
        for row in rows:
            fdn, parentfdn = row[1], row[2]
            node = SQLTreeNode(fdn, parentfdn)
            if root:
                root.addEx(node)
            else:
                root = node
        return root
    class SQLTreeNode(java.lang.Object):
        '''Custom tree node; displayed in JTree'''
        def __init__(self, fdn, parentfdn):
            self.fdn = fdn
            self.parentfdn = parentfdn
            self.nodes = []
        def add(self, node):
            '''Adds node as immediate child'''
            self.nodes.append(node)
        def addEx(self, node):
            '''Adds-with-search.  NOTE: naive implementation'''
            if self.fdn == node.parentfdn:
                self.add(node)
            else:
                for child in self.nodes:
                    child.addEx(node)
        def toString(self):
            return self.fdn
        def dump(self):
            '''Debug routine to dump hierarchy'''
            print 'fdn=%s, parentfdn=%s' % (self.fdn, self.parentfdn)
            for node in self.nodes:
                node.dump()
    class SQLTreeModelAdapter(TreeModel):
        '''Tree model adapter: adapts custom data structure to TreeModel'''
        def __init__(self, root):
            self.__root = root
        def getChild(self, parent, index):
            return parent.nodes[index]
        def getChildCount(self, parent) :
            return len(parent.nodes)
        def getIndexOfChild(self, parent, child):
            return parent.nodes.index(child)
        def getRoot(self) :
            return self.__root
        def isLeaf(self, node):
            return len(node.nodes) == 0
        def addTreeModelListener(self, l):
            pass
        def removeTreeModelListener(self, l):
            pass
        def valueForPathChanged(self, path, newValue):
            pass
    class SQLTreeDemo(JFrame):
        Tree demo UI
        Displays a tree displaying [hierarchical] results
        of a BOM-type SQL query
        def __init__(self):
            # Get matrix simulating SQL resultset
            rows = getSQLRows()
            # Convert to custom hierarchical data structure
            root = convertRowsToHierarchy(rows)
            model = SQLTreeModelAdapter(root)
            tree = JTree(model)
            sp = JScrollPane(tree)
            self.contentPane.add(sp)
            self.size = 200, 300
    if __name__ == '__main__':
        s = SQLTreeDemo()
        s.visible = 1

  • Get Comma separated result from SQL Query

    Hey Everyone
    I have a requirement where i need to get comma separated result of names because there is one to many relationship i.e for every protocol there are mutiple people associated to it , and i created PL/SQL function for that and everything was fine and when it is in production multiple number of cursors were opened because of the logic and leading to RAC fail over and for that we were manually clearing the cursors every weekend and i am looking to create a Materialized view for this logic but i was unable to code the logic using Connect by clause
    Result is like and i want comma separated names for every protocol
    P06065     TESTER13 TESTER13
    P02095     PATRICIA CARMELITANO
    P02095     ANNE MUIR
    P02095     ROBERT HARLOW
    P02095     JANICE ALBERT
    P02095     Jacqueline van Dalen
    P02095     GUENTER HENNIG DR.
    P05209     Olga Xenaki
    P05553     Birgit Limbach-Angele
    P05553     Anja Schulz Dr.
    P05553     CHRISTA HAGENBUCHER
    here is the function which i wrote, i need to get the same logic through SQL Statement .. thanks for your help
    cursor c_GSCR is
    select T565804.FST_NAME||' '||T565804.LAST_NAME
    from
    S_PT_POS_HST_LS T544105 /* S_PT_POS_HST_LS_Protocol_Team */ ,
    S_CONTACT T565804 /* S_CONTACT_Protocol_Team */,
    S_CL_PTCL_LS T541903 /* S_CL_PTCL_LS_Protocol */
    where ( T541903.ROW_ID = T544105.CL_PTCL_ID and
    T544105.POSTN_ID = T565804.PR_HELD_POSTN_ID and
    T544105.ROLE_CD = 'Lead Project Manager' AND
    T541903.ROW_ID = v_PTCL_ID and
    T541903.PAR_PTCL_ID is null and T544105.END_DT is null );
    BEGIN
    l_row_num := 0;
    l_role := '';
    l_role_list := '';
    v_PTCL_ID := PTCL_ID;
    OPEN C_GSCR;
    if C_GSCR%isopen THEN
    LOOP
    FETCH C_GSCR INTO l_role;
    exit when C_GSCR%notfound;
    IF l_role_list IS NULL THEN
    l_role_list:=l_role;
    ELSE
    l_role_list:=l_role_list||', '||l_role;
    END IF;
    END LOOP;
    CLOSE C_GSCR;
    end if;
    ~Srix

    Hi,
    Srix wrote:
    Thanks for the Info .. My database in 10g R 2 i started using COLLECT Function
    select T541903.PTCL_NUM ,
    CAST(COLLECT(T565804.FST_NAME||' '||T565804.LAST_NAME) AS varchar2_ntt) , 7) AS LPM_NAME
    from
    S_PT_POS_HST_LS T544105 /* S_PT_POS_HST_LS_Protocol_Team */ ,
    S_CONTACT T565804 /* S_CONTACT_Protocol_Team */,
    S_CL_PTCL_LS T541903 /* S_CL_PTCL_LS_Protocol */
    where T541903.ROW_ID = T544105.CL_PTCL_ID and
    T544105.POSTN_ID = T565804.PR_HELD_POSTN_ID and
    T544105.ROLE_CD = 'Lead Project Manager' AND
    T541903.PAR_PTCL_ID is null and T544105.END_DT is null
    GROUP BY T541903.PTCL_NUM
    The result i like ...Do you mean "The result *is* like ..."?
    Or do you mean "The result I [would] like [is] ..."?
    The code above has unblanaced parentheses. If you are getting anything other than an error message, then I don't believe you are really running what you posted.
    Whenever you have a problem, post a complete test script that people can use to recreate the problem and test their ideas.
    Please do that. Post CREATE TABLE and INSERT statements to crate the sample data, the code you used to create the carachr2_ntt type and the function, and your best attempt at a query (formatted). Simplify as much as possible. For example, do you really need 3 tables to illustrate the problem? For purposes of asking a question on this forum, can't you pretend you have just one table, with 2 columns?
    I suspect the problem has to do with the user-defined type and function, which you didn't post. I can't even see how you called the function in your query. Without the information I mentioned above, there's not much I can do to help you.

  • How to get accurate results from sql code ?

    Hello everybody,
    I have a problem with some portion of my code.
    I get more results than I specify in the where clause.
    Here is the sample code:
    c.gl_acct_id between '110'||'-'||'6890'||'-'||'69000'||'-'||'%'
    and '110'||'-'||'7000'||'-'||'67999'||'-'||'%'
    For some reason I also get the following results back:
    110-6910-51001-001, and 110-6910-51003-001 But I don't need the 51001 and 51003. How do I specify in sql what range I really want. I was sure that the code above is correct. I guess not.
    I would appreciate any help,
    Thanks,
    Sonya

    Have you tried using the query either of the following...
    1) c.gl_acct_id between '110-6890-69000-000'
    and '110-7000-67999-999'
    and c.gl_acct_id not like '110-6910-51001-%'
    and c.gl_acct_id not like '110-6910-51003-%'
    assuming you have only 3 digits at the end of gl_acct.
    2)If you know that your acct_id belongs to only 69000 or 67999
    then
    (c.gl_acct_id LIKE '110-6890-69000-%' OR
    c.gl_acct_id LIKE '110-7000-67999-%' )
    Plz. let me know if this not what you are looking for.
    thanx
    rajkiran
    Here is the whole script:
    select distinct c.gl_acct_id acct_no,
    c.gl_acct_desc,
    min(a.local_act_beg_bal) local_act_beg_bal,
    sum(b.local_act_mtd_dr_amt) debits,
    sum(b.local_act_mtd_cr_amt) credits,
    nvl(min(a.local_act_beg_bal),0)+sum(nvl(b.local_act_mtd_dr_amt,0))-
    sum(nvl(b.local_act_mtd_cr_amt,0)) end_bal
    from gl_acct c, gl_acct_bal a, gl_acct_bal b
    where c.org_unit_id = '110'
    and b.gl_acct_id = c.gl_acct_id
    and a.gl_acct_id = c.gl_acct_id
    and c.sum_det_ind = 'D'
    and c.gl_acct_class_ind in ( 'A' , 'L' , 'Q' , 'I' , 'E' )
    and a.year_no = '2001'--:loyear
    and a.period_no = '1'--:loperiod
    and ( ( b.year_no = '2001'--:hiyear
    and b.period_no between '1'--:loperiod
    and'13')-- :hiperiod
    and c.gl_acct_id between '110'||'-'||'6890'||'-'||'69000'||'-'||'%'
    and '110'||'-'||'7000'||'-'||'67999'||'-'||'%'
    group by c.gl_acct_id, c.gl_acct_desc
    I want to have ability to specify ranges for gl_accoount.
    Thanks,
    Sonya

  • Inconsistent results from to_char(systimestamp,'D')

    If I run
    select systimestamp ,
    to_char(systimestamp,'DAY') DAY,
    to_char(systimestamp,'D') DAY_OF_WEEK
    from dual
    thru SQL Developer or the SQL Workshop I get
    20/APR/07 03:45:42.261382000 PM +10:00 FRIDAY 5
    If I run the same query from within an APEX application I get
    20/APR/07 03:45:42.261382000 PM +10:00 FRIDAY 6
    In the same three environments I ran
    select value from sys.adam_tmp_view
    where name = 'nls_territory'
    (by creating the view adam_tmp_view as select * from v$parameter and granting select to public)
    and it gave me AMERICA
    Any ideas why this might be happening ...

    I believe there is a setting somewhere where you can specify whether your calender week starts on a Sunday or a Monday.
    Perhaps there is a setting in your application than changes the default calender week start date when you run your app that doesn't apply in SQL dev.

  • Inconsistent results from database calls

    Hi all I was wondering if anyone would be able to come up with some possible ideas as to why my application is inconsistently retrieving data from a database. I have an application that is pulling information from a database. These calls can be made repetitively pulling the same information over and over again. The quandry that I am faced with is why the application would pull the right data most of the time, but occasionally not pull the correct values.
    I have consided the following:
    blocking - all of the calls are read only and scroll insensitive so I doubt this is the case
    Limited number of connections
    Seems like apossibility but then I would expect an error to be thrown.
    Actions happening to fast
    I was thinking perhaps the cycle is completing before everything has had a chance to finish the last set - is that a possibility ?
    I can't post the code, so I am just looking for any general thoughts or ideas on the topic, if nothing thanks anyways.

    Thank you both for your thoughts. The transactions is definately not a possibility (at least as I understand) as this is on read information only, there is no commits nor any updates being completed by this method.
    I will continue to hunt down this little bugger. The biggest issue is that it is one behemoth of a method that should not exist, but unfortunately does.

  • Getting Inconsistent Results from Web Service

    We have a web service that provides Qty Available for several item numbers (current 252 item numbers). It takes in an array of item numbers to be checked. It returns an xml file with those item numbers and the qty available, which is drawn directly from a single table that is repopulated every fifteen minutes. Our customer said that his system shows a different number of records returned each time with consecutive polls.
    I tested the service using the endpoint testing web page. (I hope that's the correct term - I am fairly new to this.) I manually entered 175 item numbers.
    The first result set had a block of 74 item numbers missing from the middle. The second result set returned everything.
    Sample data excerpt:
       <ns0:result>
        <ROWSET>
         <ROW
           num="1">
          <ITEM_NBR>K5-8PE-RD</ITEM_NBR>
          <QTY_AVAILABLE>442</QTY_AVAILABLE>
         </ROW>
        </ROWSET>
       </ns0:result>
       <ns0:result>
        <ROWSET>
         <ROW
           num="1">
          <ITEM_NBR>K5-8PE-WH</ITEM_NBR>
          <QTY_AVAILABLE>5650</QTY_AVAILABLE>
         </ROW>
        </ROWSET>
       </ns0:result>
       <ns0:result
         xsi:nil="1"/>
       <ns0:result
         xsi:nil="1"/>
       <ns0:result
         xsi:nil="1"/>Does this make sense?
    Thanks,
    Gregory

    Turns out the problem was in the Java method. It seems it was opening a new connection for each item number and not closing them.
    Changed code to open the connection once, run through the item list, then close the connection.

Maybe you are looking for

  • Network Media Player (Noontec V9-T) unable to access network shares on WIN8 Pro

    I have just upgraded from Windows 7 home premium 64 bit to Windows 8 Pro 64 bit. After the upgrade, I made sure my video library was shared (both with the homegroup and my username) and that network discovery was enabled file sharing enabled etc etc.

  • CCMS monitoring data collection

    Hi, I have set up CCMS to show alerts for inbound IDOC errors. This seems to be working correctly, but the status is not being updated when the data collection method is being run. The data collection is set to run once per hour. best regards, Jason.

  • Xp_cmdshell error

    Hi, I have an old SQL 2000 server that uses xp_cmdshell. Been working fine for years. Now it comes up with an error when I run this: exec master.dbo.xp_cmdshell 'dtsrun -E -Swsisql3 -NImport_APDIST' I get this error: Cannot load the DLL ppspps, or on

  • Create Bootable Copy of OS 10.6 Install Disk

    I purchased the family pack of Snow Leopard 10.6. I tried to make a backup copy of the disk in case anything ever happened to it. I used disk utility to create a disk image and then burnt it to a DVD. When I tried to use the backup disk to install OS

  • IWORKS License query

    Hi I have just upgraded to Leopard and want to buy / install IWorks. I have only the one Mac but 3 user accounts on that mac. I want to understand if I buy a SINGLE license can I install on my MAC and ALL users can use the applications or do I ahve t