PreparedStatement only returning 256 results

Hi!
I'm working on a project where the user can enter up to 1000 ids to fetch the corresponding objects from our Oracle database, connected using the 11.1.0.7.0 jdbc drivers. However, only 256 rows were available in the result. So I made a simple test, like so:
public static void main(String[] args) throws Exception {         Class.forName("oracle.jdbc.OracleDriver");         Connection connection = DriverManager.getConnection("jdbc:oracle:thin:myuser/mypassword@myurl:1521:mydb");     PreparedStatement select = connection.prepareStatement("SELECT id FROM t01abc_regenh WHERE id in (?, ?,..., ?)"); // 1000 ?s         String[] idArray = new String[] {"010000010", "010000026", ..., "010000981"}; // 1000 ids         for(int i = 0; i<idArray.length; i++) {       select.setString(i+1, idArray);
ResultSet result = select.executeQuery();
boolean hasNext = result.next();
for(int i = 1; hasNext; i++) {
System.out.println(i + " : " + result.getString(1));
hasNext = result.next();
result.close();
select.close();
connection.close();
The database logs show that the query is using the 1000 ids, but only the first 256 results were printed. So I tried again, using a non-prepared statement:
public static void main(String[] args) throws Exception {
Class.forName("oracle.jdbc.OracleDriver");
Connection connection = DriverManager.getConnection("jdbc:oracle:thin:myuser/mypassword@myurl:1521:mydb");
Statement select = connection.createStatement();
String[] idArray = new String[] {"010000010", "010000026", ..., "010000981"}; // 1000 ids
StringBuilder query = new StringBuilder("SELECT id FROM t01abc_regenh WHERE id in (");
for(int i = 0; i<idArray.length; i++) {
query.append('\'').append(idArray[i]).append("', ");
query.delete(query.length() - 2, query.length());
query.append(')');
ResultSet result = select.executeQuery(query.toString());
boolean hasNext = result.next();
for(int i = 1; hasNext; i++) {
System.out.println(i + " : " + result.getString(1));
hasNext = result.next();
result.close();
select.close();
connection.close();
This time the full 1000 results where printed. Is this a general thing with prepared statements or is it an issue with the Oracle database or the jdbc drivers? Is there a way to increase the number of returned results? Please help!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

>
Is this a general thing with prepared statements or is it an issue with the Oracle database or the jdbc drivers?
>
None of the above - it is an issue with your code. You are comparing apples to oranges; an invalid comparison.
The queries are not identical so you should not expect identical results.
You are using this data
    String[] idArray = new String[] {"010000010", "010000026", ..., "010000981"}; // 1000 idsin two different queries.
The first test constructs a query of the form
    "SELECT id FROM t01abc_regenh WHERE id in (010000010, 010000026,..., ?)"); // 1000 ?sAnd the second constructs a query of the form
    "SELECT id FROM t01abc_regenh WHERE id in ('010000010', '010000026',..., ?)"); // 1000 ?sThat is the first query uses numeric values for the IN clause and the second query uses string values.
If the actual data is VARCHAR2 these will not match the same values.
A string value of '010000010' will not match a numeric value of 010000010 because when 010000010 is converted back to a string for the comparison there will be no leading zeroes so the converted value will be '10000010'
So the first query tries to match '010000010' with '10000010' and they do not match.

Similar Messages

  • Data Service - only returning 256 chars on text field

    Using FlashBuilder Data Services - PHP service all working fine.
    Except the service is only returning the first 256 chars of a "text" field of my db table.
    The field has more than 256 chars and is marked up via the RTE component
    <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="14" COLOR="#000000" LETTERSPACING="0" etc...
    The generated code looks like(memberservice.php)
    public function getAllMember_content() {
            $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename" );       
    etc....
    Have tried a few conversions on the sql statement to no avail
    select *, convert(text,data) as data from members
    Any ideas on why this is happening - debugged in charles and its cut off in the response from ZEND/PHP so it in not Flex doing it
    this one is killing me :-)
    rgds
    m

    ok solved - kind of
    phew - it's the generated service code it appears - not sure why it's working for some and not others! head scratching
    this works
    public function getAllItems() {
        $this->connect();
        $sql = "SELECT * FROM member_content";
        $result = mysql_query($sql) or die('Query failed: ' . mysql_error());
        return $result;
    this does not
    public function getAllMember_content() {
            $stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename" );       
            $this->throwExceptionOnError();
            mysqli_stmt_execute($stmt);
            $this->throwExceptionOnError();
            $rows = array();
            mysqli_stmt_bind_result($stmt, $row->id, $row->title, $row->topic, $row->type, $row->data, $row->shortdesc, $row->date_created, $row->date_lastmod, $row->rank, $row->createdby, $row->content_source);
            while (mysqli_stmt_fetch($stmt)) {
              $rows[] = $row;
              $row = new stdClass();
              mysqli_stmt_bind_result($stmt, $row->id, $row->title, $row->topic, $row->type, $row->data, $row->shortdesc, $row->date_created, $row->date_lastmod, $row->rank, $row->createdby, $row->content_source);
            mysqli_stmt_free_result($stmt);
            mysqli_close($this->connection);
            return $rows;
    thanks all for your help
    many thanks
    martin

  • Database is only returns one result

    I'm trying to count the number of calls & low priorty call from my account table in my databate. There is only one call so far in it. Call = 1 but its priorty is Low so Low should also be 1. I have check my sql in the Database and it return 1 result but in my program Low still = 0.
    Connection conn;
    String theNoCallsSQL = "Select call_no From Call ";
    String thePLowSQL = "Select call_no From Call where priorty = 'Low' ";
    int NoCalls = 0;
    int Low = 0;
    ResultSet rsetNoCall;
    ResultSet rsetLow;
    rsetNoCall = stmt.executeQuery(theNoCallsSQL);
    while(rsetNoCall.next() == true)
    NoCalls ++;
    rsetLow = stmt.executeQuery(thePLowSQL);
    while(rsetLow.next() == true)
    Low ++;
    conn.close();
    ArrayList myStatsList = new ArrayList();
    CallsStats myStats = new CallsStats();
    myStats.setNoCall(NoCalls);
    myStats.setNoLow(Low);
    return myStatsList;

    Haven't you heard about debugging? The simplest forum of debugging to answer your question would be to insert a line like this:System.out.println("Low++ executed");immediately before the line that saysLow++;Or you could use System.out to display the value of Low immediately beforemyStats.setNoLow(Low);The possibilities are endless.

  • Tags only return one result

    I have tagged numerous bookmarks, but when I type the tag in the location (Awesome) bar, only one result is returned. I have disabled all themes and tried disabled most add-ons. Nothing helps.

    If all else fails, you could use the JDBC driver for your
    SELECTS and your
    ODBCJDBC driver for INSERTS/UPDATES. It's a bit of a crap
    approach, but at
    least it'd work.
    Beyond that, I can't be of any help, sorry. Maybe you could
    revert to the
    7.0.1 version of the ODBC driver?
    Adam

  • Jdbc:odbc bridge only returning one result when a count show 148 !

    Hello,
    Am sure i have done something stupid, but i have an issue with jdbc:odbc ....
    It is a simple sceanrio that i have coded umpteen times before ...
    I have the following ....
    1. Connection to DB2 on an IBM i5 (I apologise for not using native drivers from jt400.jar, but i had an ODBC code example and was in a rush - no excuse i know)
    2. Statement object created from connection above
    3. A string with my SQL in it
    4. A result set for the results.
    These are created as follows:
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(ODBCSource, userID, password);
    if (con == null) {
    // error handling not relevant here
    } else {
    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    String SQL = "select * from table";                    
    ResultSet rs = s.executeQuery(SQL);
    i then try to loop ....
    while (rs.next() )
    // stuff
    however, i only ever get one result .... if i stick in the check for isLast, the first loop hits this check, i get my little status message, and the loop ends.
    while (rs.next() )
    if (rs.isLast() )
    System.out.println("I am on last record");
    BUT if i run the SQL
    "select count(*) from table" ... i get a count of 148 !!
    I tried setting the FetchSize through setFetchSize(), but made no difference.
    This is running on a JBoss server 4.2.1GA, JDK is "jdk1.6.0_02" .... i have a suspicion that this may be a JBoss specfic issue, as this exact code runs just fine on the Domino platform that it was originally on, if this is the case, i apologise for wasting everyones time .... but would still appreciate any pointers you can give me.
    Cheers

    sorry .... just relaised this is in the wrong forum ... reposted in the Database connectivity forum !!

  • Search feature in outlook only returning "no results" all of a sudden.  Why?

    I use outlook for my mail.  all of a sudden, the search feature just returns a "no results" solution.  Any ideas why?

    Options > Privacy = un-check '''Permanent Private Browsing Mode'''

  • API search will only return the first 200 results????

    It seems that I can only retrieve 200 results when using doOracleSimpleSearch api call.
        osr = oses.doOracleSimpleSearch(strSearch, 1, 1000, false, false, true);
        nCount = osr.docsReturned;
        nCount2 = osr.resultElements.Length;
        nCount3 = osr.estimatedHitCount;nCount and nCount2 are both 200.
    nCount3 is 1332
    Ok, no problem. Even though I asked for 1000 results, I figure it will only return 200 at a time, so I write a simple loop.
       while (nTotalResults < nCount3)
          osr = oses.doOracleSimpleSearch(strSearch, nTotalResults + 1, 200, false, false, true);
          nCount = osr.docsReturned;
          nTotalResults += nCount;
       }After executing the search the first time, nTotalResults is set to 200, so I'm now requesting that the search starts at index 201 and to return the next block of 200.
    osr.docsReturned is now = 0
    stuck in infinite loop because it's not returning all my results.
    Update:
    It seems this is not just an API issue. If I do the search through the web interface, and go to page 20 (it's displaying 10 results per page) I see results. But as soon as I go to page 21, the page is blank even though it says there are over 1000 results.
    Edited by: JimG on Feb 15, 2012 5:17 PM

    You need to change the "Maximum Number of Results" from the Admin GUI.
    Go to Global Settings -> Query Configuration, and you'll find it there.

  • Query that only returns items that will produce a result

    Thanks to Mack for his help yesterday.  I would really appreciate some help from anyone who is more SQL competent than I am.  I have an SQL problem that is just completely over my head.  I've created a nifty tagging system for the blog, that sorts by tags and by multiple tags, check out the beta here: http://committedsardine.com/blog.cfm
    When a user selects a tag, it adds it to the value list SESSION.blogTags.  If the selected tag is there already, it removes it.  When the list for tags pops up, I output all the tags, and show their state.  You'll see what I mean if you try it.
    What this leads to is the ability to select a group of tags for which there are no query results.  What I want to do is only show those that will generate results and how many results they'll show.  Like this, select "fluency" by itself there are 310 entries
    fluency (310) | digital (234) | writing (12)
    Once fluency is selected, there are 13 articles that ALSO are tagged by "digital", but none that are tagged by writing:
    fluency | digital (12) | writing
    I have a table called blogTagLinks, that is just for tying a tag to a blog.  It lists a blogID and a tagID.  Here is a sample of it for reference:
    blogTagLinkID
    blogID
    tagID
    4
    2
    2
    5
    2
    3
    6
    2
    5
    39
    1
    18
    49
    1
    1
    42
    1
    9
    44
    1
    19
    47
    5
    14
    48
    1
    22
    54
    16
    22
    I'm including all my sql, but the spot that I need help with is marked in red below:
    <!---if URL.tg is defined, check to see if it exists in the database, then the SESSION, and either add or delete it from SESSION--->
    <cfquery name="rsAllTags" datasource="">
    SELECT tagsID, tagName
            FROM tags
            WHERE tagActive = 'y'
    </cfquery>
    <cfset allTags = ValueList(rsAllTags.tagsID)>
    <cfif isDefined("URL.blogTags")>
        <cfif ListFind(allTags, URL.blogTags) NEQ 0>
            <cfif ListFind(SESSION.blogTags, URL.blogTags) NEQ 0>
                <cfset SESSION.blogTags = ListDeleteAt(SESSION.blogTags, ListFind(SESSION.blogTags, URL.blogTags))>
                <cfelse>
                <cfset SESSION.blogTags = ListAppend(SESSION.blogTags, URL.blogTags)>
            </cfif>
        </cfif>
    </cfif>
    <!---get a list of all available tags, tags that if added to the already selected tags, will return a result--->
    <cfquery name="rsAvailableTags" datasource="">
    SELECT tagsID, tagName
            FROM tags
            WHERE tagActive = 'y'
            NEED SOME STATEMENT HERE OF BLOGTAGLINKS TO DETERMINE WHAT TAGS WILL PRODUCE A RESULT
    </cfquery>
    <!---if searching by tags, get a list of the currently selected tags for display, the 0 returns an empty result if there are no tags--->
    <cfif isDefined("SESSION.sb") AND SESSION.sb EQ "tg">
        <cfquery name="rsTags" datasource="">
            SELECT tags.tagName, tagsID
            FROM tags
            WHERE tagsID <cfif SESSION.blogTags NEQ "">IN(#SESSION.blogTags#)
            <cfelse> = 0</cfif>
        </cfquery>
        <cfset variables.newrow = false>
    </cfif>
    <!---get the information for the blogs list, filtered by keyword or tag if requested--->
    <cfquery name="rsBlog" datasource="">
        SELECT blog.blogID,
            blog.storyID,
            blog.blogDate,
            blogStories.storyID,
            blogStories.blogTitle,
            SUBSTRING(blogStories.blogBody,1,200) AS blogBody,
            images.imageName
        FROM blog, blogStories, images
        WHERE blog.storyID = blogStories.storyID AND images.imageID = blog.photoID AND blog.blogDate < "#todayDate#" AND blog.deleted = 'n'
    <cfif SESSION.sb EQ "kw">AND  CONCAT(blogStories.blogBody, blogStories.blogTitle) LIKE '%#SESSION.blogKeywords#%'</cfif>
        <cfif SESSION.sb EQ "tg" AND SESSION.blogTags NEQ "">
                AND  blog.blogID IN (
                SELECT blogID
                FROM blogTagLink
                <cfif SESSION.blogTags NEQ "">
                    WHERE tagID IN(<cfqueryparam cfsqltype="cf_sql_integer" value="#SESSION.blogTags#" list="true">)
                    GROUP BY blogID
                    HAVING count(tagID) = #ListLen( SESSION.blogTags )#)
                </cfif>
         </cfif>
    ORDER BY blog.blogDate DESC
    </cfquery>

    There might be a single query solution but here's a query that you
    will need to run for each tag in the database (cfloop over all the
    tags) and will give you the number of blogs that have the selected
    tags + the current tag
    SELECT Count(*) AS blog_count
    FROM (
        SELECT blogID
        FROM blogTagLink
        WHERE tagID IN(<cfqueryparam cfsqltype="cf_sql_integer"
    value="#SESSION.blogTags#" list="true">)
             OR tagID = #currentTagID#
        GROUP BY blogID
        HAVING count(tagID) = #ListLen( SESSION.blogTags )#
             OR count(tagID) = #ListLen( SESSION.blogTags )# + 1
        ) AS blogs
    Mack

  • Search in Finder only returns results for "This Mac"

    I'm experiencing the following, annoying issue with searching for files in Finder:
    When I type a search text in Finder's search field, it only returns results when I select "This Mac". It does not return a single search result when being in any subfolder.
    To make this a bit more clear assume the following structure:
    | -– A
    |    | -- B
    |         | -- sample.pdf
    |         | -- another-sample.pdf
    |
    | --- C
    |     | -- yet-another-sample.pdf
    |
    | -- sample.pdf
    I use finder to navigate to folder B. I type "sample" into the search bar. No results are returned.
    Next I switch to "This Mac" and all of the above .pdf files are – correctly – returned.
    The same happens when I'm in any other subfolder. Search only returns results when I switch to "This Mac".
    Notes:
    I'm not talking about network drives. All folders are local and below "This Mac" in the file system hierarchy.
    I have forced Spotlight to reindex via sudo mdutil -E.
    It happens on multiple machines, Snow Leopard upgrades and Lion clean installs.
    Any idea? This bug renders Lion almost useful for me.

    I had the same problem .... found this link
    http://osxdaily.com/2007/02/15/spotlight-wont-work-fix-a-broken-spotlight-menu-w ith-these-troubleshooting-tips/
    And solution 3 the simplest, no wait the wierdest,
    Change the screen resoultion then revert!
    worked for me ...... go figure.

  • Oracle:JDBC Call returns no results, SQL*Plus returns 1 record, Please help

    Any help would be greatly appreciated.
    Running 9.2.0.5.0, and using latest 9.2 JDBC 1.4_g drivers in thin mode.
    Execute the following query from SQL*Plus and it returns one row, from JDBC using a PreparedStatement, I get no results. Here's the query, table def, record, etc.:
    Query:
    SELECT
    ID_WEB_FRM,ID_WEB_SIT,CDE_LVL_1_FUNC,
    CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID
    FROM
    WEB_FRM
    WHERE
    ID_WEB_FRM = ' '
    OR
    (ID_WEB_SIT = 'test' AND CDE_LVL_1_FUNC = ' '
    AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1
    AND NUM_WEB_PG_ID = 0)
    Record returned from SQL*Plus:
    ID_WEB_FRM ID_WEB_SIT CDE CDE NUM_WEB_FUNC_PG NUM_WEB_PG_ID
    NfRRmc5XZu test u2T 1 0
    Both in the data returned and the query, there are no blanks, but they are a single space instead (hard to see in message here).
    Java code:
    int count = 1;
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++,form.getSiteID());
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++, form.getFunctionID());
    findDBNameStatement.setInt(count++,form.getPageNumber());
    findDBNameStatement.setInt(count++,form.getSectionNumber());
    ResultSet resultSet = findDBNameStatement.executeQuery();
    ResultSetMetaData metaData = resultSet.getMetaData();
    resultSet.next() returns false
    DB table:
    CREATE TABLE web_frm (
    ID_WEB_FRM varchar2(10) NOT NULL,
    ID_WEB_SIT varchar2(20) NOT NULL,
    NAM_WEB_FRM varchar2(40),
    TXT_EMAIL_SUBJ varchar2(50),
    CDE_LVL_1_FUNC char(3),
    CDE_LVL_2_FUNC char(3) NOT NULL,
    NUM_WEB_FUNC_PG int NOT NULL,
    NUM_WEB_PG_ID smallint NOT NULL,
    DTE_WEB_FRM_EFF date NOT NULL,
    DTE_WEB_FRM_TRM date,
    CDE_VLDT_RUL char(3),
    DTE_LAST_EXPRT date,
    TXT_CNFRMN_MSG varchar2(4000),
    IND_UPDT_ALWD char(1) NOT NULL,
    TXT_RECAP_HDR varchar2(4000),
    TXT_RECAP_FTR varchar2(4000),
    CDE_WEB_OBJ char(3),
    NUM_MAX_FRM_WIDTH number(4,0),
    IND_RECAP_PG char(1) NOT NULL,
    IND_CNFRM_PG char(1) NOT NULL,
    IND_DSPL_CNFRM_NUM char(1) NOT NULL,
    CNT_SUBM_MAX int,
    TXT_CHCE_ADD_MSG varchar2(255),
    TXT_CHCE_MOD_MSG varchar2(255),
    TXT_WEB_HDR varchar2(4000),
    TXT_WEB_FTR varchar2(4000),
    TXT_WAIT_LIST_MSG varchar2(255),
    FORMOBJECTHEIGHT int NOT NULL,
    FORMOBJECTWIDTH int NOT NULL
    ALTER TABLE web_frm ADD ( CONSTRAINT PK_web_frm PRIMARY KEY (ID_WEB_FRM));
    ALTER TABLE web_frm ADD ( CONSTRAINT UK_web_frm UNIQUE (ID_WEB_SIT,CDE_LVL_1_FUNC,CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID)) ;
    Thanks,
    Matt

    That's not quite right. From the javadocs:
    next
    public boolean next()
    throws SQLException
    Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row; the first call to the method next makes the first row the current row; the second call makes the second row the current row, and so on.
    If an input stream is open for the current row, a call to the method next will implicitly close it. A ResultSet object's warning chain is cleared when a new row is read.
    Returns:
    true if the new current row is valid; false if there are no more rows
    Throws:
    SQLException - if a database access error occurs

  • JDBC Call returns no results, SQL*Plus returns 1 record, Please help!

    Any help would be greatly appreciated.
    Running 9.2.0.5.0, and using latest 9.2 JDBC 1.4_g drivers in thin mode.
    Execute the following query from SQL*Plus and it returns one row, from JDBC using a PreparedStatement, I get no results. Here's the query, table def, record, etc.:
    Query:
    SELECT
    ID_WEB_FRM,ID_WEB_SIT,CDE_LVL_1_FUNC,
    CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID
    FROM
    WEB_FRM
    WHERE
    ID_WEB_FRM = ' '
    OR
    (ID_WEB_SIT = 'test' AND CDE_LVL_1_FUNC = ' '
    AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1
    AND NUM_WEB_PG_ID = 0)
    Record returned from SQL*Plus:
    ID_WEB_FRM ID_WEB_SIT CDE CDE NUM_WEB_FUNC_PG NUM_WEB_PG_ID
    NfRRmc5XZu test u2T 1 0
    Both in the data returned and the query, there are no blanks, but they are a single space instead (hard to see in message here).
    Java code:
    int count = 1;
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++,form.getSiteID());
    findDBNameStatement.setString(count++," ");
    findDBNameStatement.setString(count++, form.getFunctionID());
    findDBNameStatement.setInt(count++,form.getPageNumber());
    findDBNameStatement.setInt(count++,form.getSectionNumber());
    ResultSet resultSet = findDBNameStatement.executeQuery();
    ResultSetMetaData metaData = resultSet.getMetaData();
    resultSet.next() returns false
    DB table:
    CREATE TABLE web_frm (
    ID_WEB_FRM varchar2(10) NOT NULL,
    ID_WEB_SIT varchar2(20) NOT NULL,
    NAM_WEB_FRM varchar2(40),
    TXT_EMAIL_SUBJ varchar2(50),
    CDE_LVL_1_FUNC char(3),
    CDE_LVL_2_FUNC char(3) NOT NULL,
    NUM_WEB_FUNC_PG int NOT NULL,
    NUM_WEB_PG_ID smallint NOT NULL,
    DTE_WEB_FRM_EFF date NOT NULL,
    DTE_WEB_FRM_TRM date,
    CDE_VLDT_RUL char(3),
    DTE_LAST_EXPRT date,
    TXT_CNFRMN_MSG varchar2(4000),
    IND_UPDT_ALWD char(1) NOT NULL,
    TXT_RECAP_HDR varchar2(4000),
    TXT_RECAP_FTR varchar2(4000),
    CDE_WEB_OBJ char(3),
    NUM_MAX_FRM_WIDTH number(4,0),
    IND_RECAP_PG char(1) NOT NULL,
    IND_CNFRM_PG char(1) NOT NULL,
    IND_DSPL_CNFRM_NUM char(1) NOT NULL,
    CNT_SUBM_MAX int,
    TXT_CHCE_ADD_MSG varchar2(255),
    TXT_CHCE_MOD_MSG varchar2(255),
    TXT_WEB_HDR varchar2(4000),
    TXT_WEB_FTR varchar2(4000),
    TXT_WAIT_LIST_MSG varchar2(255),
    FORMOBJECTHEIGHT int NOT NULL,
    FORMOBJECTWIDTH int NOT NULL
    ALTER TABLE web_frm ADD ( CONSTRAINT PK_web_frm PRIMARY KEY (ID_WEB_FRM));
    ALTER TABLE web_frm ADD ( CONSTRAINT UK_web_frm UNIQUE (ID_WEB_SIT,CDE_LVL_1_FUNC,CDE_LVL_2_FUNC,NUM_WEB_FUNC_PG,NUM_WEB_PG_ID)) ;
    Thanks,
    Matt

    I have verified the parameters and such, and if I run as a Statement instead of a PreparedStatement, the query works fine. After some more troubleshooting, I narrowed the problem down, but not sure of the fix.
    If I eliminate teh extra parameters and simplify things to:
    SELECT ID_WEB_FRM FROM WEB_FRM WHERE ID_WEB_SIT = 'test' AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1 AND NUM_WEB_PG_ID = 0
    The code works. But if I add the additional WHERE clause of CDE_LVL_1_FUNC = ' ' (has single space), it returns no data (record in the DB has single space in this new column. Query that does not work:
    SELECT ID_WEB_FRM FROM WEB_FRM WHERE ID_WEB_SIT = 'test' AND CDE_LVL_1_FUNC = ' ' AND CDE_LVL_2_FUNC = 'u2T' AND NUM_WEB_FUNC_PG = 1 AND NUM_WEB_PG_ID = 0
    It appears the JDBC Driver is trimming the parameter when it is a space when set through a PreparedStatement.setString(2," ")

  • SharePoint Foundation 2010 Search returns no results

    Hi,
    SharePoint foundation 2010 Search is not showing any results after configuring the step from the below link.
    http://wiki.sirkit.ca/2011/04/sharepoint-foundation-2010-search-returns-no-results/
    My Server Setup : 
    SharePoint Foundation 2010
    SQL Server 2008 r2
    We have created two web application and configured the search service as above mention link.
    And we have migrated a site from MOSS 2007 to SharePoint 2010 to one of  web application,we assigned search database to the newly migrated content database.
    Previously there was Form based Authentication was done on Moss 2007 site and on SP 2010 we are working on Windows authentication.
    Database showing crawl is working and showing success results as well in SQL table, Its only Not able to show the results on the page.
    Thanks in Advance
    Dinesh
    Regards, Dinesh Reddy.

    Don't look at the databases, it's a bad habit to get into and will lead to confusion.
    In search administration are you getting any sucsess messages in the crawl history and is the number of items in your index non-zero?
    If so that implies that the crawl process is working and it's the user security that's the issue.
    To confirm try searching for a file whilst logged in as the crawl account, that should return results.

  • Getting a "Displaying only the newest results below. To view all results, narrow your query by adding a filter" message in error

    I have a list with almost 10000 items. I have a view that should be returning 8 items. For me, the Farm Admin, I see the full set of expected values. The message "Displaying only the newest results below. To view all results, narrow your query by
    adding a filter" shows for other users. This makes no sense -
    there ARE filters on this view. I'd rather not increase the throttle limit.
    Anthony Kelly

    Hi Ajk,
    Check that the list is not scoped by an audience; but, I'm afraid that either way admin, (e.g. non Farm admin or site collection admin)
    I'd recommend exporting to excel, create two new spreadsheets and then import as custom lists.
    Best of luck and cheers,
    Stacy Anothersharepointblog.blogspot.com

  • Avoid JDBC sender error: Execute statement did not return a result set

    Hi!
    My JDBC sender adapter towards MS SQL server works fine, with an Execute statement calling a stored procedure that returns the source data needed. The stored procedure itself updates the status of database table records, so that only the unread records are returned each time the stored procedure is called.
    However, the communication channel monitoring sets a red flag for the JDBC sender adapter, when there are no values to fetch from the database table (using the stored procedure). Message says: "Database-level error reported by JDBC driver while executing statement 'EXECUTE FetchMessage 1, 9000'. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor."
    This is not an error situation, as I do not expect there to be any values to fetch from the database at all times.
    I do not see how to change the stored procedure to avoid this error.
    Is there a parameter to be set on the JDBC adapter that I can use, so the red flag is avoided?
    Thanks for any input!
    Regards,
    Oeystein Emhjellen

    Hi Oeystein Emhjellen.
    The problem is Store Procedure that has to generate always a ResultSet (or cursor). If it doesn't have a output, you have to generate an Empty ResultSet.
    Like a SELECT Statement:
    If there are data, SELECT get an output result but if it get nothing the SELECT Statement get a empty ResultSet.
    Ask to your database team.
    I hope it helps you.
    Bruno.

  • "select count(*)" and "select single *" returns different result

    Good day!
    product version SAP ECC 6.0
    oracle10
    data transfers from external oracle db into customer tables using direct oracle db link
    sometimes I get case with different results from 2 statements
    *mytable has 10 rows
    *1st statement
    data: cnt type I value 0.
    select count( * ) into cnt from mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *cnt returns 10 - correct
    *2nd statement
    select single * from  mytable WHERE myfield_0 = 123 and myfield_1 = '123'.
    *sy-dbcnt returns 0
    *sy-subrc returns 4 - incorrect, 10 rows are "invisible"
    but
    1. se16 shows correct row number
    2. I update just one row from "invisible" rows using se16 and 2nd statement returns correct result after that
    can not understand why
    thank you in advance.

    Thank you, Vishal
    but,
    general problem is that
    1. both statements have the same WHERE conditions
    2. 1st return resultset with data (sy-dbcnt=10), 2nd return empty dataset, but must return 1 in sy-dbcnt
    Yes, different meaning, you are right, but must 2nd must return 1, because of "select single *" construction, not 0.
    Dataset to process is the same, WHERE conditions are equal...
    I think the problem is that how ABAP interperets select count(*) and "select single *".
    Maybe "select count (*)" scans only PK from index page(s)? and "select single *" scans data pages? and something is wrong with that?
    I'm new in SAP and didn't find any SAP tool to trace dump of data and indexes pages with Native SQL.
    se16 shows all records.
    And why after simple manual update of just one record using se16 "select single *" returns 1?
    I've just marked one row to update, didn't change any data, then pressed "save".

Maybe you are looking for