Help in production environment ASAP please

Hello,
I'm in a middle of a problem right now on our production environment.
I need to read and compare the information inside a long datatype column.
To do this I use the following function to read the long field:
create or replace function getlong_vw( p_tname in varchar2,
p_cname in varchar2,
p_cname2 in varchar2) return varchar2
as
l_cursor integer default dbms_sql.open_cursor;
l_n number;
l_long_val varchar2(32767);
l_long_len number;
l_buflen number := 4000;
l_curpos number := 0;
l_pos_start number := 1;
counter integer := 0;
l_long_txt varchar2(32767);
begin
dbms_sql.parse( l_cursor,
'select ' || p_cname || ' from ' || p_tname ||
' where view_name = :x',
dbms_sql.native );
dbms_sql.bind_variable( l_cursor, ':x', p_cname2 );
dbms_sql.define_column_long(l_cursor, 1);
l_n := dbms_sql.execute(l_cursor);
if (dbms_sql.fetch_rows(l_cursor)>0)
then
dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,
l_long_val, l_long_len );
end if;
dbms_sql.close_cursor(l_cursor);
return l_long_val;
end getlong;
But with this, I can only read the first 4000 bytes inside the long field.
What I need, is read more then that, eventually until the 32Kb limit.
So I try to use a while loop before the column_value_long and put the data inside a 32Kb varchar2 variable and return in the end
Something like :
if (dbms_sql.fetch_rows(l_cursor)>0)
then
while l_pos_start <= 32767 loop
dbms_sql.column_value_long(l_cursor, l_pos_start, l_buflen, 0 ,
l_long_val, l_long_len );
l_pos_start := l_pos_start+l_buflen;
l_long_txt := l_long_txt||l_long_val;
end loop;
end if;
dbms_sql.close_cursor(l_cursor);
return l_long_txt;
end getlong;
But I keep getting the error ORA-01007: variable not in select list
Can anyone help me, what I'm doing wrong?
How can I return the value inside a long field until the 32Kb and not only the first 4000 bytes?
Thank you very much in advance
Rui

Sorry guys,
Keith is right, I mess up the code when I made the copy paste.
This is the current function code:
CREATE OR REPLACE FUNCTION Getlong
(p_tname IN VARCHAR2,
p_cname IN VARCHAR2,
p_rowid IN ROWID)
RETURN VARCHAR2
AS
l_cursor INTEGER DEFAULT dbms_sql.open_cursor;
l_n NUMBER;
l_long_val VARCHAR2(32767);
l_long_len NUMBER;
l_buflen NUMBER := 4000;
l_curpos NUMBER := 0;
l_pos_start NUMBER := 1;
counter INTEGER := 0;
l_long_txt VARCHAR2(32767);
BEGIN
dbms_sql.Parse(l_cursor,'select '
||p_cname
||' from '
||p_tname
||' where rowid = :x',dbms_sql.native);
dbms_sql.Bind_variable(l_cursor,':x',p_rowid);
dbms_sql.Define_column_long(l_cursor,1);
l_n := dbms_sql.Execute(l_cursor);
IF (dbms_sql.Fetch_rows(l_cursor) &gt; 0) THEN
WHILE l_pos_start &lt;= 32767 LOOP
dbms_sql.Column_value_long(l_cursor,l_pos_start,l_buflen,0,l_long_val,
l_long_len);
l_pos_start := l_pos_start + l_buflen;
l_long_txt := l_long_txt
||l_long_val;
END LOOP;
END IF;
dbms_sql.Close_cursor(l_cursor);
RETURN l_long_txt;
END getlong;
If I have the while loop function comment, the function works well and return the first 4000 charaters of the long field.
If I try to use the while to get more characters I get the ORA-01007: variable not in select list
What I'm doing wrong?
Thank You
Edited by: user1242475 on 27/Fev/2009 17:40
Edited by: user1242475 on 27/Fev/2009 17:41

Similar Messages

  • I need help fixing kernel panic asap please help

    i need help fixing kernel panic asap please help

    OS X- About kernel panics
    Mac OS X- How to log a kernel panic
    Post a copy of your most recent complete panic log.

  • Help with product category assignment please

    Hi experts,
    I need to do a modificacion in my R3 downloaded products to CRM. Because a
    product catalog fulfitment, I need to modify the assigned product hierarchy
    in CRM but I don't know where can I do it this mapping between an R3 product
    hierarchy and CRM product hierarchy.
    I explain, if product A belongs in R3 to product category A, I need to modify
    this assignment in CRM, for exmaple, product A in CRM will belong to product category
    B.
    Modifications/creations on product master are only downloaded to CRM, never upload
    from CRM to R3.
    Any help in this issue please? Is possible to get a behaviour like this?
    Thanks to all.
    Javier

    Hi Javier,
       You can always do a RFC data upload of the changed product from CRM to R/3. I guess you do know how to trigger a OLTP data transfer in product master maintenance transaction COMMPR01.
    Thanks,
    Sudipta.

  • Need help with boot camp asap, please.

    Hi, I accidently installed windows 7 without copying 3.0 boot camp files and the disk is not with me it's like in another country. Is there a way to download boot camp 3.0? cause currently I cannot go back to OS stuck on Windows. What should I do? all my stuff is on OS..help would be great, please.

    You can not download the BC 3.0 drivers, they are only available from the disk.
    Reboot and hold the option key down, select OSX and Read The Boot Camp Directions before you break something!

  • Connecting from linux to linux-help me on thjis asap please

    Hi all,
    I want to know how we conect linux machine from another linux machine remotely(This is basically for connecting home to office computer).In windows i used putty and used the following steps to connect it.But how do i do it in linux please advise with steps.
    steps to connect from windows:
    Steps to create VPN connection
    1) go to mynetowrks , click on view connection, click on Create connection
    2) select Connect to network (using VPN) click on next
    3) select VPN connection click next
    4) Give ip address 61.85.76.56 and open putty and i give my system ip 26.0.0.45 and
    i can just give username and password and started working remotely.Please advise how to do the same in linux.Thanks in advance.

    I did a google search for putty and found that putty is an ssh client.  The Arch ssh program is openssh.  Once you have it installed, do a
    man ssh
    and search for 'virtual' or 'vpn'.  Follow the examples there.

  • How to download run time ABAP dump in production environment

    Hello,
    I am getting run time ABAP dump in production environment. Please guide me onHow to download run time ABAP dump in production environment?
    Also, please tell me how best can analyze that dump. Like there are tools like gdb, purify etc. to analyze problems in other languages.
    Regards,
    Sameer.

    Hi,
    Go to ST22, and Double click on the error line, It will show you the detailed analysis.
    See the section How to correct the error for details on error correction and the instructions to download the log( you can download in the format you want - HTML would be a nice option).
    And there are no tools to analyze errors but ST22 has a large data regarding the location of the error, the reason and the source code which caused. So you need to use the debugger to reproduce the error and check the source code,
    Regards
    Karthik D

  • ORACLE NOSQL INSTALLATION ON PRODUCTION ENVIRONMENT

    Hi ,
    I have already installed nosql in my test server using kvlite. My doubt is how to setup ORACLE NoSQL on production environment ?
    Please suggest .
    Thanks
    Edited by: 861012 on Sep 3, 2012 12:54 PM

    Hi Kamran,
    I am using doc - http://docs.oracle.com/cd/NOSQL/html/AdminGuide/Oracle-NoSQLDB-Admin.pdf
    Here on page-26 while "Create the Remainder of your Storage Nodes" i am getting following error -
    kv-> plan -execute -name "Deploy n02" deploy-sn 1 node02 5000
    Exception while executing command plan: Oracle NoSQL DB 11gR2.1.2.123 oracle.kv.impl.fault.OperationFaultException: Plan 9[Deploy n02] finished in state ERROR. Problem during plan execution: Exception creating connection to: node02; nested exception is:
    java.net.NoRouteToHostException: No route to host
    kv->
    I have already configure iptables to allow network traffic to port 5000. Still i am getting this error java.net.NoRouteToHostException: No route to host
    Please suggest how to resolve this.
    Thanks
    Edited by: 861012 on Sep 4, 2012 3:42 PM

  • Production Environment RFC's for EWA.... Please help!!

    We have some of the production environment setup EWA. I will need to add else which are left. I have setup EWA in sandbox for testing. worked fine. but i have question about RFC's.
    My all DEV systems has the following RFC's in solman;
    SM_XXXCLNT100_LOGIN
    SM_XXXCLNT100_READ
    SM_XXXCLNT100_TMW
    SM_XXXCLNT100_TRUSTED
    But my all QAS and PRODUCTION system has the following RFC'c in solman.
    SM_XXXCLNT100_LOGIN
    SM_XXXCLNT100_READ
    SM_XXXCLNT100_TMW
    I thought when I generate auto RFC's from SMSY, it creates the following;
    SM_XXXCLNT100_READ
    SM_XXXCLNT100_TMW
    SM_XXXCLNT100_TRUSTED
    What should I do? if it creates _TRUSTED ONE in PRD, should I delete it? Please help!!
    Question: If I am generating auto RFC's for PRD, it created _LOGIN one too? I am totaly confused??
    Thanks,
    I will definitely post points

    The only reason I want to do that because I have to talk to security folks for that, they will go and look at the other production environments which dont have _TRUSTED rfc...
    Like as I have mentioned, all production has the following rfc's
    SM_XXXCLNT100_LOGIN
    SM_XXXCLNT100_READ
    SM_XXXCLNT100_TMW.
    I dont understand only one thing. how can I get _LOGIN rfc?
    The only reason I am asking, when I did EWA in sandbox, It did not generate _LOGIN rfc...
    Do you have any idea?
    Thanks,

  • Production environment, please help...

    Hi,
    we have a large BC4J web based application.
    we plan to put it production to allow to 40 CONCURENT USERS to connect to...
    after testing the application in stand-alone OC4J. it works well, nut at some moments, the server print the message
    like out of memory and it becomes realy slow. i restarted the OC4J
    like java -Doc4j.userThreads=true -Xms100m -Xmx800m oc4j.jar to increase the heap and i hope that this will
    solve the problem.
    no for the production environment :
    hardware
    Sun server
    4 x CPU x 450
    4 G on RAM.
    software
    Sun Solaris 8
    Oracle 9iAS R 2 (9.0.2.0.0)
    so what is the good configuration for the OC4J in 9iAS to get our system support all users. should we
    use - Doc4j.userThreads=true -Xms100m -Xmx800m even whith 9iAS.
    thank you for your help.

    El Bachir,
    The heap size is dependent upon your application and no. of concurrent users you are using. Yes, you can specify the the heap size for OC4J also in an Oracle9iAS instance from the EMWebsite by navigating OC4J Instance ->Server Properties -> specify the parameters for the Java command.
    For details how to determine the heapsize please look at the Performancing Guide. Here is the link
    http://otn.oracle.com/docs/products/ias/doc_library/90200sol_otn/perf.902/a95102/optj2ee.htm#1012258
    regards
    Debu Panda
    Oracle
    Hi,
    we have a large BC4J web based application.
    we plan to put it production to allow to 40 CONCURENT USERS to connect to...
    after testing the application in stand-alone OC4J. it works well, nut at some moments, the server print the message
    like out of memory and it becomes realy slow. i restarted the OC4J
    like java -Doc4j.userThreads=true -Xms100m -Xmx800m oc4j.jar to increase the heap and i hope that this will
    solve the problem.
    no for the production environment :
    hardware
    Sun server
    4 x CPU x 450
    4 G on RAM.
    software
    Sun Solaris 8
    Oracle 9iAS R 2 (9.0.2.0.0)
    so what is the good configuration for the OC4J in 9iAS to get our system support all users. should we
    use - Doc4j.userThreads=true -Xms100m -Xmx800m even whith 9iAS.
    thank you for your help.

  • So, i just connected my ipod touch 4g to my laptop and there is an update 4.3.3  available  i was downloading it and just as it finishes it says your network session has timed out what ca i do? HELP ASAP PLEASE!!!

    i just connected my ipod touch 4g to my laptop and there is an update 4.3.3  available  i was downloading it and just as it finishes it says your network session has timed out what ca i do? HELP ASAP PLEASE!!!

    Try a direct download:
    iPod, iPhone and iPad Firmware Download
    Manually install it by holding your "Option" key down when clicking on the "Restore" button in iTunes and select the firmware file you downloaded.

  • J2EE system in production..., please help.

    Hi ,
    We developed a LARGE BC4J / J2EE based transactional aplication.
    We plan to put it in the production environment :
    the system is tested whith a stand-alone OC4J started like java -Doc4j.userThreads=true -Xms100m -Xmx800m oc4j.jar.
    we used -Xms100m -Xmx800m to workaround a messages like Out of memory ( we have a large jsp using a lot of BC4J tags).
    Now
    our system be deployed (for production ) on 9iAS R2. we will have about 40 concurent users connected to this transactionnal
    system.
    So what is the good practice to put our system in the production environment
    our environment is :
    Server Sun
    4 x CPU (450)
    4 G of RAM
    Sun Solaris 8
    Oracle 9iAS R2 (9.0.2.0.0)
    should we use parameters like -Xms100m -Xmx800m whith the OC4J instance within 9iAS. if yes, HOW To...
    Just an alternative and for tow days of real testing, i would like to use a stand-alone OC4J to connect 40 users. i do not
    know if java -Doc4j.userThreads=true -Xms100m -Xmx800m oc4j.jar will be the good starup procedure for the container.
    thank you very murch in advance.

    Yes, you're on the right track.
    for more performance and best practices refer
    http://otn.oracle.com/docs/products/ias/doc_library/90200sol_otn/perf.902/a95102/optj2ee.htm#1656
    to set command line parameters in Oracle9iAS, do the following:
    In enterprise manager( the tool you would use to manage your Oracle9iAS)
    click on the OC4J instance where you would deploy your app
    Scroll down, click on server properties
    scroll down and add parameters in the command line section.
    restart the OC4J instance.
    -Prasad

  • Releasing pin need help asap please

    Hello everyone I currently have a Blacberry 8520 Curve on contract with Virgin. I am going abroad to spain for 5 months next sunday How do I go by releasing my blackberry pin so i can use the phones blackberry messenger with a spanish simcard abroad ? My phone is unlocked to all networks but from what I understand you cant use blackberry messenger on the same phone under 2 different simcards with a bbm data plan?
    So a bit of advice please on how I release it.
    thanks
    josh

    Call Virgin and cancel your account, that will release the PIN for use on another SIM card.
    Or, if you are not wanting to cancel the Virgin mobile account, just simply have the BIS planned removed from your account. Ask Virgin to make sure the PIN is available now for registration elsewhere.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Issue in production environment

    Hi,
    We got an issue in the production environment on last Friday and yet not able to find out the root cause of the issue.
    Environment
    GUI : .Net
    Server : Java
    Application Server: Jboss
    Database: Sqlserver
    The Java application is deployed into Jboss application server which connects to SQL server as back end. GUI makes the web service call to server for data communication
    Issue
    Friday at 2 PM users reported the slowness of the application (Not getting the response from server in GUI), all the request from GUI were getting timed out.
    Restart of Jboss didn't help
    Restarted the Jboss and sqlserver for the second time and than the environment became stable
    Analysis
    1. From the thread dump of Jboss log we see that there are many threads waiting on a socket for database connection(according to database team all the connections are open and available at that particular time).
    2. The size of transaction log is almost doubled during this period (when the issue was reported). 
    We couldn't find a reason why this issue is happened. Is it a database issue or something else? Please suggest...
    Thanks,
    Manoj

    Hi Manoj,
    According to your description, when running the web application, many threads are waiting for the socket from database which cause requests from front GUI time out. Right?
    In this scenario, user can access the front GUI, which means the application server is working. Since the connections are all open at that particular time, it should not be issue on your JDBC. It seems to be a deadlock issue which cause other threads
    waiting and hang. I recommend check and optimize your code. On database side, I suggest you open the SQL profiler, select DeadLock Graph, it will record when deadlock occurs. Please refer to links below:
    Detecting and Ending Deadlocks
    Analyze Deadlocks with SQL Server Profiler
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • Problem on developing SSRS report in a production environment

    Any problem could  be caused if have to develop SSRS report in a production environment ?
    If so, how it can be prevented?
    Thanks!

    Hi ,
    As per my understanding, Normally our environment setup contains Development,testing,preproduction,production and its varies from company to company.
    We develop SSRS report in development environment and after testing we deploy it to production report server.
    Development environment use development database for creating report like your database IP and credential will use development environment
    setup. and production environment use production database for creating report like your database IP and credential will use production environment setup.
    Thanks
    Neha Prajapati Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.

  • Existing 2003 forest functional level -- 2012 forest functional level in production environment?

    Hello experts!  
    A quick question if it can be one:
    Is it possible to raise a forest functional level from 2003 to 2012 in a production environment (only 2003 DCs with existing roles to only 2012 DCs)?  If so, is there a standard implementation of the upgrade process
    (migration of roles, migration tools, etc.)?
    many thanks!
    David

    hi,
    Thanks for posting. 
    Sorry i don't know if i am understanding your question. Are you talking about upgrading your DC's in your current forest to 2012 then raising the functional level? 
    If so, first of all you can only raise the forest and domain functional levels when all DC's in the forest and domain are at 2012 or higher. 
    To get your domain unto 2012 DC's there are a couple of paths you can adopt, but generally the simplest is:
    1. Introduce your first 2012 / 2012 R2 DC into your existing domain, this will extend the schema with the additional attributes that are required to 2012 - this is an automatic process during promotion of your first 2012 DC.
    2. Go through and start replacing your existing domain controllers. You don't normally do an inlace upgrade, the preferred method would be to use different hardware, built up the new DC to replace your existing one, then demote the existing one - keep going
    through this process until all your DC's are 2012.
    NB: which ever DC(s) currently holds the FSMO roles you will need to transfer these to one of your new 2012 DC's before you decommission that one. 
    if i've got what you were asking wrong, please let me know, otherwise hopefully this helps.
    Regards,
    Denis Cooper
    MCITP EA - MCT
    Help keep the forums tidy, if this has helped please mark it as an answer
    Blog: http://www.windows-support.co.uk 
    Twitter:   LinkedIn:

Maybe you are looking for

  • Can I remove devices from my iTunes account

    I have devices connected to my iTunes/Apple ID account that I no longer own. Is there any way to remove these devices? It shows five devices connected, but I only have two that are still being used.

  • Dealing with large amounts of data

    Hi I am new to using Flex and BlazeDS. I can see in the FAQ that binary data transfer from server to Flex app is more efficient. My question is: is there a way to build a Flex databound control (e.g. datagrid) which binds to a SQL query or web servic

  • Generating an SWF using Javascript

    Has anyone had any success generating an swf using nothing but javascript. Is there a module or an API that I can tap into to accomplish this feat. Thank you for your time

  • Oracle 11 on CentOS 5.1

    While running the Oracle install, the "Checking Network Configuration Requirements" fails. Or to be precise, it says that it did not execute. I see the following in the log file. INFO: Checking DetectIfDHCPAssignedIP This is a prerequisite condition

  • Simulation Interface ToolkitのNISink要素とは?

    Simulation Interface Toolkitを購入させていただきました. 以下.使い方に関する質問です. http://zone.ni.com/devzone/conceptd.nsf/webmain/955A9D79583A0AB686256DB8006672B8 を拝見しながら.使い方の勉強をしておりますが.その中で示されている NISinkというSlimulink要素が見つかりません. 添付の画像ファイルにみるように.SITのインストールは正しく出来ている様ですが (Matla