How can I make Function return varchar2 more than 4000

I have a function
FUNCTION testing (v_pk_application in number, v_inccharges in char)
return varchar2(30000)
--return number
is
v_net_sum varchar2(30000);
v_net_sum2 varchar2(30000);
v_datarow varchar2(3000);
v_datarow2 varchar2(3000);
begin
return v_net_sum;
end;
I want to return varchar2 more than 4000, how can I do that.
Thanks

user10659388 wrote:
I want to return varchar2 more than 4000, how can I do that.A function can return a string up to the maximum allowed for varchar2.
Varchar2 can be up to 32767 characters...
SQL> create or replace function ret_str return varchar2 is
  2    v_str varchar2(32767);
  3  begin
  4    v_str := lpad('*',32767,'*');
  5    return v_str;
  6  end;
  7  /
Function created.
SQL> declare
  2    v_retstr varchar2(32767);
  3  begin
  4    v_retstr := ret_str();
  5  end;
  6  /
PL/SQL procedure successfully completed.However, SQL only supports varchar2 up to 4000 characters so the same function will cause SQL to error, even though the function is perfectly valid.
SQL> select ret_str() from dual;
select ret_str() from dual
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SCOTT.RET_STR", line 5
SQL>So, if you intend to use the function only in PL/SQL then you can use varchar2 up to 32767 characters, but if you intend to use it in SQL then you will be limited to returning 4000 characters. Alternatively you can return a CLOB which SQL supports but they are a little more tricky to work with than varchar2...
SQL> ed
Wrote file afiedt.buf
  1  create or replace function ret_str return clob is
  2    v_str clob;
  3  begin
  4    v_str := lpad('*',32767,'*');
  5    return v_str;
  6* end;
SQL> /
Function created.
SQL> select ret_str() from dual;
RET_STR()
SQL>

Similar Messages

  • How can i make my printer print more than one page

    HP Officejet Pro 8600

    Need more info on what you're trying to do to help you...explain what you're trying to print and how you are trying to print it. 
    I am an HP employee.

  • How can we make function calls to sap in odi ?

    how can we make function calls to sap in odi ?
    to populate a column i need to make a function call which returns the value.

    There are two ODI SAP adapters available that allows extraction from SAP ERP and SAP BW. For SAP ERP we allow extraction from ERP tables, but not from RFCs/BAPIs.
    You can find details on them at
    http://www.oracle.com/technetwork/middleware/data-integrator/overview/odigs-sapabap-168070.pdf
    http://www.oracle.com/technetwork/middleware/data-integrator/overview/odigs-sapabapbw-168071.pdf

  • IOS obviously allows only 10 Apps to be Chosen in The "Open in" function. How can I control which Apps ( if more than 10 are installed) can be selected?

    iOS obviously allows only 10 Apps to be Chosen in The "Open in" function. How can I control which Apps ( if more than 10 are installed) can be selected?

    I think that is influenced by the order in which the apps are installed on the iPad (I believe that it's the most recent 10 ?) - but as I haven't got more than 10 apps that support any document/file type I can't check.
    If you want to able to edit the list, then you could try leaving feedback for Apple : http://www.apple.com/feedback/ipad.html

  • How can I enter my podcast in more than one category?  Mine covers arts, education and society and culture, but is listed as "Performing Arts".  Thank you for your time!

    How can I enter my podcast in more than one category, to reflect the fact that it covers arts, education and society and culture?  Thank you for your time!

    You can have more than one category - this page shows you how the tags are formed:
    http://www.apple.com/itunes/podcasts/specs.html#category
    The Store will list only the first category and its sub-category at the top of the page. Like the first category, the others will in theory make your podcast available for searching by category. However searching just on the category in the iTunes Store is most unlikely to throw up your podcast. There are thousands of podcasts out there, and it would be quite impossible to display on one page the entire list for any category. What you see are 'featured' podcasts, chosen by Apple as being special; please see this Tech Note:
    http://www.apple.com/itunes/podcasts/specs.html#getfeatured
    Note that there is no way you can influence the selection other than making your podcast really special.
    If you have further questions about making your podcast it's better to ask them in the Producing Podcasts forum.

  • How can i use my iphone with more than one itunes

    how can i use my iphone with more than one itunes

    Sync iPod/iPad/iPhone with two computers
    Although it isn't possible to sync an Apple device with two different libraries it is possible to sync with the same logical library from multiple computers. Each library has an internal ID and when iTunes connects to your iPod/iPad/iPhone it compares the local ID with the one the device normally syncs with. If they are the same you can go ahead and sync...
    I have my library cloned to a small 1Tb USB drive which I can take between home & work. At either location I use SyncToy 2.1 to update the local copy with the external drive. Mac users should be able to find similar tools. I can open either of the local libraries or the one on the external drive and update the media content of my iPhone. The slight exception is Photos which normally connects to a specific folder on a specific machine, although that can easily be remapped to the current library if you create a "Photos" folder inside the iTunes Media folder so that syncing the iTunes folders keeps this up to date as well. I periodically sweep my library for new files & orphans with iTunes Folder Watch just in case I make changes at one location but then overwrite the library with a newer copy from the other. Again Mac users should be able to find similar tools.
    As long as your media is organised within an iTunes Music or Tunes Media folder, in turn held inside the main iTunes folder that has your library files (whether or not you let iTunes keep the media folder organised) each library can access items at the same relative path from the library folder so the library can be at different drives/paths on different machines. This solution ensures I always have adequate backups of my library and I can update my devices whenever I can connect to the same build of iTunes.
    When working with an iPhone earlier builds of iTunes would remove any file not physically present in the local library, even if there was an entry for it, making manual management practically redundant on the iPhone. This behaviour has been changed but it will still only permit manual management with a library that has the correct internal ID. If you don't want to sync your library between machines on a regular basis just copy the iTunes Library.itl file from the current "home" machine to any other you want to use, then clean out the library entries and import the local content you have on that box.
    tt2

  • Do u guys know how can i dim my pc even more than original setings???

    do u guys know how can i dim my pc even more than original setings???

    Go to System Preferences > Displays and slide the brightness settings to something you like.
    PS - it does not help to post more than once; makes things too confusing.

  • How can i use Itunes to update more than one IPad with more than one owner

    How can i use Itunes to update more than one IPad with more than one owner?  I own an IPad and my wife owns an IPad.  I want to use my system to update both IPads.  We have different Apple Accounts and different applications.  Is this possible?

    Of course, that is too easy.  I am such a bonehead.

  • How can I change all of (or more than one) speaker note to a voice at once?

    Hello... 
       I have a lot of speaker notes that I need to apply a specific voice to.  How do I apply the same voice to all of the speaker notes in the whole project at once?  Or at least more than one?  Any help would be appreciated.  Thank you!   I am working with Captivate 6.

    Hi Vikram,
      Thanks. That tip definitely helps!  You just have to be careful when you use the CNTRL button and not highlight the name of the slide as you try to highlight the voices.  If you do that, then the drop down box becomes “unclickable”.  Unfortunately, when using the control button, it is sometimes impossible not to highlight the name of the slide as well.
    Ryan
    Von: VikramGaur [email protected]
    Gesendet: Donnerstag, 20. September 2012 16:25
    An: Scharfer, Ryan
    Betreff: How can I change all of (or more than one) speaker note to a voice at once?
    Re: How can I change all of (or more than one) speaker note to a voice at once?
    created by VikramGaur<http://forums.adobe.com/people/VikramGaur> in Adobe Captivate - View the full discussion<http://forums.adobe.com/message/4713463#4713463

  • How can I sort a table using more than one column in Numbers or in Pages?

    How can I sort a table using more than one column in Numbers or in Pages?

    Hi Ron,
    On the right side of the Toolbar click the Sort and Filter button, then select Sort.
    You can then set up a multiple column sort.
    Click Add A Column, Specify the sort for that column, Repeat.
    Jerry

  • How can a file be accessed by more than one app?

    Hi,
    I am new to iOS4 and the whole iPhone, iPod technology. I am really a windows user.
    How can a file be accessed by more than one app. In my case I want to transfer a midi file from my PC to my iPod Touch and be able to open it from a couple of Midi Players which I am evaluating - or does each Midi Player have to import the file seperately for its own use?
    Thanks,
    Sam

    It seems to me that what you want is exactly a session bean will do. The EJB container is responsible to maintain a certain number instances (configurable) of your session bean and serve multiple clients at the same time. Session beans are not necessarily destroyed after serving a client. If you configure your ejb server to have a pool size of 2 to 100, then you will always have at least 2 instances (no more than 100 even there are a lot of client access) of this ejb ready to serve. The only thing not clear to me is that do you want to use only ONE instance of this bean or you don't care as long as multiple clients can access this bean's service? Since you mentioned that there is not a real database access, you can certainly use a Singleton but a 'regular' session bean with static fields should do it also if these fields will not be modified by clients.
    PC

  • Can you make a movie for more than 2 minutes on an ipad and save it on a flash drive

    Can you make a movie for more than two minutes on the ipad and sve it on a flash drive using windows XP

    Using Apple's camera connection kit, you can use a flash drive to IMPORT photos and videos. However, you can't EXPORT any type of file to the flash drive.
     Cheers, Tom

  • How can I bought photoshop cc with more than 2 licenses

    how can I bought photoshop cc with more than 2 licenses

    Hi mercamas01,
    You may opt for Creative Cloud for teams which will allow you to purchase more than 2 licences.
    Please check this link: Creative Cloud pricing and membership plans | Adobe Creative Cloud (Business plan)
    Also, please refer to: Cloud technology | Adobe Creative Cloud for small & medium business
    Regards,
    Sheena

  • How can i pass function return values in to varray

    Hi
    create procedure name(parameters list)
    here ---i am calling a function
    varname := function name
    returns 4 values
    My doudt is how can i pass these return values in to varray..
    Type varray vname[5] date type
    Begin
    statements
    end prodedure name;
    pls clarify me its urgent

    This may give u a start
    sql>
    create or replace package test_array_pack as
    type ar1 is varray(10) of number;
    end;
    Package created.
    sql>
    create or replace function test_array return test_array_pack.ar1 is
      v_ar1 test_array_pack.ar1;
    begin
    v_ar1 := test_array_pack.ar1(1,2,3,4);
    return v_ar1;
    end;
    Function created.
    sql>
    declare
    v_ar2 test_array_pack.ar1;
    begin
    v_ar2 := test_array;
    end;
    PL/SQL procedure successfully completed
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How can I make my Apple TV more reliable? It takes a day to download a HD movie on a T1 to play later, but when I try to play the movies, Apple TV can't, and says try again later. Doesn't the day download time put the HD movie on the Apple TV device?

    How can I make my Apple TV work? I downloaded two movies, to play later, on April 4, 2014. I tried to watch them this evening only to get a message they are not available and to try later. How long can it take Apple to download the movies? I encourage anyone thinking about buying an Apple TV to get a different media player that is reliable. Apple TV is not worth the money, nor the time it takes to download movies, nor the effort trying to get your money back when Apple TV fails,and it failsl oftern.. Apple never seems to have a problem charging for the movies, but it frequently has a provlem delivering what people pay for.

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Reset the Apple TV (Settings > General > Reset > Reset all settings)
    Restore the Apple TV (Settings > General > Reset > Restore)

Maybe you are looking for

  • Keyboard and trackpad stop responding briefly

    I have a late 2012 (current generation) MacBook Air with all software up to date. Every so often (sometimes multiple times per day, sometimes not at all) my keyboard and trackpad will stop responding to input for 1-10 seconds. This has been happening

  • Error while installing oracle 10g grid on windows

    hi all, when i am installing oracle 10g grid i got the error that "Configuration assistant "OMS Configuration" failed " when i saw the log it has been mentioned the failed to create repos user. this is the out put of the log [14-02-2008 11:51:55] Ent

  • SQL Loader: How to load binary files

    Hi All, I need to load a binary file into the database (BLOB) using SQL Loader. What I have are only two files. The first file is an attributes file that contains the file names, the file sizes, the file descriptions, etc. The second file is a binary

  • Why do Graphics Disappear in Live View with CS5.5

    I just upgraded to CS5.5 from MX2004. I am running win7 pro. When "Live View" is selected, the graphics disappear and are replaced by placeholders. What is happening? Thank you JAL

  • La imagen se ve gris

    Hola, he comprado un par de películas en Itunes pero al reproducir se ve gris y sin audio. Podrían decirme a que se debe?