SQL Error using cachedrowSet.populate.

Hi,
I am trying to use cachedrowset to pass my result set into my jsp.
I use request.setAttribute and pass my cachedrowset and in my jsp I use <jsp:usebean> tag to retrieve it.
This usually works for me. However, I have one query which when I am trying to populate the cachedrowset with its result set (that is cr2 in code below )
rs2 = stmt.executeQuery(semSql);
rs3 = stmt.executeQuery(countSql);
crs2 = new CachedRowSet();
crs3 = new CachedRowSet();
crs2.populate(rs2);
crs3.populate(rs3);
is throwing an sql error.
I ran the query in my query analyzer tool and it runs fine. But when I try to populate it in cachedrowset it throws sql error.
I have more queries in the same java which I am passing to the jsp as cachedrowset (for example cr3 in the above code) And they all are working fine. Only this particular one is causing the issue.
I was also looking at some other posts with the same issue. One post said if the data is a negative number then it can cause issue while trying to populate a CRS. However, in my case there is no negative data.
I am clueless. Please help !!

Apparently noone replied to this.
Well, this one is odd so cant blame you guys.
I finally found the answer after losing lots of my hair.
It looked like somewhere my connection was getting closed. I dont know why it was getting close at the first place because i didnt have any rs.close() or so statement in there.
One of the reasons that I have in mind is that after getting the results of my first query in a cachedrowset (CRS) , I moved the cursur of CRS and that may have caused some problem. But then also my second query was totally independant of my first query. And my third query which apparently was working fine and didnt thru an error on crs.populate was dependant on the first one,.
Finally, I rearraged the code, so that the operations i was doing on the first CRS was after I populate my second CRS. And that solved the problem.
Hope this solution helps somebody like me out there.

Similar Messages

  • Invalid SQL error using REF CURSOR

    I'm getting an "invalid SQL statement" in my function that is returning a REF CURSOR. I have tested this function in SQL*Plus and it works fine.
    -- package level variable
    TYPE t_cursor IS REF CURSOR;
    Function find_patient
         p_ssan IN varchar2,
         p_patient_details OUT t_cursor
         RETURN t_cursor
         IS
         v_cursor t_cursor;
         BEGIN
         OPEN v_cursor FOR
         SELECT name,sex,pay_grade,
              FLOOR(MONTHS_BETWEEN(sysdate,birthdate) / 12) AS age,
              patient_num
         FROM patient
         WHERE ssan = p_ssan;
         p_patient_details := v_cursor;
         RETURN p_patient_details;
         END find_patient;
    -- C# code
    OracleParameter ssan_in = new OracleParameter("p_ssan",OracleDbType.Varchar2);
    OracleParameter cursor_out = new OracleParameter("p_patient_details",OracleDbType.RefCursor);
    cmd.Parameters.Add(ssan_in).Direction = ParameterDirection.Input;
    cmd.Parameters.Add(cursor_out).Direction = ParameterDirection.Output;
    ssan_in.Value = "555555555";
    OracleRefCursor cur = (OracleRefCursor) cursor_out.Value;
    try
    dbconn.Open();
                        OracleDataReader dr = cmd.ExecuteReader();
                        while (dr.Read())
                             pat_name.Text = dr["NAME"].ToString();
                             age.Text = dr["AGE"].ToString();
                             rank.Text = dr["PAY_GRADE"].ToString();
                             gender.Text = dr["SEX"].ToString();
                             pat_num.Text = dr["PATIENT_NUM"].ToString();
    Any suggestions?

    First, you have an output parameter of type ref cursor and a return value. You shouldn't have both.
    Second, try CommandType.Text and a CommandText like:
    "begin :rc := find_patient(:ssan); end;"
    It's easier to see how to bind the parameters like that. Bind first a OracleRefCursor output parameter, then an ssan%type InputParameter.
    David

  • Query SQL database using JSF problem!! Using CachedRowSet

    I'm using JSF and want to query data from SQL by using CachedRowSet like this,
    rowset.setCommand("SELECT * FROM dbo.SomeTable WHERE SomeField='"+ xyz +"'");
    then check if the record does exist by using
    *if(rowset.next()) {/ do something with the retrieved data}*
    but i get SQLException telling that execute() never called.
    Anyone can tell me what i'm missing? or is there any better way to check the existence of a record ?
    Thanks in advance :-)

    Hi grzegorz,
    1. If your sap application server is unix/aix
      (and not a microsoft OS),
    2. then this kind of secondary databse connection,
       to MS SQL (which is microsoft system),
       is at present not possible.
      (BCOS the required system files, for such
       cross - platform connection is not delivery by sap)
    regards,
    amit m.

  • Error Using New-WebServiceProxy cmdlet with SQL Agent Powershell Subsystem

    I created a powershell script to connect to SSRS via web service so I can cache reports in the database and expose them directly through our application. The script works fine when I run it through Powershell directly, but when I try running it through the
    SQL Agent Powershell subsystem I am getting a strange error:
    "A job step received an error at line 61 in a PowerShell script. The corresponding line is '$RS = New-WebServiceProxy -Class 'RS' -Namespace 'RS' -Uri $reportServerURI -UseDefaultCredential  '. Correct the script and reschedule the job. The error
    information returned by PowerShell is: 'Could not load file or assembly 'file:///C:\WINDOWS\TEMP\yfqiivtg.dll' or one of its dependencies. The system cannot find the file specified.  '.  Process Exit Code -1.  The step failed."
    I am using SQL Server 2014, SSRS 2014, Windows 8.1. The only difference I can think of is that when I run Powershell from the OS, I am using v 4.0 whereas when I run it from SQL Agent it loads v 2.0. My understanding is that v 2.0 supports the New-WebServiceProxy
    cmdlet, so I'm not convinced the version discrepancy is the culprit. Any ideas what might be causing this?
    On a side note, is there a way to have SQL Agent use Powershell 4.0 for the subsystem? v 2.0 feels a little dated for SQL Server 2014.

    Hi WilliamW,
    When creating a PowerShell job step, there is only one security context available, which is the "SQL Server Agent Service Account." That means that if you intend to execute PowerShell scripts from SQL Agent Job steps, the SQL Server Agent
    service account must have appropriate permissions.
    According to your error message, I recommend to check if the SQL Server Agent service account has access to the folder where the scripts live, as well as the folder C:\WINDOWS\TEMP.
    In addition, when we execute a PowerShell job step in SQL Server, SQL Server Agent subsystem run the sqlps utility, and the sqlps utility launches PowerShell 2.0 and imports the sqlps module. If you need to run a PowerShell v4.0 script from a SQL Server
    Agent job, you can create a proxy account to run the agent job which contains PowerShell script. For more details, please review this similar blog:
    Run a PowerShell v3 Script From a SQL Server Agent Job.
    Thanks,
    Lydia Zhang

  • Error while retrieving data from PL/SQL Table using SELECT st. (Urgent!!!)

    Hi Friends,
    I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
    CREATE or REPLACE PROCEDURE test_proc IS
    TYPE tP2 is TABLE of varchar2(10); --declared a collection
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    While executing the above procedure, I encountered foll. error:
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
    ORA-06553: PLS-801: internal error [0]
    Can anyone please help me, where the problem is??
    Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
    Thanks in advance.
    Best Regards,
    Jay Raval.

    Thanks Roger for the Update.
    It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
    Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
    I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
    Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
    If someone have any other idea on this, please do let me know.
    Thanks a lot for all help.
    Best Regards,
    Jay Raval.
    You have to define a database type...
    create type tP2 is table of varchar2(10)
    CREATE OR REPLACE PROCEDURE TEST_PROC
    IS
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    This will work.
    Roger

  • Error Using LISTAGG SQL Function

    Hello,
    I'm trying to use the new LISTAGG SQL function with the following expression in a report:
    select listagg(email, ';') within group (order by email) as email_list from sba_registration_entries where team=241
    and I get the following SQL error in Apex SQL Workshop:
    ORA-00923: FROM keyword not found where expected
    Is this function enabled on the apex.oracle.com site? Am I using the correct syntax?

    Hi,
    The current database on apex.oracle.com is "Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production"
    The LISTAGG function seems to be from version 11.2: [http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/functions087.htm] ?
    Andy

  • ODI 10.1.3.4.0 - Topology Manager Connection Error using SQL 2005 SP3

    Hello All,
    I am using the ODI repository in SQL 2005 SP3. I could create my master repository using the following parameters:
    driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
    URL:jdbc:microsoft:sqlserver://server_name:1433;SelectMethod=direct;DataBaseName=ODI
    I needed to copy to the drivers directory all files of SQL 2000 (msutil.jar, msbase.jar,mssqlserver.jar) and SQL 2005 (sqljdbc.jar). I am using the JRE 1.4.2 and JDBC 2005 1.2 (http://msdn.microsoft.com/en-us/library/ms378422(SQL.90).aspx)
    But when I try to connect in Topology Manager to create the work repository appears the following error:
    using this driver string: com.microsoft.jdbc.sqlserver.SQLServerDriver
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC] Can't start a cloned connection while in manual transaction mode.
    using this driver string: com.microsoft.sqlserver.jdbc.SQLServerDriver
    java.sql.SQLException: No suitable driver
    Does Somebody know what is happening?
    Regards,
    Wallace Galvao
    Sao Paulo - Brazil

    Hi,
    If you plan on using the SQL Server 2005 drivers then you only need the 1.2 sqljdbc.jar file in the drivers directory.
    The connection details for SQL Server 2005 should be like the following.
    com.microsoft.sqlserver.jdbc.SQLServerDriver
    jdbc:sqlserver://<sqls machine>:1433;databaseName=<db name>;integratedSecurity=false
    I would try just with just the correct driver in place, remove the others, restart any ODI components and then make sure the connection information is correct like above.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • FRM-40734: Internal PL/SQL error by using delete_group in CUSTOM.pll

    Hi,
    I am dynamically changing an LOV using CUSTOM.pll and it is working fine initially when i enter the form. If I change one field, it needs to be changed again. For this I am using delete_group and again create_group_from_query. Here delete_group is throwing an error FRM-40734: Internal PL/SQL error.
    Please help me on this.
    Thanks In Advance,
    Hima

    can you post us your code?

  • Siebel 8.1.1 Install error using MS SQL Server 08

    Hi,
    I am trying to set up a Siebel Proto environment on WinXP system. The database that I am using is MS SQL Server 2008 with SP1 installed.
    After installing Siebel at the Database Install step, I encountered a failure on step 'Import Repository Data' The error log generated is as follows:
    2010-04-03 18:47:45     C:\sba81\siebsrvr\bin\repimexp.exe /a I /G ENU /u SADMIN /p ***** /c SBA_81_DSN /d dbo /r "Siebel Repository" /f C:\sba81\dbsrvr\common\mstrep.dat /l C:\sba81\siebsrvr\log\install\output/imprep_prim.log
    2010-04-03 18:47:45     
    2010-04-03 18:47:45     Connecting to the database...
    2010-04-03 18:47:46     Connected.
    2010-04-03 18:47:46     Starting common api.
    2010-04-03 18:47:46     SQLstyle is 'Microsoft SQL Server'
    2010-04-03 18:47:46     SARM is OFF -change param SARMLevel to enable
    2010-04-03 18:47:46     SARM Client is OFF -change param SARMClientLevel to enable
    2010-04-03 18:47:46     SARM is OFF -change param SARMLevel to enable
    2010-04-03 18:47:46     SARM Client is OFF -change param SARMClientLevel to enable
    2010-04-03 18:47:46     SARM is OFF -change param SARMLevel to enable
    2010-04-03 18:47:46     SARM Client is OFF -change param SARMClientLevel to enable
    2010-04-03 18:47:47     Unable to verify login name SADMIN.
    2010-04-03 18:47:47     Unable to start common api.
    2010-04-03 18:47:47     Unable to start common api.
    2010-04-03 18:47:47     Error in initiate function..
    2010-04-03 18:47:47     Elapsed time: 2 sec.
    2010-04-03 18:47:47     (logapi.cpp (184) err=1 sys=0) SBL-GEN-00001: (logapi.cpp: 184) error code = 1, system error = 0, msg1 = (null), msg2 = (null), msg3 = (null), msg4 = (null)
    I am using SADMIN user for Database account and SIEBEL user for Table owner. I have also tried using SIEBEL user in both places.
    Basically what is SARM? And how can I enable it?
    I have tried connecting to the DB from the Server system and am successful in that.
    Thanks for the help in advance.
    With Regards,
    Tanmay Jain

    Hi EvtLoglvl,
    I am able to connect to the SQL Server using the ODBC connections and also SADMIN id has requisite SSE_ROLE granted to it and the default DB for it is SIEBEL_DB on which I am attempting installation. I was able to successfully run the grantuser.sql file that Siebel provides by default to create the roles and logins for SIEBEL, SADMIN and LDAPUSR.
    The problem I am encountering is when I try to perform the Database Server configuration. The system creates the required tables and indexes successfully on the DB. The problem is coming when it tries to Import the base repository that Siebel Server Installation comes with. The error log was for the same.
    I feel that the Siebel Installer is missing some APIs to connect to SQL Server 08.
    The SQL Server is hosted on a system with x64 architecture and the Siebel Server is on a x86 architecture system. I also have Service Pack 1 installed on both the DB Server and Siebel Server. Using third party tools I am able to manipulate the database without any hitches from the Siebel Server system.
    Latest, I have tried reinstalling the virtual environment completely, i.e. started from scratch and had the same issue when I tried the Siebel Database Server installation step. I sure hope I dont have to install SQL 05 and install Siebel Database on it and then do an upgrade of the database.
    Thanks for the info about SARM. It still shows up in the Log file and after it the install fails though.
    Thanks and Regards,
    Tanmay Jain

  • SQL Error 207 when using Query Designer

    Hi experts I hope you can help me out with this it is urgent!
    I am crating a Query on the query designer NW04s, when I add a column from my info provider I get the following error:
    CX_SQL_EXCEPTION Occurred (program: cl_sql_statement========cp etc.
    I check the WP log and I found this:
    C Wed Jan 31 10:22:59 2007
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'TXTMD'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296924022803]
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'TXTSH'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296924022803]
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'LANGU'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296924022803]
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'CURRENCY'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296924022803]
    C  ParamStmtExec failed.  HR 80040e14 DBSL retcode 100. stmt: [select [S00].[CURRENCY]  AS [0000000023] , [T00].[TXTSH]  AS [0000000
    C  /* R3:CL_SQL_STATEMENT==============CP:399 T:/BI0/SCURRENCY */
    C  ]
    C  Conn_i:1 selection:1 singleton:0 flag_fupd:0 use_cursor:0 chksum: 1122000
    C  dbdsmss: DBSL100 SQL207
    C  Invalid column name 'CURRENCY'.Invalid column name 'LANGU'.Invalid column name 'TXTSH'.Invalid column name 'TXTMD'.
    B  ***LOG BY2=> sql error 207        performing OPC        [dbds#1 @ 482] [dbds    0482 ]
    B  ***LOG BY0=> Invalid column name 'CURRENCY'.Invalid column name 'LANGU'.Invalid column name 'TXTSH'.Invalid column name 'TXTMD'.
    B  ***LOG BY1=> sql error 207        [dbacds#2 @ 1422] [dbacds  1422 ]
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'TXTMD'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296940022803]
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'LANGU'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296940022803]
    C  sloledb.cpp [ParamStmtExec,line 12768]: Error/Message: (err 207, sev 16), Invalid column name 'UNIT'.
    C  Procname: [##Y4CWP_JFR_wpf00000074440000296940022803]
    C  ParamStmtExec failed.  HR 80040e14 DBSL retcode 100. stmt: [select [S00].[UNIT]  AS [0000000008] , [T00].[TXTMD]  AS [0000000008_
    C  /* R3:CL_SQL_STATEMENT==============CP:399 T:/BI0/SUNIT */
    C  ]
    Dont know what is going on,
    Regards,
    Alejandro.

    Hi Its quite difficult to analyze,however are you on latest FEP SP 11??
    if not try downloading from
    service.sap.com/swdc>Download>support packages and patches>Ebtry by application component>Support Packages and Patches" SAP Frontend Components" SAP GUI FOR WINDOWS" SAP GUI FOR WINDOWS 6.40-->Win 32
    for 3.x front end bw350_11-10001615.exe
    for Nw2004s front end - Bw700SP11_1100-10001615.exe
    Hope it Helps
    Chetan
    @CP..

  • Issue while importing table from oracle to sql server using import and export wizard

    Hi All,
    I am trying to populate oracle table to sql server using import export wizard  and i am getting the below error.the table is allready present in the database but still it throwing error like table doesn't exists.
    Could not connect source component.
    Error 0xc0202009: Source - JOB_ACTION_HISTORY [1]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    Error 0xc02020e8: Source - JOB_ACTION_HISTORY [1]: Opening a rowset for ""FLXUSER"."JOB_ACTION_HISTORY"" failed. Check that the object exists in the database.
     (SQL Server Import and Export Wizard)
    Kindly help me out
    Thanks in advance

    Hi Snehasis,
    Please check whether the table name in the Oracle database has lower case letters. The table name should be exactly correct. 
    In addition, the issue might be related to the Oracle driver. What provider/driver do you use? If you use Microsoft OLE DB Provider for Oracle, you can try the
    Oracle OLE DB Provider. If you use Enterprise or Developer edition of SSIS 2008 or higher, you can also try the
    Microsoft Connectors for Oracle by Attunity. The  Oracle OLE DB Provider and Microsoft Connectors for Oracle are proved to have better performance.
    Regards,
    Mike Yin
    TechNet Community Support

  • Error using a tag query

    We have a tag query that works in our sandbox environment, but not in dev.  I loaded the same JDBC drivers on both systems.
    The project was exported from the sandbox, and imported into dev.
    I have verified the Data Server set up is identical in both environments.  Connection status in both environments is identical - running, same number of connections, etc.
    When I try to run the query on sandbox in workbench, the query returns data.  I get this error on the dev system -
    SQL error has occurred on query java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'tag'.
    Detailed error -
    java.lang.Exception: SQL error has occurred on query [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'publicgrouptag'.
         at com.sap.xmii.Illuminator.gui.workbench.populators.IlluminatorPopulator.get(IlluminatorPopulator.java:114)
         at com.sap.xmii.Illuminator.gui.workbench.populators.TagListPopulator.get(TagListPopulator.java:47)
         at com.sap.xmii.Illuminator.gui.workbench.components.desktop.custom.TagQueryBuilderPanel$6.construct(TagQueryBuilderPanel.java:723)
         at com.sap.lhcommon.gui.ThreadCreator$2.run(ThreadCreator.java:94)
         at java.lang.Thread.run(Unknown Source)
    Any suggestions??

    One of your included JDBC driver archives has a class that matches the path provided by the JDBCDriver setting for the data server (likely the sqljdbc.jar file).
    If you take the JDBCDriver setting: 
    com.microsoft.sqlserver.jdbc.SQLServerDriver
    and replace the periods for sub directories and add a .class on the end you'll have:
    com\microsoft\sqlserver\jdbc\SQLServerDriver.class
    So if you unpacked the jar file you'd find this java class (and the other ones included with the driver).
    Do you get the same error about 'publicgrouptag' and 'tag' objects when you test a tag query request for GroupList mode?  These tables/views would be used by the underlying queries used to populate the tag details tab in the WB.  Do you see these tables or view within the SQL Server?  Does the sa user have appropriate permissions?

  • Database connection problem SQL Error: 20, SQLState: 61000

    we are doing stress test on our new web site that uses vaadin framework and hibernate. Our application/web server is apache tomcat and maximum thread number is adjusted to 750.
    we are using jmeter for stress test and when we send 500 user scenario (approximately 15 - 20 database connection per user) in 30 seconds
    we are encountered the following error:
    *14:43:10,502 WARN JDBCExceptionReporter:233 - SQL Error: 20, SQLState: 61000*
    *14:43:10,503 ERROR JDBCExceptionReporter:234 - The Network Adapter could not establish the connection*
    but if we send 500 user in 45 seconds there is no problem, jmeter test is completed with 100% success. even if we send 900 user in 120 or 180 second it is OK.
    it seems that there is a DB related parameter that we could not handle properly or maybe operating system limitation (windows 2008 R2).
    any help will be appreciated. thanks in advance.
    gokhan
    Edited by: gokhangulgezen on May 31, 2011 6:38 AM

    It's the DBMS. Oracle particularly can react this way when there are too many connection requests
    coming in, whether from multiple threads at once, or even from one thread in a tight loop. I do
    not know if there's a way to moderate/adjust this. I typically recommend using connection-pooling,
    and to do as much as possible to populate the pool before there is application load.
    Joe

  • Rep-1401: formula name : Fatal Pl/SQL error occured

    Hi,
    I am using report builder 6.0 and recently came across a error while running the report. Rep-1401:<formula name> : Fatal Pl/SQL error occured.
    I created a formula column in the report. In that i have three local variable.
    f_val number := 0;
    s_val number := 0;
    t_val number := 0;
    t_val := f_val/s_val ; --> this gives the above fatal error.
    t_val := (f_val + 1)/s_val; --> this gives the above fatal error
    t_val := f_val/(s_val + 1); ---> no error
    if i change the value of s_val
    s_val := 1;
    t_val := f_val/(s_val - 1) ; ----> this gives the above fatal error.
    Can anyone help me to solve this problem or is it report builder bug.
    Please help me, as i desperately need help.
    Thanks

    Thanks for ur reply.
    I used nvl too, but the same error occurred.
    For the information in my question I by mistake typed
    t_val := (f_val + 1)/s_val; --> this gives the above fatal error.
    but when the value of f_val = zero and s_val is zero why it gives fatal error when i divide, i used nvl on both the variable while dividing but still got the same error.
    but if s_val is greater than zero then no error occurs.
    please help me, I feel it is a bug.

  • Rep-1401 : Fatal PL/SQL error occured

    Hi,
    I am using report builder 6.0 and recently came across a error while running the report. Rep-1401:<formula name> : Fatal Pl/SQL error occured.
    I created a formula column in the report. In that i have three local variable.
    f_val number := 0;
    s_val number := 0;
    t_val number := 0;
    t_val := f_val/s_val ; --> this gives the above fatal error.
    t_val := (f_val + 1)/s_val; --> this gives the above fatal error
    t_val := f_val/(s_val + 1); ---> no error
    if i change the value of s_val
    s_val := 1;
    t_val := f_val/(s_val - 1) ; ----> this gives the above fatal error.
    Can anyone help me to solve this problem or is it report builder bug.
    Please help me, as i desperately need help.
    Thanks

    The best way to handle this is to just add an exception handler that handles a zero divide.
    EX:
    function...blah
    var3:=var/var2...
    EXCEPTION
    when zero_divide then
    var3:= 0;Zero Divide is a built-in exception to handle cases just like this - so if you run into it, you can set it to whatever you want

Maybe you are looking for