想请教大家一个问题,我写了一个PL/SQL程序,有一个过程传参数是用varchar2型,但是varchar2是我有长度限制的,如果我的varchar2超过长度了怎么办?我有什么办法传这个很长的字符串吗? 
程序已经写好了,要改程序好像要改的地方比较多,很多调用的接口都要改,所不想改.我想先看看能不能找一种方法来解决这个问题 

解决方案 »

  1.   

    use string ,max length is 32767
      

  2.   

    You use the VARCHAR2 datatype to store variable-length character data. How the
    data is represented internally depends on the database character set. The VARCHAR2
    datatype takes a required parameter that specifies a maximum size up to 32767
    bytes.使用 CLOB 试试
    You use the CLOB datatype to store large blocks of character data in the database,
    in-line or out-of-line. Both fixed-width and variable-width character sets are
    supported. Every CLOB variable stores a locator, which points to a large block of
    character data. The size of a CLOB cannot exceed four gigabytes.
      

  3.   

    varchar2类型做变量可以存32767字符,做字段可以4000字符.
      

  4.   

    在pl/sql中最好宣告 32760. 我遇到這种情況時, 將資料分段存放在數組或多個欄位或多個變數中, 在使用時再合並起來. 這樣作雖然比較麻煩, 但也可以解決問題. 你也可以試試.