How to detect conversion errors due to charset mismatch client/server?

If a character cannot be converted by OCIStmtExecute (Bind Variable) and/or OCIStmtFetch (Into Variable), either a replacement character (usually question mark) or a similar character (e.g. è -> e) is used instead.
I am looking for a possibility to get an indicator flag if a column could not be converted between client character encoding (NLS_LANG setting) and database encoding (NLS_CHARACTERSET).
If I do the conversion in my code, setting OCI_ATTR_CHARSET_ID to OCI_UTF16ID and using OCICharSetToUnicode(), OCIUnicodeToCharSet() and OCICharSetConversionIsReplacementUsed(), this would be quite a bit of work, allocating extra buffers, and it detects only conversion errors during OCIStmtFetch (into variables), not for bind variables during OCIStmtExecute.

If a character cannot be converted by OCIStmtExecute (Bind Variable) and/or OCIStmtFetch (Into Variable), either a replacement character (usually question mark) or a similar character (e.g. è -> e) is used instead.
I am looking for a possibility to get an indicator flag if a column could not be converted between client character encoding (NLS_LANG setting) and database encoding (NLS_CHARACTERSET).
If I do the conversion in my code, setting OCI_ATTR_CHARSET_ID to OCI_UTF16ID and using OCICharSetToUnicode(), OCIUnicodeToCharSet() and OCICharSetConversionIsReplacementUsed(), this would be quite a bit of work, allocating extra buffers, and it detects only conversion errors during OCIStmtFetch (into variables), not for bind variables during OCIStmtExecute.

Similar Messages

  • How to detect an error from ajax get

    Hi -- This is in a javascript function.
    I have an object ajaxRequest defined as:
    ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=LOOKUP_VALUE',0);
    I call the app process as follows:
    ajaxResponse = ajaxRequest.get();
    The app process just looks up a value in the DB based on another. It works fine
    when there's a match. When there's not a match, I can see that the ajaxResponse
    contains "sqlerrm: ORA- ... ". And of course a json.parse fails.
    How can I detect that the get returned an error? I can't just search
    ajaxResponse for an string, right? (It doesn't appear that that object is
    simply treated as a string... )
    Thanks,
    Carol

    hi John -- Sounds good, but I guess I'm not sure how to go about it.
    LOOKUP_VALUE is:
    DECLARE
    -- Set wwv_flow.g_x01, g_x02, g_x03, g_x04 and g_x05 in the
    -- javascript part
    p_source_item_value varchar2(1000) := wwv_flow.g_x01;
    d_source_column_name varchar2(32) := wwv_flow.g_x02;
    d_dest_column_name varchar2(32) := wwv_flow.g_x04;
    d_lookup_table_name varchar2(32) := wwv_flow.g_x05;
    BEGIN
    --Use this to get a JSON string back in the javascript,
    -- based on the SQL query
    APEX_UTIL.JSON_FROM_SQL('SELECT '||d_dest_column_name||' RETURN_VAL FROM '||d_lookup_table_name||'@'||:DB_NAME||' WHERE '||d_source_column_name||' = '''|| p_source_item_value||'''');
    END;
    So, it's returning this JSON object to the javascript. As I said, it works fine when there's a match.
    I'm not sure how to catch an error in the LOOKUP_VALUE process and get it back to the javascript. Ideas?
    Also, even if I do get that going, I'm not sure how to check the returned object for some sort of problem.
    The javascript function code is below. Look for #### for my comments. Essentially, right now, if
    there is an error in the json object (it's showing up as a numeric or value error), the parse fails. So I
    need to detect the problem before the parse. OR, if I can just modify LOOKUP_VALUE to plug in
    something like 'NO MATCH' when there's a problem or no value is found, then I think json.parse will work
    and my page item can just be set to NO MATCH. Does this make sense?
    Here's the function.
    Thanks for your help!
    Carol
    function jsLookupValue(source_item_value, source_column_name, dest_item_name, dest_column_name, lookup_table_name){
    // Continue only if there are valid values
    if (valueOf(source_column_name)&&valueOf(dest_item_name)&&valueOf(dest_column_name)&&valueOf(lookup_table_name)){
    //Check to see if the source_item_value is null (either all spaces or empty
    //If it is, set the dest item to null, but only if it's not already --
    //otherwise we get into a loop.
    source_item_value = trim(source_item_value);
    dest_item_value = trim($v(dest_item_name));
    if (source_item_value.length==0) {
    if (dest_item_value.length != 0) {
    $s(dest_item_name, null);
    }else{
    //This is the AJAX call to the Application Process from step 1
    ajaxRequest = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=LOOKUP_VALUE',0);
    //Here we are adding that x01 parameter we use in the app process with the value of the objecttype_name field
    ajaxRequest.addParam('x01', source_item_value);
    ajaxRequest.addParam('x02', source_column_name);
    ajaxRequest.addParam('x03', dest_item_name);
    ajaxRequest.addParam('x04', dest_column_name);
    ajaxRequest.addParam('x05', lookup_table_name);
    //Now do the actual AJAX call and put the result in ajaxResponse
    ajaxResponse = ajaxRequest.get();
    //Check if there is a response
    if (ajaxResponse) {
    // ######### When there's no row matching the query, this alert shows
    // "sqlerrm: ORA-06502 PL/SQL: numeric or value error"
    // Can I somehow check ajaxResponse for that string?
    alert("Response from APP process: " + ajaxResponse);
    //We need to format the JSON return string and put it in a JSON object
    // the formatting is done by a function in the external JSON library
    // the jsonobj can be used to retrieve the data returned by the App process
    // ######### If there was an error, the parse fails
    var jsonobj= ajaxResponse.parseJSON();
    alert('Filtered returned value from APP process: ' + jsonobj.row[0].RETURN_VAL);
    // And finally, we set the DNAME item with the value of the jsonobj.DNAME
    // an array was created in the object with the name row, so that is why you have to include row[0] to retrieve the data
    if (jsonobj.row[0].RETURN_VAL != $v(dest_item_name)) {
    // ########## I'd like to just set the destination item w/ something like "NO MATCH"
    // probably regardless of the error...
    $s(dest_item_name, jsonobj.row[0].RETURN_VAL);
    }else{
    //alert ('NOT setting dest item');
    } //not setting
    }else{
    alert('No response from app process');
    } //no response
    } //no source item value
    } //no bad nulls
    } //function

  • How to catch the error code thrown by Oracle client installation?

    Hi everyone,
    Recently, I'm writing a bat file to install Oracle 11g client for windows, I know the command line should be below, but how to find the error code it return? like the command line I want to run in Windows, the errorlevel will return 0 if the command line is pass, otherwise it will return no-zero:
    oui.exe -silent -waitforcompletion -nowait -force -responseFile ...\response\clientruntime.rsp
    BTW, I know I can find the error info under the path ...\Oracle\Inventory\logs, but I think it is better if you can tell me another way to catch the error in command line. I just wish that I can determine whether the Oracle provider installation is pass......
    Thanks
    Lindsay
    Edited by: lindsaywang on Oct 6, 2008 1:28 PM

    I got it.
    Thanks,
    TD

  • How long is it to implement JSSE on a client-server architecture?

    Hi all of you,
    Since I'm not a developper but more a system admin, I'm wondering how long approximatly it would take to adapt an existing JAVA client-server architecture to use JSSE or SSL communication over the internet. Is it a simple task or are we talking about weeks of work? Where would be installed the SSL certificate, on the web server or the database server? In brief, what are the main steps that a developper has to go through?
    Architecture:
    JAVA client
    Web server (RMI server), Microsoft IIS5.0
    Database server (MySQL4.0)
    Thanks you all for your precious time,
    AD

    If your webserver has a server certificate from one of the "Big Boys" in the CA business, and if you don't need client-authentication (and almost no-one does) - in your client, write "SSL" in front of everywhere the app currently has the word "Socket", and scratch out "HttpUrl" and replace it with HttpsUrl,." and change your access-urls to start with "https:" and change your socket-connections to talk to your server's SSL port, and you're done. I've taken a Socket-based app and made it SSL/Plain bilingual in two hours once (admittedly, it was a small and well-designed app).
    If your server-cert isn't signed by a known CA, then you have to play some games to get the client side to accept it - but they've all been discussed to death in this forum.
    Grant

  • How to resolve Conversion Error in Program saplswcd(swi1 tran) in ECC 6.0?

    Hi,
    I am working as an ABAP technical person.I am currently working on an upgrade project wherein the system is upgraded from R/3 4.6 C to ECC 6.0.
    Error Description
    Actually when I am trying to execute transaction SWI1 in ECC 6.0 , it shows certain work items.When double clicking on a particular work item Id, it gives a runtime error as:-
    Short text       
        Conversion from type "D" to "T" not supported.                                                                               
    What happened?     
        Error in the ABAP Application Program                                                                               
    The current ABAP program "SAPLSWCD" had to be terminated because it ha
        come across a statement that unfortunately cannot be executed.                                                                               
    Error analysis    
        The fields "ABAPFIELD" (type "D") and "<SWC_CONT>" (type "T")        
        cannot normally be transported to each other.                        
    Trigger Location of Runtime Error                                                                  
        Program                               SAPLSWCD                                               
        Include                                 LSWCDF00                                               
        Row                                     457                                                    
        Module type                          (FORM)                                                 
        Module Name                        MOVE_CONTAINER_TO_VALUE                                
    But the same short DUMP is not appearing in 4.6C, rather its showing all the details properly.
    I searched in for relevant notes in service marketplace for the same and found one 110656 for the same but that's meant for lower versions.
    I couldn't find any other note for the same and I am not even getting how to go about it.
    Please suggest sth asap since it's completion deadline is after a day.
    Thanks in Advance.
    Best Regards,
    Swati

    Hi,
    Are you sure you have raised this query in the correct forum?
    I dont think so. Please raise it in the appropriate forum to get valid responses.
    Regards,
    Gokul

  • How to detect data errors?

    In applications such as healthcare, errors in data stored in a database could lead to so called Adverse Events even death of a patient. Clearly, if erroneous data could be detected then the user could be warned not to trust what is displayed.
    So, what happens in practice? If hardware failure or flawed software were to cause occasional data errors in a Oracle Database, would such errors be detected by the database engine or is detection left to the application? For example, a single bit error relating to an index that is supposed to be unique or a field containing a code representing a patient's blood type. When would this violation of integrity be detected and how would such errors become evident? Is it credible that such errors could cause incorrect data to be returned from a query?
    Clearly CRC or hashing functions could be called using appropriate triggers to provide field or record level error detection.
    1. Is anyone doing this?
    2. What is the recomended approach ?
    3. What is the performance penalty likely to be?
    4. Is there any documentation that describes this ?
    Thanks,
    James

    Hi,
    you have two parameters called DB_BLOCK_CHECKSUM and DB_BLOCK_CHECKING, which calculate checksums by reading (DB_BLOCK_CHECKING) and writting (DB_BLOCK_CHECKSUM)
    Some storage vendors like Hitachi work closely with Oracle to provide additional protections against data corruption. Look for the Oracle H.A.R.D. initiative at http://otn.oracle.com/deploy/availability/htdocs/vendors_hard.html
    You will then find documentation on the storage vendor site as well.
    Regards
    Laurent Schneider
    OCM DBA

  • Create Procedure - How to Detect Compilation Errors

    Hi,
    I am working on an application where users will be able to type in their own stored procedures. I perform some basic parsing of the function spec, to make sure it is well-formed, but that's all the parsing I do. I assumed an SQLException would be thrown by the executeUpdate() call which creates the procedure if the procedure is malformed. This is not the case. executeUpdate() returns 0, whether or not the procedure was created with compilation errors.
    After they type it in, I would like to be able to tell the user whether or not their procedure is syntactically correct. Given that writing a complete PL/SQL parser in Java is obviously out of the question, how can I do this? There must be a way.
    Thanks in advance for any and all help,
    James

    Note that there is a USER_ERRORS table.
    You could DELETE FROM USER_ERRORS before issuing the procedure declaration and then SELECT ... FROM USER_ERRORS to see if errors have occured and if so to print them out.

  • How to detect CPU error in SMP system?

    I want to monitor if the CPU is working properly in real-time, especially at SMP system. My goal is to build a program that shows "CPU n is working properly" and if one is down, showing "CPU n down".
    Is there pre-defined C function I can use? Or is there better one?

    I think that kstat() does such a function, but for SMP system, how does it work? Is there a certain way to specify CPU?

  • How to show  an error Page in Weblogic when the server is down

    Hi ,
    I heard that every container has the facility to show an error page when the server is down and (when the request has arrived at that time ).
    Please tell me how to configure this in BEA weblogic ??
    Thanks .

    Hi,
    From my understanding weblogic dose not provide the thing which you are asking for, reason is given below.
    - An application is deployed only on managed server one (MS-1)
    - Now if the request comes to the server (MS-1) when it was running and then for some reason MS-1 goes down then weblogic server would be able to send any response back to the client as its down.
    - Hence nothing can be done as the request object is been lost when the server goes down or even cant redirect to an error page as for doing that too the server has to be up and running.
    However there are other way round which can help you overcome this issue as shown below
    - Use Clusters with few managed servers in it which gives you high availability and load-balancing.
    - Use any web servers like Apache in front of weblogic servers.
    Using the above things you can also use customized HTTP Error Responses with error-page element in web.xml and create your own error pages which can be re-directed for the web server side also. For more information go through the below links
    Topic: Customizing HTTP Error Responses
    http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webapp/configurejsp.html#wp157884
    Topic: error-page
    http://download.oracle.com/docs/cd/E13222_01/wls/docs81/webapp/web_xml.html#1017571
    Topic: ErrorPage
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/plugins/plugin_params.html#wp1155425
    Hope above information helps you.
    Regards,
    Ravish

  • Conversion Error During the Execution of SQL Server Job

    Hello,
    I have a production SQL server and a test SQL server that mimics the production server. On the production server all the jobs which do a variety of things using Transact SQL and SSIS packages work flawlessly. However one of the jobs on the test server fails
    at a step and issues the following error:
    executed as user: DomainName\administrator. Conversion failed when converting datetime from character string. [SQLSTATE 22007] (Error 241). 
    The step failed.
    Here is the code contained in the steps Command window (same exact code that works fine on the production server):
    declare @Now datetime
    declare @DB_Date datetime
    declare @Trip_Err datetime
    select @Now = convert(varchar,getdate(),101)
    select @DB_Date = (select convert(varchar,max(ProcessDate),101) from I_Loans)
    if @now <> @DB_Date
    begin
    truncate table I_Loans
    end
    else
    select @Trip_err = 'error'
    I don’t see anything preventing this code from executing. However, I am not a programmer. My SQL Server version is below:
    Microsoft SQL Server 2005 - 9.00.5324.00 (Intel X86)  
    Aug 24 2012 14:24:46   Copyright (c) 1988-2005 Microsoft Corporation 
    Standard Edition on Windows NT 6.0 (Build 6002: Service Pack 2)
    Any advice or solutions will be greatly appreciated. Please let me know if I need to provide more information.
    Thank you,
    Dave
    David Young

    Could you run this query from management studio in test?
    select convert(varchar,max(ProcessDate),101) from I_Loans
    It could be something to do with the ProcessDate value which had issues to convert
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • How to customize 404 error of Sun Java System Application Server Enterprise

    Hi,
    I want to customize the 404 error message in Sun Application Server Enterprise Edition8.2.
    If anyone knows the way, please help me out.
    Thanks
    Randhir

    Randhir,
    I think the documentation at the url below should help you out. If this isn't what you're looking for let me know and I'll try to dig deaper.
    http://docs.sun.com/app/docs/doc/819-4734/beagh?l=en&a=view
    Good Luck,
    John
    Edited by: m305653 on Jun 8, 2008 8:04 AM

  • URGENT!!!!!!!how can i open a url in forms (plataform client/server)

    I have a item that is a url and I want that when the user click
    in this item open the coresponding ulr.
    Can you help me?
    Thank you

    if you use win 32 and you have no information of which browser
    is a default one in your computer and where it is located.
    1.Attach D2KWUTIL.PLL library to your form <br>
    2.Try to use win_api_shell.startfile(document =>
    'c:\start_page.html'); <br>
    3.in start_page.html you automatic connect to the whatever site
    you want <br>
    regards,

  • Conversion error in Query

    Hi,
    i have an attribute customernumber mapped as Long. My developer now wants to do a query like "select * from xy where customernumber like '567%' ".
    Is it possible to do this with toplink?
    I get conversion errors due to toplink tries to convert 567% to a long value.
    builder.get("customernumber").like("567%")
    -Robert

    The mapping will always try to convert its value passed in to that of the mapped attribute.
    Probably the easiest way to address this is to add another direct query key for the field. If you added one in the mapping editor called customerNumberString to the same database field you could then use:
    builder.get("customerNumberString").like("567%")Doug

  • SAP B1iP detected an error: 500 -internal server error

    Hi expert,
    I have an error message when I add new network location with http://<server ip address>:8080/B1iXcellerator/exec/dummy.
    Error message is
    " The folder you entered does not appear to be valid. Please choose another"
    I have B18.8 PL15, B1iiSN 88 PL03 and windows 7 64 bits machine.
    Also I've got error message as below when I enterd http://<server ip address>:8080/B1iXcellerator/exec/dummy address to internet exploere.
    "SAP B1iP detected an error:
    Emitted HTTP-Code
    500 - Internal Server Error"
    I need to edit BizPackage and BIU docuemnts from xml editor.
    Thanks
    Joanne
    Edited by: Joanne Lee on Feb 15, 2011 10:46 PM
    Edited by: Joanne Lee on Feb 15, 2011 10:46 PM

    Hi,
    I also experiencing this error :
    when accessing : I'm using windows 7 profesional B1iSN 9.0, what's need to be configured ?
    http://127.0.0.1:8080/B1iXcellerator/exec/webdav/
    SAP B1iP detected an error:
    Emitted HTTP-Code:
    500 - Internal Server Error
    Internal Reason:
    while trying to invoke the method com.sap.b1i.bizprocessor.BizStoreURI.isUniqueURI() of an object loaded from local variable 'buri'
    Recommendation:
    Check for the correctness of your activity or environment or ask your system-administrator for further help.
    Full Internal Error Message:
    com.sap.b1i.xcellerator.XcelleratorException: XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: java.lang.NullPointerException: while trying to invoke the method com.sap.b1i.bizprocessor.BizStoreURI.isUniqueURI() of an object loaded from local variable 'buri'
    Log-ID:
    LID150209170906235005790AD33703754E

  • ORA-31202: DBMS_LDAP: LDAP client/server error: Invalid credentials

    Hey Guys,
    I have an application with LDAP authentication and a custom login page (pg 101). When I run this app, the login page displays first, logs me in and logs out fine. However, when I branch to this application from another application, the login page shows up with the following error:
    ORA-31202: DBMS_LDAP: LDAP client/server error: Invalid credentials
    Error ERR-1082 Error in executing authorization scheme code.
    I looked at debug and this is happening because when this page is loaded, it goes to my authentication scheme and tries to authenticate me even though I havnt logged in and because no user exists at this point the error happens.
    I have set the login page to 'Page is Public' and have also used the following code in the authentication scheme's Page Sentry Function:
    IF APEX_CUSTOM_AUTH.CURRENT_PAGE_IS_PUBLIC = TRUE THEN;
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    Any ideas of how I can stop my login page from being authenticated? Or where I am going wrong
    Thanks
    -Mark

    Jes,
    I could get it work !!!! my complete code
    DECLARE
    l_attributes wwv_flow_global.vc_arr2;
    l_attribute_values wwv_flow_global.vc_arr2;
    l_msg dbms_ldap.message;
    l_entry DBMS_LDAP.message;
    l_session DBMS_LDAP.session;
    l_ber_element DBMS_LDAP.ber_element;
    l_attr dbms_ldap.string_collection;
    l_attr_name VARCHAR2(256);
    l_vals DBMS_LDAP.string_collection;
    retval PLS_INTEGER;
    BEGIN
    l_session := DBMS_LDAP.init('server', '389');
    retval := DBMS_LDAP.simple_bind_s(l_session,'cn=myid,cn=na', 'mypwd');
    dbms_output.put_line('Retval -> ' || retval);
    l_attr(1) := '*'; -- retrieve all attributes
    retval := DBMS_LDAP.search_s(
    ld => l_session,
    base => 'ou=xx,o=xx',
    scope => DBMS_LDAP.SCOPE_SUBTREE,
    filter => 'uid=myid',
    attrs => l_attr,
    attronly => 0,
    res => l_msg);
    dbms_output.put_line('Retval 2 -> ' || retval);
    dbms_output.put_line('msg : ' || l_msg);
    IF DBMS_LDAP.count_entries(ld => l_session, msg => l_msg) > 0 THEN
    -- Get all the entries returned by our search.
    l_entry := DBMS_LDAP.first_entry(ld => l_session,
    msg => l_msg);
    << entry_loop >>
    WHILE l_entry IS NOT NULL LOOP
    -- Get all the attributes for this entry.
    DBMS_OUTPUT.PUT_LINE('---------------------------------------');
    l_attr_name := DBMS_LDAP.first_attribute(ld => l_session,
    ldapentry => l_entry,
    ber_elem => l_ber_element);
    << attributes_loop >>
    WHILE l_attr_name IS NOT NULL LOOP
    -- Get all the values for this attribute.
    l_vals := DBMS_LDAP.get_values (ld => l_session,
    ldapentry => l_entry,
    attr => l_attr_name);
    << values_loop >>
    FOR i IN l_vals.FIRST .. l_vals.LAST LOOP
    DBMS_OUTPUT.PUT_LINE('ATTIBUTE_NAME: ' || l_attr_name || ' = ' || SUBSTR(l_vals(i),1,200));
    END LOOP values_loop;
    l_attr_name := DBMS_LDAP.next_attribute(ld => l_session,
    ldapentry => l_entry,
    ber_elem => l_ber_element);
    END LOOP attibutes_loop;
    l_entry := DBMS_LDAP.next_entry(ld => l_session,
    msg => l_entry);
    END LOOP entry_loop;
    END IF;
    retval := DBMS_LDAP.unbind_s(l_session);
    END;
    thank you :D

Maybe you are looking for

  • HP Pavilion p7-1414 PC Internet Issues

    Wasn't sure where to put this.. Lately I have been experiencing an issue with the Internet on this computer. I am a gamer, so basically when I play games and browse the internet (Google Chrome) and every now and than Skype a friend. Whenever I do thi

  • Why do I get a prompt to create an iCloud account when I already have one?

    When I try to turn on notes so my iPhone and iPad will sync, I am prompted to create an account when I already have one. Why? How can I do this?

  • Cisco 6880-x vsl link failure

    Hi Guys, I have a head scratcher that I'm dealing with.  I have 2x (2 month) 6880-x switches configured with vss with 2 vsl links on each of its sup cards and switch 1 is the active switch on the vss.  Both 6880x chassis also have 2 additional 10g mo

  • Web pages aren't loading properly

    Since installing Mavericks Web pages aren't loading properly. Neither with safari nor chrome. I've added the Open DNS to the DNS pane but makes no difference. Many pages don't download images, and look like the CSS hasn't loaded either. Have emptied

  • Problems Selecting Items for Copy and Paste Acrobat 9

    Hi, I have a client who is using Acrobat 9. For some reason, he is no longer able to use the selection tool in any PDF's to copy out parts of his drawings. I've made sure the selection tools is active from the toolbar. Any help would be greatly appre