Null chars in strings with longer than 4000

Here's the situation:
I'm retrieving a large string (~10,000 characters) from a view
in oracle 8, using a VB app and an ODBC connecion. The string is
datatype long. When I get the string and analyze it in my
program, I find that ASCII 0 (null) has been inserted at
location 4000. I verified that the string was actually not
stored with this null in Oracle, so I figure the problem is
something with ADO or VB. Here is how I'm retrieving the
string...
'rs is my recordset
sString = rs("LONG_STRING")
Any thoughts on what the problem is here? Thanks.
--Frank                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

I found a solution that appears to work. I switched my DSN so
I'm using the "Mircosoft ODBC for Oracle" driver as opposed to
the "Oracle ODBC Driver". Now the LONG text fields are returned
as I expected.
--Frank                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Owa_text.vc_arr: can't handle the string with more than 4000 characters?

    In the Oracel Web Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer.
    I amusing PL_SQL with Oracle8i and OWA4.0 web server.I want to
    use owa_text.vc_arr to pass the multple line texts in my form.
    If the text length is less than 4000 characters, everything works
    fine.However when the texts are longer than 4000 characters but
    less than the max length 32767 characters, I got this error
    message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define
    datatype.
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    Helena, I think you might get a better response either from the SQL-PL/SQL forum, or perhaps the Portal Applications forum - both of these tend to have folks very familiar with PL/SQL and the OWA packages.
    This forum is on Web services based on SOAP, WSDL and UDDI. These can be PL/SQL based but typically don't use the mod_psql or OWA web solution.
    As a pointer, I suspect you may already be familiar with, but just in case, you can always take a look at chapter 3 of the OAS documentation, "Developer's Guide: PL/SQL and ODBC Applications" where they go through a number of examples using parameters. See:
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql.pdf
    Hope this or folks from the other list can help.
    Mike.

  • Why can't  owa_text.vc_arr  handle the string with more than 4000 characters?

    I am using PL_SQL with Oracle8i and OAS 4.0 web server.I want to
    use owa_text.vc_arr to pass the inputs in serval text areas in the form on a web application.
    If the input string length is less than 4000 characters, everything works fine.However when the strings are longer than 4000 characters but less than the max length 32767 characters, I got this error message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define datatype.
    In the Oracle Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer. It means that owa_text.vc_arr can handle multiple strings and each string can have up to 32767 single byte characters, is it right?
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form on the web:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    The maximum size of a VARCHAR2 field in Oracle 8i is 4000 bytes.
    you'll ned to use a LOB type (or LONG if you prefer the old way)

  • PL/SQL process returning message with more than 4000 chars

    In our apex application we are using a pl/sql process returning a message.
    This message should be shown to the user.
    Our problem is now, that the application items in APEX seem to be limited to 4000 chars and the message can be longer.
    We are also not able to use a collection, because we can't print the content of a collection in the "Process Success Message".
    Here is the content of a page process which is running on page load after header:
    Name - Type:     PL/SQL anonymous block
    Source - Process: :AI_TEST := p0001_pkg.get_text;
    Messages - Process Success Message: &AI_TEST.
    Image from process [https://twitter.com/OliverLemm/status/324058809138032640/photo/1/large]
    If the page is called the result is this error message:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Technical Info (only visible for developers)
    is_internal_error: false
    ora_sqlcode: -6502
    ora_sqlerrm: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    component.type: APEX_APPLICATION_PAGE_PROCESS
    component.id: 16433072916569237418
    component.name: get_text
    error_backtrace:
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 100
    ORA-06512: at "APEX_040200.WWV_FLOW_PROCESS", line 141
    Edited by: Oliver L on 16.04.2013 09:17

    no an item like P0_TEST on page 0 / global page also does not help.
    But the error is not the application item / page item it's the problem that the "Process Success Message" can't handle more than 4000 chars.
    I tried to paste a string into the process success message, but the error "Error processing row. ORA-01461: can bind a LONG value only for insert into a LONG column" occured even when i filled the textarea and saved the process.
    So there's no problem with the application item or page item.
    Edited by: Oliver L on 16.04.2013 10:00

  • Need to insert into a table 1 of the fields (CLOB)with more than 4000 chars

    Dear Gurus,
    As far I understood, I need to write a function which get as parameter the large text and using bind variables I can return a CLOB containing more than 4000 chars. I tried all I can do and feel I want to died. Please, can I get specified help in this issue?
    I APPRICIATE YOUR HELP, MARCELO.

    *** Duplicate Post ***
    Please, Marcelo, use the forum properly. Pick a single group and post there.
    Thank you.

  • Parameter longer than 4000 characters

    The java layer calls a EXEC_DDL stored proc that does a EXECUTE IMMEDIATE on the VARCHAR2 parameter string passed in. SInce the java layer is passing more than 4000 characters DDL statement we get an error about cannot bind long ..... What datatype should I use as a parameter instead of VARCHAR2 inside the EXEC_DDL stored proc. Steven Feuerstein advises against using LONG in his PL/SQL book. All the LOB types are for objects either INSIDE or OUTSIDE of the database but I just want the java code to be able to pass a DDL string greater than 4000 chars. I want to use the simplest approach.
    Thanks in anticipation

    a SUBSTR or a DBMS_LOB.SUBSTR works. This is the final working version of the EXEC_DDL proc. We used the DBMS_LOB package in case we needed to overload with other types of LOB parameters.
    procedure exec_ddl (
    pi_ddl_string IN CLOB
    ,po_status OUT PLS_INTEGER
    AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    -- AUTHID CURRENT_USER will be added after exception handling is packaged
    v_clob_buff VARCHAR2(500);
    BEGIN -- outer block
    EXECUTE IMMEDIATE pi_ddl_string;
    po_status := PKG_SNAPIT.pk_success;
    EXCEPTION
    WHEN OTHERS THEN
    v_clob_buff := DBMS_LOB.SUBSTR(pi_ddl_string,500,1);
    insert into exception_log values(sysdate,'COMPILE ERROR IN : ' || v_clob_buff,'pkg_dynamic_sql'
    ,'exec_ddl');
    COMMIT;
    pkg_snapit.Log_Errors ( 'Error_Stack...' || Chr(10) || DBMS_UTILITY.FORMAT_ERROR_STACK() );
    pkg_snapit.Log_Errors ( 'Error_Backtrace...' || Chr(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE() );
    po_status := SQLCODE;
    RAISE;
    END exec_ddl;
    Edited by: user4900730 on Mar 11, 2010 2:00 PM

  • Cannot create graph with more than 4000 rows or colume

    need some help.
    im trying to plot a graph using the report generation toolkit and i got this error and it say it cannot contain more than 4000 rows or columns
    is it that there is a limit? if there is, how can i increase?
    im trying to plot a graph using my data from excel which has over 10000 rows of data

    I use this VI to read excel and to write a graph report.
    in my excel, which i have attached, there's all data with about 11000 row.
    i want to use it to plot a graph and i kinda stuck at here where there is this limit of 4000 row? and i can't seem to get the header i have link in the block diagram to the graph either.
    Attachments:
    excel.xls ‏837 KB
    Read_excel_G_word_report.vi ‏34 KB

  • Column with more than 4000 characters

    Hi,
    Version: 10.2.0.4.0
    I have a requirement to display more than 4000 characters (clob, long data type) through sql.
    Though this can be achieved through pl/sql, I am not able to get the output in sql statements. Is it possible to get this done through sql?
    I can use intermediate pl/sql processing if needed.
    Thanks for your help.

    Preta wrote:
    Though this can be achieved through pl/sql, I am not able to get the output in sql statements. Is it possible to get this done through sql?Yes, what did you try? - Hopefully not LONG
    SQL> drop table t purge;
    Table dropped.
    SQL> create table t (c clob);
    Table created.
    SQL> insert into t values (rpad(to_clob('x'),4001, 'x'));
    1 row created.
    SQL> set long 5000
    SQL> set pages 100
    SQL> select c from t;
    C
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    x
    SQL>Regards
    Peter

  • Plotting of graph with more than 4000 data points in Excel

    Hi All,
    I am fairly new to labview world. I am trying to plot out line graphs of the results from my program into Excel worksheet. I have huge set of data points(10000) stored in each of 10 different worksheets in MS Excel workbook. I am trying to compile results into last sheet as graphical representation of all the various dataset into 10 different graphs.
    My problem is that I am getting error because MS Graph does not allow me to plot more than 4000 rows or datapoints. Is there better and cleaner way of programming this? Or if some one can provide an example of how to handle such case. I'll appreciate any help.
    My goal is to able to plot one set of data 1st then I will be able to run through various worksheets to compile into standalone results.
     ERROR MESSAGE: "Report Generation Toolkit: Graphs you create or edit in Microsoft Graph cannot contain more than 4,000 rows or columns, including row and column headers. "
    Also for example if we run Line Graph example and change the # of data points from 100 to 4000, we get same message.
    Error -41114 occurred at NI_ReportGenerationToolkit.lvlib:Excel_Insert_Chart.vi -> NI_Excel.lvclass:Excel Insert Graph.vi -> Line Graph (Excel).vi
    Thanks,
    Saurabh

    Hi Dennis,
    I am collecting waveform data from oscilloscope using labview in both data & graph format. So my program collects data for a particular operating condition & then saves the data on a worksheet. After it loads new operating condition & goes over same cycle. I have to save all the data points in excel for different use cases, which I am saving in different worksheet for each specific operating condition.
    Since I already have data saved in excel at the end of test, I am trying plot each use case in the same report for study & presentaion after tests are finished. I have not been able to do so. I read the post which you have mentioned, seems like newer excel or labview version have same issue. I am using LV 9.0
    I will try using decimation but if you have any better way of handling this problem, I'll appreciate if you can share that.
    Thanks for your help.

  • ORA-01460 at REPLACE for strings longer than 4000 characters

    the following code works fine for vVar_Value less than 4001 characters but raises an ORA-01460 for strings equal to or larger than 4001 characters in my environments.
    declare
    vVar_Value VARCHAR2(32000) := '';
    begin
    for i in 1..4000 loop
    vVar_Value := vVar_Value||'X';
    end loop;
    dbms_output.Put_Line('length(vVar_Value): '||length(vVar_Value));
    SELECT REPLACE( vVar_Value, 'NO_MIDDLE_NAME', '') INTO vVar_Value FROM DUAL;
    exception
    when others then
    raise;
    end;
    any advice would be most apprectiated.
    thanks in advance.

    Why the heck are you using select from dual?
    Just use vVar_Value := REPLACE( vVar_Value, 'NO_MIDDLE_NAME', ''); and everything will be OK
    in SQL limit for varchar2 is 4K, only in PL/SQL you can use 32K
    Gints Plivna
    http://www.gplivna.eu

  • Null Exception when XSL Files longer than 8192 char

    javax.servlet.jsp.JspException: Error applying stylesheet stylesheets/Sds.xsl 8192
    This is the error message obtained where transforming applying an XSL sheet longuer then 8K !
    How can we use XSL files > 8k ??
    Context:
    Oracle9iAS (9.0.3.0.0) Containers for J2EE
    Source code for JSP:
    <%@ taglib uri="/WEB-INF/jml.tld" prefix="jml" %>
    <jml:transform href="stylesheets/Sds.xsl">
    </jml:transform>

    Thanks Francois. Here is the part of the code used:
              pl := create_parameter_list('REC');
              add_parameter(pl, 'P_COUS', text_parameter, rtrim                    (:content.TLAST_NAME||', '||:content.TFIRST_NAME, ', '));
         new_form('C_DETAILS', no_rollback, no_query_only, pl);
    It works with:
    MAIN STREET RESTAURANT & PUB
    but
    SOUTH MAIN STREET RESTAURANT & PUB
    I set the corresponding parameter, PARAMETER.P_COUS length to char 100.
    Thank you again.
    Jimmy
    Message was edited by:
    Jimmy

  • ORA-01704:String literal too long with update of more than 4000 chars

    Hi,
    I want to update a table column in Oracle Database(version 10) with more than 4000 chars.
    The datatype of the table column is NCLOB.
    I want to achieve this with one single line of update query as below,
    update mytable set MY_DESCRIPTION = 'longdesc' where ID = '111' ;
    But there's a problem, if the 'longdesc' is more than 4000 chars, it gives the error , "ORA-01704:String literal too long"
    How can I achieve this in sql developer ?
    I dont want to do this using stored procedures, I want to do this update using only sql statement.
    Please help.
    thanks,
    sudhakar

    Hello Sudhakar,
    I am afraid, this will never work by SQL.
    Just because an SQL-Statement must not contain a string literal over 4,000 characters (or did that change lately?).
    Maybe you can bypass the limit with PL/SQL ... but you will certainly run into the 32K limit sooner or later
    regards
    Peter

  • Insert more than 4000 characters using sql plus

    I have a SQL script that creates a database. The problem is that some of the fields are longer than 4000 characters in the INSERT statement and Oracle doesn't seem to like it.
    The field is a clob and works fine in the application (i.e. I can insert more than 4000 characters using the app) - how do I achieve this in a SQL script?
    Any help is much appreciated.
    Cheers,
    Steve

    Hi,
    This pl/sql block works absolutely fine in SQL*Plus inserting > 4000 characters into clob column:
    declare
    l_str varchar2(8000);
    l_str1 varchar2(2400) := 'first part of the verly long string...';
    l_str2 varchar2(2400) := 'second part of the verly long string...';
    begin
    l_str := l_str1 || l_str2;
    insert into tmpl values (l_str);
    end;
    So, you'll have to replace inserts with pl/sql blocks in your script.
    Tested in Oracle 8.1.7.0.0
    Regards,
    Andrew Velitchko
    BrainBench MVP for Developer/2000
    http://www.brainbench.com

  • Writing to db more than 4000 characters

    Hi, i want to store a text with more than 4000 characters in an oracle database.
    i can't use varchar2(4000)
    what should i use?
    blob?
    clob?

    there is some kind of a problem here
    a want to store a text with 29212 characters, but there is an error message saying, data size is greater than the maximum value of this type...
    this is an sqlexception

  • Execute immediate with a string longer than 32767

    hello,
    is there a possibility to make an execute immediate with a statement, that is longer than the 32767 max. bytes for varchar`s? We get in a CLOB SQL-Statements with data that are longer than 32767. It would be easy if it were possible to make an execute immediate but because of the length limit it seems impossible. Does anybody know an alternative way to execute the sql-statements in the CLOB-Column?
    Anna

    6 execute immediate to_char(sql_text) into var_num;As a matter of interest have you tried this with a CLOB that is bigger than 32K?
    When I try it the PL/SQL limit gets enforced:
    SQL> declare
      2    c clob;
      3  begin
      4    dbms_lob.createtemporary(c, true);
      5    dbms_lob.writeappend(c, 43, 'CREATE OR REPLACE PROCEDURE big_p AS BEGIN ');
      6    for i in 1..800 loop
      7       dbms_lob.writeappend(c, 6, 'null;'||chr(10));
      8    end loop;
      9    dbms_lob.writeappend(c, 4, 'END;');
    10    execute immediate  to_char(c);
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL>  declare
      2    c clob;
      3  begin
      4    dbms_lob.createtemporary(c, true);
      5    dbms_lob.writeappend(c, 43, 'CREATE OR REPLACE PROCEDURE big_p AS BEGIN ');
      6    for i in 1..8000 loop
      7       dbms_lob.writeappend(c, 6, 'null;'||chr(10));
      8    end loop;
      9    dbms_lob.writeappend(c, 4, 'END;');
    10    execute immediate  to_char(c);
    11  end;
    12  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 10
    SQL> Cheers, APC

Maybe you are looking for

  • Will I be able to use my Netgear N 3300router and 111accesspoints wireless units with fios service?

    I am having my Fios bundle (tv,internet, phone) installed next week. In reading some posts here I am concerned. Currently I am using Comcast internet router plugged into my main wireless N Netgear model 3300 router that is plugged into my PC. I then

  • How to get virtual window in macbook air

    i have purchased macbook sir 6 days back . i am finding it difficult to work on macbook . Mostly i need to use ms office and another designing softwares like adobe photoshop and adobe flash etc . Please tell me the procedure of creating a virtual win

  • Can we move SAP standard Function Group and Table defintion to BW

    Dear Forum, We are in a ‘pilot’ process of migrating SAP R/3 Custom development objects to our BW client and we have a few questions that we would like to know if possible. We are currently in the ‘To Be’ Blueprint Phase of migrating SAP 45B to ERP20

  • HTML LINK on documentation in a Specific Program in se38

    Hello all, I have a problem for create an HTML link in a documentation of my specific program in se38. For do my documentation of my specific program i go se38>select documentation and do modify. I wan't to know how can i do for make a HTML Link for

  • Extension of Internet Sales R/3

    Hi Experts,      Currently we are implementing E-commerce 5.0, Internet Sales R/3. If we want to modify or extend the ISA application (Like changing logo, Text, Welcome message), should we do it on the original B2B/B2C application? Or we should creat