Problem with GROUP BY/HAVING in Sybase -- Oracle Migration

Having problem converting SQL from Sybase to Oracle. The SQL statement in Sybase does
not work in Oracle (ORA-979). When make changes the Oracle result is incorrect. Oracle Version
is 8.1.6.3.
#1 Sybase
SELECT
BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, MAX(OBS_DATE)
FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
WHERE (t.newssn = ans.SSN)
GROUP BY
SSN
HAVING obs_date = MAX(obs_date);
Result = 19,567 (Correct)
#2 Oracle (8.1.6.3)
SELECT
BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, MAX(OBS_DATE)
FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
WHERE (t.newssn = ans.SSN)
GROUP BY
SSN
HAVING obs_date = MAX(obs_date);
Result = ORA-00979 not a Group By expression
#3 Oracle
SELECT
BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, MAX(OBS_DATE)
FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
WHERE (t.newssn = ans.SSN)
GROUP BY
OBS_DATE, BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND
HAVING obs_date = MAX(obs_date);
Result = 19,598 (incorrect count)
Possible suggestions?

SELECT
BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, OBS_DATE
FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
WHERE (t.newssn = ans.SSN)
AND obs_date = (select MAX(obs_date) from wims3.adm_new_stscrnt ans2, wims3.tt_t_ssn2 t2 where ...)
... should be the primary key-where

Similar Messages

  • Result set problem with GROUP BY

    hi there, this should be the simplest of queries but.........
    when run, the list size is 13, this is the number of letting units in the table. it appears not to be grouping by the property id.if it was doing this there should only be 8 rows. having said this, the while loop should output the count of each row, it does this 8 times with the correct counts. it then crashes with a invalid curser error. it appears the query is workig correctly but the resultset thinks its got 13 rows when it only has 8.
    accessing ms access db
    using jdbc:odbc
    heres the code
    searchResults = stmt.executeQuery(
    "SELECT Count(*) AS FreeUnits " +
    "FROM letting_units " +
    "GROUP BY letting_units.property_id");
    searchResults.last();
    listSize = searchResults.getRow();
    searchResults.beforeFirst();
    System.out.println(listSize);
    while (searchResults.next())
    System.out.println(searchResults.getString(1));
    hope someone can help me
    cheers
    andy

    It's not the problem with GROUP BY. You should use scrollable result set to move in both directions (forward and backward).
    In your code
    searchResults.beforeFirst(); line may return false. So you will get the searchResults.next() false. Once you move forward in non-scrollable cursor cannot come back. So when you create the statement object use TYPE_SCROLL_INSENSITIVE or TYPE_SCROLL_SENSITIVE constants provided in the ResultSet.

  • Problem with Group policies and Administrator count

    I have one problem with Group policies and Admnistrator count.
    Win XP, Client 4.91, Client Zen 4
    I use DLU for users.
    the Group policies are well applied and i keep them after logout for
    security reasons.
    But my problem is, after logout, the Administrator count becomes this
    Group policies, and the only technique that I use, is to remove the
    repertories c:\windows\system32\GroupPolicy*. Administrator must
    loguing again for having good policies.
    Can you help me?

    Bill,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Problems with WAS 6.40 Installation on Oracle - Phase 11 of 34

    Hello,
    <b>Problems with WAS 6.40 Installation on Oracle (Phase 11 of 34)</b>
    with the installation of the Web Application server 6,40 SR1 on a Oracle server I get in phase 11 of 34 (Create Oracle Database) the following error-message:
    CJS-00084 - SQL statement or script failed. Diagnosis: Error message: ORA-12547: TNS:lost contact.
    error while loading shared library: libodm9.so : cannot open shared object file: No such file or dirctory.
    Best Reagrds,
    Ralf Steffens

    hi Ralf
    i've found one composite note for Oracle <a href="https://websmp203.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700001366932002">505630</a>
    hope this solves...
    <i><b>Symptom</b>
    ORA-12547: TNS:lost contact
    Brbackup, brarchive, brrestore or brconnect may terminate with errors similar to the following:
    BR301E SQL error -12547 at location BrDbConnect-1
    BR301E SQL error -12547 at location dbf_info_get-1
    Sapdba returns the following error, for example:
      SAPDBA: ORACLE error -12547 occurred while checking instance status!
    The R/3 work processes or R3trans return the following error at Connect:
      C  *** ERROR => CONNECT failed with sql error '12547'
    <b>Other terms</b>
    TNS-12547, TNS-00517
    <b>Reason and Prerequisites</b>
    As part of the Net8 Connect, a program such as the R/3 kernel, R3trans, svrmgrl, sqlplus or ODMA establishes a connection to the Oracle database. If the connection terminates due to problems at the server end, it can result in ORA-12547.
    Additional information for the error is often available in sqlnet.log. In many cases, other messages that are not reported by all tools precede ORA-12547. If ORA-12547 occurs when the ODMA accesses the old Oracle-Home during a database upgrade, for example, it may make sense to temporarily restart ORACLE_HOME on the old Oracle-Home for test purposes and then to execute sqlplus or svrmgrl.
    Even if sapdba or the BR tools terminate with an ORA-12547 when calling sqlplus or svrmgrl recursively, you should, for test purposes, call sqlplus or svrmgrl manually with the operating system user that was used.
    Hopefully, a more informative error message will appear in addition to ORA-12547, for example:
      ld.so.1: oracleC11: fatal: relocation error: file
               /oracle/C11/817_64/libx8.so: symbol ksunsga_:
               referenced symbol not found
    If you find accompanying error messages of this type, start a note search with the corresponding search terms since we are often aware of the problem and a solution may already be available. If you do not find any significant error messages or a suitable note, check the following possible causes for ORA-12547:
    1. UNIX: Incorrectly linked Oracle tools
    2. UNIX: Problems with XPG4 compliance and s-bit
    3. Too many requests to the listener at the same time
    4. HP-UX, Oracle 8.1: Missing OS patch
    5. Use of CRYPTO parameters in sqlnet.ora
    6. AIX: I/O Async is deactivated
    7. Resource problems
    8. The CONNECT_TIMEOUT_LISTENER parameter in listener.ora is too low
    9. Activated Oracle trace
    10. UNIX: Incorrect oracle executable authorization
    11. SOLARIS: LD_LIBRARY_PATH set when you call ODMA
    12. AIX: Problem with post/wait kernel enhancement
    13. UNIX: Problems with the libobk library
    14. SOLARIS: Incorrect search sequence in the path variable
    15. UNIX: Conflicts between 32-bit and 64-bit files
    <b>Solution</b>
    1. Relink the Oracle software as ora<sid> with
      cd $ORACLE_HOME/rdbms/lib
      make -f ins_rdbms.mk install
                  or
      relink all
    1. See Note 88884.
    2. If individual work processes terminate with ORA-12547 when you start an R/3 instance, See Note 131561.
    3. See Note 399610.
    4. You can set security parameters that begin with SQLNET.CRYPTO_ in sqlnet.ora as part of the Advanced Security Option. Oracle releases < 8.1.7 cannot process these parameters correctly and result in ORA-12547. In this case, delete these types of parameters from sqlnet.ora.
    5. If I/O is deactivated on AIX Async, the Net8 Connect fails with ORA-12547. In this case, activate I/O Async by using smitty.
    6. Insufficient resources such as available memory on the database server can cause ORA-12547. For more information, see 384839.
    7. In individual cases, it may make sense to increase the CONNECT_TIMEOUT_LISTENER parameter in listener.ora (for example, by 5 seconds, so from 10 to 15). Although a value of 10 seconds should usually be sufficient to establish a connection.
    8. Delete the log files written by the Oracle trace in accordance with Note 92537.
    9. Check to see whether the executable in $ORACLE_HOME/bin has the "rwsr-s--x" authorizations and the ora<sid> owner and correct this if necessary.
    10. If you call ODMA on SOLARIS as part of a database upgrade and if LD_LIBRARY_PATH is set explicitly (on the lib directory of the target release), calling the old Oracle software through ODMA may fail with ORA-12547. If you use the old ORACLE_HOME to list sqlplus or svrmgrl, you get the following error:
      ld.so.1: oracle<sid>: fatal: relocation error:
               file /oracle/<sid>/817_64/libx8.so: symbol ksunsga_:
               referenced symbol not found
      ORA-12547: TNS:lost contact
                   In this case, permanently delete LD_LIBRARY_PATH from the environment. This does not have any negative effects since the libraries are automatically found in the correct directories as of Oracle 8.1.
                   If problems occur with the post/wait extension on AIX, the following type of errors will be displayed:
      exec(): 0509-036 Cannot load program oracleC11 because of the
      following errors:
              0509-130 Symbol resolution failed for oracle because:
              0509-136   Symbol pw_post (number 2524) is not exported
                          from dependent module /unix.
              0509-136   Symbol pw_wait (number 2525) is not exported
                          from dependent module /unix.
              0509-136   Symbol pw_config (number 2526) is not exported
                          from dependent module /unix.
              0509-192 Examine .loader section symbols with the
                       'dump -Tv' command.
      ORA-12547: TNS:lost contact
    1. If the libobk library was created incorrectly, the following type of errors may occur:
      /oracle/C11/817_64/bin/oracle: /sbin/loader:
        Fatal Error: Cannot map library libobk.so
      /usr/lib/pa20_64/dld.sl: Unable to find library
        '/oracle/C11/lib64/libobk.sl
      exec(): 0509-036 Cannot load program oracleC11 because of the
              following errors:
      0509-150   Dependent module /oracle/C11/817_64/lib/libobk.a(shr.o)
                 could not be loaded.
      0509-152   Member shr.o is not found in archive
      ORA-12547: TNS:lost contact
                   Check to see whether libobk exists and, if it is a link, that it points to a valid object. Note 142635 contains more information about this. The libobk link may point to this if a libsbtsh8.* file exists in the Oracle library directory. If you are using a third-party Backint tool, contact the relevant supplier, since libobk often has to point to a backint-specific library.
    1. If an error such as
      ld.so.1: ./svrmgrl: fatal: libucb.so.1: open failed:
               No such file or directory
      ORA-12547: TNS:lost contact
                   occurs, the PATH has probably been set incorrectly. For more information, see Note 44361.
    1. If an error such as
      ld.so.1: oracle<sid>: fatal: <library> wrong ELF class: ELFCLASS64
      ORA-12547: TNS:lost contact
                  concerning "wrong ELF class" occurs, check whether the <library> mistakenly has a different bit size than the tool that was called. You can determine this using
      file <library>
      file <tool>
                   All the files involved must uniformly be either 32-bit or 64-bit.
    </i>
    Regards
    Arunkumar

  • Anyone else having problems with group messages in iOS 7?

    Upgrade to iOS7 went fine. Everything worked smoothly up until about 6:30pm Central time. Can't send/receive group messages in iMessage. Anyone else?
    Not sure if this is a problem with my phone or iMessage.

    It has failed to work on two of my iOS devices. I am using air 2.6.
    This is my code:
    Bookmark = SharedObject.getLocal("bookmarkData", "/");
    if (Bookmark.data == undefined){
         Bookmark.data['lessonIndex'] = 0;
    lessonIndex = Bookmark.data['lessonIndex'];
    LessonIndex is always 0 at the start of the program. This is a product killing problem. If I cannot resolve this 3 years of work has just been flushed down the toilet.

  • Problem with Application Login after upgrading to Oracle 11g

    I have a home-grown application with Oracle 10g database running under Windows XP Pro. Recently, I installed Oracle 11g and imported the application database from 10g to 11g (still want to keep the 10g running for a while). However, I now having problem with the application logging into the new 11g database. (Keep getting invalid user/name message).
    BTW, I have no problem accessing the 11g database through SQLPlus (logging in with the same name and password that I use for the application), and the connection test of NetManager (again using the same name and password that I use for the application) was successful.
    The application itself uses the old Borland BDE (Borland Database Engine) to access the 10g and 11g database. Testing confirms that BDE can access Oracle 11g with no problems.
    Any idea about the probable cause(s) of the problem?
    Thanks in advance,
    sg2000

    11g by default is case sensitive username/password.
    You can disable that with setting parameter SEC_CASE_SENSITIVE_LOGON to false.
    SQL> SHOW PARAMETER SEC_CASE_SENSITIVE_LOGON
    SQL> ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = FALSE;

  • Problems with special characters uploading data into oracle database

    Greetings
    I have a problem uploading data into oracle tables from sybase datasource. The data that I want to upload is in Spanish, for example when I have a varchar field with the data 'Consultoría', in oracle table the data upload with interrogation symbols.
    I have my source and target datastores configured as follows.
    Any suggestion? Thank you for your time

    Chack section 10 Locales and Multi-byte Functionality in the SAP Data Services Reference Guide for an exhaustive description of NLS settings.
    As a summary, following settings are required:
    locales in the datastore definitions match the actual locale used in the associated databases
    the locale of the DS engine allows for source to target translation
    the character set in the target database supports storage of accented characters

  • Problem with Groups from Address Book in Apple Mail

    I have set up a group in my address book. When I use Apple Mail I use this group to send specific messages to. But for some reason I keep getting error messages saying that my outgoing sever encountered a problem with the messgae. It only happens when I send messages with a group, not if I send messages to single recipients. The group consists of 90 emails, so I can't enter their emails each time I want to send a message to the group.
    Thanks in advance,
    Regards

    I am having a similar problem. All the addresses are correct, and I know this because I use them all the time with no errors. BUT when bundled into a group - actually any group I set up I cannot send successfully. I have two groups in my mail program and neither will work.

  • Reinstallation for IOS skype. problems with groups and contacts

    I was having a problem with Skype on my Iphone; new messages wouldn't load, and if they did it was around 10 minutes after they sent them. So I uninstalled the app and then reinstalled it. As soon as I logged into my account I realized most of my contacts didn't have a profile picture, nor did it have our conversations. It also got rid of all my skype groups; I still got notifications for those groups, but if I clicked on them it would bring me to a page saying that it's an empty group. Also if I get on skype on my laptop everything is fine, I still have my groups, my contacts all have pictures and our conversations are still there. I tried to reinstall it on my phone again, but this time all my groups were still gone, but different contacts wern't complete. Because I still had the contacts I tried to send a message on of my contacts that didn't have a profile picture and although it said it sent, I never got a reply. So I got on my laptop and asked if he got it, and he said he didn't.  Is anyone else haing this problem? If so do you know how to fix it? Thank you

    Ok I just talked to support via chat and apparently this is a known iPhone mobile App issue.  This is exactly what he said to me: "I was informed that this issue already have a ticket to our engineers and they are already working on this one. This has something to do with the latest version of Skype for tablets and mobiles.  We may release another version of Skype app so once an update is avaialble, update the app on your phone ASAP." Hope this ease some frustration.

  • Has Yosemite corrected Mavericks' Mail/Contacts problem with Groups?

    After I switched from Snow Leopard to Mavericks, I found that I could no longer list a Contact Group name in the To block of an email without all of the addresses in the group showing, despite having Mail Preferences set so that all of the addresses wouldn't show. The work-around for this problem is having to put Contact Group names in the Blind Copy section of an email. Does anyone know if Yosemite has corrected this problem?
    Thanks,
    Bob W.

    Thanks Barney. I assumed that Yosemite hadn't corrected the problem.
    However, I'm not sure where you got the information that the "BCC" section on Mail email forms was designed to be used for "Group" addresses from Mac's Address Book (now Contacts).  The "BCC" section of the email form was designed to be used by email composers who wanted copies of their emails to go to addresses that they wanted to keep hidden from those whose addresses appeared in the "To" section of the email.
    The "Group" address feature in Contacts were created to allow email senders the option to send emails to large numbers of addressees that had something in common (such as a group of relatives of the sender, or in my case, members of a club), so that you didn't have to type in large numbers of addresses in the "To" window every time you wanted to send to such a group. At the same time, it kept the addresses hidden from all of those who received the email as well as from spammers.
    Mac also gives (or did give) you the option to have the addresses in the Group in the "To" window to show or not to show. Go to "Preferences-Composing" section in Mail and you'll see that under the "Addressing" heading, you're given the option "When sending to a group, show all member addresses."  Since that option is normally unchecked, the default is to not have the addresses show. Unless you opt to allow the addresses to show, only the name that you've given the Group shows in the "To" window of the email. 
    If the Group addresses in Contacts were designed to be placed in the "BCC" section of an email, there would be no purpose in having that Preference option available in Mail Preferences.  The problem with having to use the "BCC" section of the email for Group addresses is that many email server companies assume that high numbers of addresses showing in the "BCC" section of an email is an indicator that the email is coming from a spammer, so the use of "BCC" for large numbers of email addresses can cause problems. The use of "Group" address names in the "To" window avoids those problems.

  • Recent Problem with Grouping in P6

    Recently I am having a problem with the grouping activities option in P6, 8.2.  While I used to be able to group with no problem, now when I try to perform a customized grouping, I am not able to get to the grouping bands.  It seems like this is a P6 software bug, not a database bug.  Has anyone seen this problem before and if so, how did you fix it?

    Hi,
    This is a known issue. As a workaround you just need to expand the window. For a solution, please refer to:
    Fields Are Cut Off Or Missing In P6 Dialog Boxes With Incorrect DPI (Doc ID 897035.1)
    ========
    Was our answer helpful?
    If so, highlight the information for other Community members by rating it or marking the answer as correct.
    Just hit the “Correct Answer” link on the answer, or rate it by clicking "Helpful Answer" or "Like".

  • Oracle XA driver problem with WLS 7.0.1.0, Oracle 9.0.1

    We are using simplified chinese, after swith to bea jdriver, it messed up
    all the encoding. So we cannot display Chinese character correctly.
    We are using WLS 7.0.1.0, Oracle 9.0.1 on both Windows and Solaris 8
    environment, BEA supplied JDK 1.3.1_03.
    We have many diffrent problems with oracle drivers:
    1. We want to use XA driver to support distributed transaction, However:
    * bea jdriver xa messes up with encoding
    * when using oracle 901 driver, everything works fince except webservices.
    Workshop application access the ejb, then the workshp application sets
    isolation level, but oracle driver does not support it and gives error. Is
    there a way to turn off isolation level in workshop? I tried manually edit
    weblogic-ejb-jar.xml, however,workshop cannot redeploy it after that.
    2. When not using XA, oracle thin driver works fine. But we lost XA
    capability.
    Any work around?

    I did try to change the value in this config file as well, but did not help.
    In fact, the installation default setting is with
    '<transaction-isolation-level>' commented out.
    And when I use bea oracle jdriver, it somehow messed up with database
    character set encoding, so our Chinese characters could not be retrieved
    correctly. And I try to set the encoding of jdriver to 'GBK', it did not
    work.
    "Anurag Pareek" <[email protected]> дÈëÏûÏ¢ÐÂÎÅ
    :[email protected]..
    Hello Ma,
    The transaction isolation level value for EJBs backing the JWS files is
    specified in the <transaction-isolation-level> tag in the
    WEB-INF/weblogic-jws-config.xml file of a Workshop project. You can
    manipulate this value to serve your purpose.
    Please do let me know how it goes.
    Regards,
    Anurag
    Workshop Support
    "Ma Jie" <[email protected]> wrote in message
    news:[email protected]..
    We are using simplified chinese, after swith to bea jdriver, it messed
    up
    all the encoding. So we cannot display Chinese character correctly.
    We are using WLS 7.0.1.0, Oracle 9.0.1 on both Windows and Solaris 8
    environment, BEA supplied JDK 1.3.1_03.
    We have many diffrent problems with oracle drivers:
    1. We want to use XA driver to support distributed transaction, However:
    * bea jdriver xa messes up with encoding
    * when using oracle 901 driver, everything works fince exceptwebservices.
    Workshop application access the ejb, then the workshp application sets
    isolation level, but oracle driver does not support it and gives error.Is
    there a way to turn off isolation level in workshop? I tried manuallyedit
    weblogic-ejb-jar.xml, however,workshop cannot redeploy it after that.
    2. When not using XA, oracle thin driver works fine. But we lost XA
    capability.
    Any work around?

  • Problem with Grouping in Interactive Forms by Adobe

    Hey Guys!
    I have a problem using the group function for a table in Interactive Forms by Adobe and I have not found a solution yet, so I hope anybody can help me.
    I've created the table in the LiveCycle Designer using subforms and I want to use the group function for a specific field of my table. Now the problem is that the entries of the table are not shown grouped for the same values of my specific field but there is still one row for each entry. How do I have to edit binding, flow etc. for the subforms of a group?
    I hope anybody can help me or provide me a better solution.
    Thanks in advance.
    Martin

    Hi Otto,
    thanks for your reply.
    I'm sorry the 'grouping function' I've announced is called 'control levels' in English I can set this function for a field of a table in the context of the form in the transaction SFP in SAP. Then in the hierarchy the field is displayed above the group of the other fields of the table. Usually in the form this should lead to a 'grouping' for the specific field so if you have identical values there is just one entry in the form and all the rows that have this value should appear behind. My problem is that there is still one entry in the form for every row.
    Right now I'm using the solution you mentioned with the nested tables but i have some problems with the layout and page breaks (pagination).
    Thanks for your help.
    Martin

  • Problem with public pages having PL/SQL portlets

    I am having problem with a public page which has PL/SQL portlets.
    When I try to access that page without doing login, it displays everything but the portlets which are database driven.
    Is this the way this public page should behave?
    Is there anyway by which I can display data to my public pages from PL/SQL portlets without doing login?
    FYI PL/SQL portlets are in portal30 schema.

    Yes, it has is_runnable function and it looks like this :
    function is_runnable
    p_provider_id in integer
    ,p_reference_path in varchar2
    return boolean
    is
    begin
    If p_reference_path is null the caller may be the provider
    framework (i.e. the Refresh operation of the Portlet
    Repository).
    if (p_reference_path is null) then
    The following if statement is the security mechanism that
    the portlet implements. It does not have any other semantic
    meaning. Any portlet is expected to implement their own
    security mechanism.
    This security mechanism checks if the current user is logged
    on or just accessing the portal through the public account.
    if (wwctx_api.is_logged_on) then
    return true;
    else
    return false;
    end if;
    else
    If p_reference_path is not null the caller makes this call as
    a security check against the portlet instance.
    The security mechanism implemented by this portlet for portlet
    instances is null so true is returned. Returning this value
    indicates that all users have access to this portlet instance.
    return true;
    end if;
    end is_runnable;
    +++++++++++++++++++++++++++++++++++++++++++
    What should I need to change with that function? And what exactly is its use?
    FYI : The code which I wrote for my portlet is by doing some modification in downloaded service portlet. But I have not altered is_runaable function.

  • Problem with output data when calling into Oracle stored procedure

    I have a problem that I think I've seen posted by others, but I can't find it anywhere on the forum. Here's what it looks like:
    I have a application that sends a query parameter called custID in a URL to a JSP page.
    http://domain.com/decrypt.jsp?custID=ewsw
    The JSP subsequently calls into the method below to run a decryption stored procedure on an Oracle db. The custId parameter works fine from most clients. However, I have seen the decryption stored procedure return invalid information on some clients in the following case:
    http://domain.com/decrypt.jsp?custID='eirwx
    Here is how I define my call to the DCUSTID (decryption stored procedure):
    public long dCustID(String sCustID)throws SQLException {
    CallableStatement cs = null;
    try {
    long nCustID = 0;
    if(conn == null || conn.isClosed()) {getLocalConnection();}
    String sp = "BEGIN DCUSTID(?,?);END;";
    cs = conn.prepareCall(sp);
    cs.setString(1, sCustID);
    cs.registerOutParameter(2,java.sql.Types.NUMERIC);
    cs.execute();
    nCustID = cs.getLong(2);
    return nCustID;
    }finally { release(cs); }
    I have not been able to find a problem with the stored procedure (although Im not counting that out). Is there any way that the jsp or the code above is corrupting the data before it gets to the stored procedure? I'm very suspicious of the single quote at the begining of the custID query string parameter.
    Thanks

    >
    The JSP subsequently calls into the method below to
    run a decryption stored procedure on an Oracle db.
    The custId parameter works fine from most clients.
    However, I have seen the decryption stored procedure
    e return invalid information on some clients in the
    following case:
    The back tick doesn't matter.
    How do you know that the routine that you posted returns invalid information? Are you printing the value retreived before you return in the code that you posted? That is the only way to tell if that code is the problem vs some translation problem in something else.
    And what do you mean by 'invalid'? It does return a numeric value right? Is it negative? Or so large that it couldn't be a key? Or what?
    The input parameter to the stored proc is a varchar and not a char correct?

Maybe you are looking for

  • Ipod & Itunes no music transfer

    How do I get the music from iTunes to my iPod without the music on the iPod getting erased?

  • Lost music I added to iTunes when I did current update. It is on my iPad, but do not know how to get it onto new Mac.

    This is the second time I have updated to a newer version of Itunes and when complete the only music i have access to is the purchased music.I loaded several hundred songs to my former computer. It got wet and I lost entire hard drive, nothing was re

  • OS 9.2.2 and 10.4.8 with Quicktime?

    What is the highest version of quicktime that can be installed on the classic portion of my hard drive, using OS 9.2.2? Also, is there any picture viewer option for quicktime Pro 7.1.3 on OS 10.4.8?

  • Client Drops - No Exception Thrown

    Hi All, I have a client server application which has been tested extensively and works fine. I have recently migrated the server to a linux environment (it was on windows) and now am experiencing a problem. Any exception thrown in the client is progr

  • Make a button hide and show an image

    I want a button to hide and then show an image, basically an on/off switch.  I tried accomplishing this using multipl slides that jump around but even after removing all transitions, you can still tell that the slides are changing instead of just the