Making a procedure to work against 8i, 9i and 10g databases

Hello all,
I made a procedure that gathers info from user. At some point I execute this part of code:
CURSOR tabPrivs IS
SELECT owner, table_name, privilege, grantable, hierarchy
FROM dba_tab_privs
WHERE grantee = uName;
At first my procedure was only for 9i and 10g databases. I tried it once on 8i and get the logical error that the hierarchy column doesn't exist in the table dba_tab_privs.
I want my procedure to work against all versions of databases so I tried to do an additional select if the database version was upper than 8, but it seems that it won't compute, as if before executing my procedure, the engine look to all the select I am trying to do and check if they are correct.
I want to know if there's a work-around because I want to provide the most generic procedure possible.
Thank you,

You need to declare your cursor according to your DB version. Something like this might keep you going:
DECLARE
   VERSION         VARCHAR2 (30);
   COMPATIBILITY   VARCHAR2 (30);
   uname           VARCHAR2 (30);
   TYPE cur IS REF CURSOR;
   p_sys           cur;
BEGIN
   DBMS_UTILITY.db_version (VERSION, COMPATIBILITY);
   IF VERSION LIKE '10%' OR VERSION LIKE '9%'
   THEN
      OPEN p_sys FOR 'SELECT owner, table_name, PRIVILEGE, grantable, HIERARCHY
           FROM dba_tab_privs
          WHERE grantee = :uname' USING uname;
   ELSIF VERSION LIKE '8%'
   THEN
      OPEN p_sys FOR 'SELECT owner, table_name, PRIVILEGE, grantable
           FROM dba_tab_privs
          WHERE grantee = :uname' USING uname;
   END IF;
   do_your_fetch_and_work_here;
   CLOSE p_sys;
END;

Similar Messages

  • Problem occurs when working with the struts and mYsql database

    Hi all,
    I am working on Struts and using database mysql. I am getting this error when i tries to modify the values of jsp page and after modify when i submit a page ,the values are modifying but it is showing this error.
    After modifying the values i am forwarding the controller to the Display page where all records from the databse will be displayed.Please tell me how to solve.this..
    Thanks
    javax.servlet.ServletException: Cannot find bean employees in any scope
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:495)
         at org.apache.jsp.viewEmployee_jsp._jspService(viewEmployee_jsp.java:208)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    root cause
    javax.servlet.jsp.JspException: Cannot find bean employees in any scope
         at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:938)
         at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:277)
         at org.apache.jsp.viewEmployee_jsp._jspService(viewEmployee_jsp.java:124)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:162)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:627)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:306)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:200)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:534)
    Apache Tomcat/4.1.31

    Hi,
    i think you have got this sample application from Mastering Jakarta Struts book.
    Try the following changes, you can escape from this exception:
    1) In the employeelist.jsp, change the name attribute to "USER instead of "employees" as follows
    <logic:iterate id="employee" name="USER">
    and also <logic:present name="USER"> </logic:present> before and after the iterate tags.
    2)In the EmployeeList Action.java,add the following in the excute method...
              EmployeesActionMapping employeesMapping =
                   (EmployeesActionMapping)mapping;
                   if ( employeesMapping.isLoginRequired() ) {
                        HttpSession session = request.getSession();
                             if ( session.getAttribute("USER") == null ) {
                                  System.out.println("session.getAttribute is NULL");
                                  target = "login";
                             ActionErrors errors = new ActionErrors();
                             errors.add(ActionErrors.GLOBAL_ERROR,
                             new ActionError("errors.login.required"));
                             if (!errors.empty()) {
                             saveErrors(request, errors);
                        }else{
                   session.setAttribute("USER",getEmployees());
    Thanks,
    Shanmu

  • APEX2.0 on 9i not working anymore after installation of 10G database

    Hello,
    Up to last saturday I used APEX 2.0 on my 9i database (on Windows XP) without problems. I have several applications running and used them saturday for the last time.
    Saturday I installed Oracle 10G Enterprise Edition on that same machine. I installed ONLY the software for the RDBMS, not even APEX. Later on I created my first 10g database via DBCA. Notice that I didn't do anything with APEX on that 10g database yet. I only installed the RDBMS software in a 10g home directory and created a database. That's all. No apex installed, nothing from the companion CD, only the RDBMS software in its own home.
    Yesterday however, after a reboot of the machine, I could not use my applications running on the 9i database anymore: "the page cannot be found".
    HELP!!!
    What was changed by the installation of 10g that now causes that my applications cannot be accessed anymore? The 9i database runs OK, so that's not the problem.
    I did already change the PATH settings, so that the 9i paths are checked before the 10.2 paths, but that did not solve the problem.
    Has the installation changed something in the registry of XP perhaps?
    Best regards,
    Jan.
    Best regards,
    Jan.

    Hi all, in answer to the above suggestions:
    No the 10g database and listener is completely down (no services belonging to the new 10g database are running). I checked also alle the logs, but no messages anymore since saturday.
    What I did notice: Oracle92HTTPserver (a service normally started automatically) does not start. When I start it, it gives me a message that there is nothing to do and that the service therefore is not started. So the HTTP-server itself is not working anymore. I can't find any files changed by th installation in the Ora92 home Apache directories. All seems as it was before the installation And still it won't start....
    Does anybody have other suggestions? Please help.
    Thanks in advance,
    Jan.

  • Crystal Reports has stopped working with Windows 7 and demo database

    I'm trying to get back up to speed on Crystal Reports after 10 years away. I'm running Crystal Reports 2008 Standard with the just-released Service Pack 3 (same symptom with SP2).
    So I downloaded the demo database and tried creating a new report. No problems creating a simple customer list. When I add the Orders table and link the CustomerID columns and then add the OrderDate column to the report, everything works fine. But as soon as I add the OrderID or OrderDate column, the application crashes.
    Culprit seems to be MSVCR80.dll. Here's the log:
    Faulting application name: crw32.exe, version: 12.3.0.601, time stamp: 0x4bd05d31
    Faulting module name: MSVCR80.dll, version: 8.0.50727.4927, time stamp: 0x4a2752ff
    Exception code: 0xc000000d
    Fault offset: 0x00008aa0
    Faulting process id: 0x1944
    Faulting application start time: 0x01cb0139cfafeb40
    Faulting application path: C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\crw32.exe
    Faulting module path: C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5\MSVCR80.dll
    Report Id: 3b28c990-6d2d-11df-b9d8-00080d72c9f2
    Suggestions? Thanks in advance.

    Hello,
    It may be that something was "fixed" and our default xml file falls out of the Standards now.
    Are you wanting to connect to SQL or XML?
    Go to Microsoft's site and search for C++ distribution and download and install the recommended one for windows 7. It may be that part is corrupt or our installer thinks it is there. Try doing a Repair install and custom options to select all of the DB drivers and exports types to see if that resolves the issue.
    Thank you
    Don

  • Unable to work with ODAC, VS2008 and Oracle Database 10g XE

    I have downloaded and installed ODAC 11.1.0.6.21. I have followed the instructions in the 2 Day + .Net Developer's Guide (Chapter 3 - Building a Simple .NET Application Using ODP.NET) until I got to adding reference: when I added the Oracle.DataAccess 2.111.6.20, I observed that the new Refererence did not appear in Solution Explorer as described in the Guide.
    However I continued with the steps until I got to the testing phase, ran the form and entered Hr for User Id, Hr for Password and XE for data Source as I am running Oracle 10g XE. I got this error with every attempt: ORA-12154: TNS:could not resolve the connect identifier specified.
    From Server Explorer however, I can connect and see Schema Objects but when I right click Packages for eg, to create a procedure that uses a Ref Cursor I see only Refresh and Properties in the corresponding context menu, no New Package link!
    What could be the cause of all these?
    1. Is XE my correct Data Source?
    2. Why is the new Reference not visible in my solution explorer?
    3. Is my VS2008 or ODAC not configured/Installed Correctly?

    The tnsnames.ora file seem to be auto configured. However I tried updating it with Notepad when I changed my computer name to no avail. I had to revert back to my old computer name.
    This is the content of my tnsnames.ora:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = obinna)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    Please if there is any clause that need to be changed point it out for me.
    Thanks for your reply.

  • Animated GIF doesn't work against dark backgrounds in HTML

    I've created an animated GIF in Photoshop, exported it for web with transparency, and placed it in my HTML code. It doesn't work against the dark background on my page. However, when I open the image in a new browser tab, voila, the animation works precisely as it should.
    Why is the background affecting the animation and how can I work around this?

    Hello Frank,
    problem is solved.
    I have installed IE7 on a Windows 2003 Server Edition and used remote desktop client to test the application.
    It seems that either a setting on W2003 or the remote desktop client avoid to see the animation.
    On locally installed IE7 animated gif's works fine.
    regards
    Peter

  • Use PL/SQL procedure to guard against malformed CSV files before upload

    Hi all,
    In my CSV upload utility, I've implemented error checking procedures, but they are invoked only AFTER data has been uploaded to temp table. This doesn't catch the following sample scenarios:
    1. The CSV is malformed, with some rows shifted due to fields and separators missing here and there.
    2. User has chosen a wrong CSV to upload (most likely number of fields mismatch)
    I'm wondering if it is a good idea to have procedure to read in the CSV, scan each line, count the number of fields (null fields but with delimiters showing the field exist is ok) for each record. If every single record matches the required number of fields for that table, then the CSV is ok, and the insert from external table to temp table is allow. This will ensure at least the CSV file has a valid matrix size for the target table, but rest of error checking is left until after temp table is populated.
    One of my concerns is, I specify "missing field values are null" in the external table parameters, which is necessary since not all fields are required. Does this specification causes a row with missing trailing separators still considered valid? If so then the stored procedure must be programmed to omit such a case.
    What do you think? Many thanks.

    Hi, Cuauhtemoc Amox
    Thank you for your advice. I have set web adi  using PL SQL interface.
    I have decided to go futher
    i have a procedure like that
    procedure delete_old_data ( p_id in number, p_description in varchar2)
    as
    begin
                   begin
                   if g_flag ='N' then
                   delete from xx_test;
                    g_flag='Y';
                    else null;
                    end if;
                    end;
    insert into xx_test (p_id,p_descriptiom);
    end;
    G_FLAG is a global variable with default value ='N'  in my package. When web_adi upload
    first row from excel sheet, then procedure delete all data from table and change g_flag to 'Y'.
    All other rows uploads succesfully; it  works fine.
    But when user change data in excel sheet and try to upload second time. DELETE_OLD_DATA procedure doesnt work in proper way.
    I have found what problem is. when user use same template and try to upload data several times there is same SESSION_ID in database.
    i.e. g_flag ='Y' when user try to upload second time. But when user log off and create template again it is work properly.
    My question is: How i can different upload attempts? May be there is some id for each upload proccess.
    if i can use this ID in my procedure user will have opportunity to use same template.
    Thank you

  • Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)

    Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)

    Hi! first of all, thank you so much for your help.
    I don't know about that panel you are talking about.
    what I do is RIGHT CLICK, INTERACTIVE, NEW HYPERLINK, and a window pops up, where I paste the address (images).
    Where says URL I paste the complete address that the "sub page" gives me.
    Is that correct? (for the main page of the wabepage works correctly)
    thanks!!!

  • "Download Files"procedure not working in duplicate app/shows page not found

    Hello,
    I have created an application using the "Download files" procedure described in "How to Upload and Download Files in an Application" chapter of the APEX "Advanced Tutorials." It works just fine on the one server, however, when I exported the application and data from the working copy and imported it in APEX running from my laptop, I could upload files and generate a report with a link to click and download the files again but when I clicked on those links, I would get a "Page Not Found" error. It looks like it might not be going to the procedure and instead goes to a page like the following: "http://127.0.0.1:8080/apex/DBAPORTAL.download_image?p_id=1868612316946460." On the working copy on the other server, when the download link is clicked, you will get a dialog box asking if you would like to open or save the file.
    Could anybody tell me why the procedure is not being called and goes to a non existent url while the origonal application works just fine on the other server?
    I have granted APEX_PUBLIC_USER execute permissions to the procedure. I am wondering if there are any other permissions that I should be granting. Should I grant PUBLIC or ANONOMUSE permissions to use the "download_image" procedure?
    I have forgotten to mention that on my laptop I am using database 11.1 and on the server I believe the database is 10g.
    Hope to get an answer to this issue. I've asked a couple people already and they are stumped.
    Thank you in advance.
    Linda

    Scott,
    I have tried to follow the instructions commented out "RETURN FALSE;" and added procedure 'DOWNLOAD_IMAGE' to wwv_flow_epg_include_local.sql. But I'm confused. Should I be changing file "wwv_flow_epg_include_local.sql' or 'wwv_flow_epg_include_mod_local" package?
    When I run "ALTER SESSION SET DBAPORTAL FLOWS_030100;" in sqlplus, how do I know what FLOWS_XXX I have? Is it FLOWS_030100 or FLOWS_030000? I have database 11.1 installed. What version of APEX do I have with this database? How do I find out?
    Do I need to be in a perticular directory before I run the alter script? If so what folder?
    How do I "Compile the function wwv_flow_epg_include_local.sql.?"
    Needless to say, when I added the procedure to the file, and when I tried to alter it, I got the following error:
    SQL> ALTER SESSION SET DBAPORTAL FLOWS_030100;
    ALTER SESSION SET DBAPORTAL FLOWS_030100
    ERROR at line 1:
    ORA-02248: invalid option for ALTER SESSION
    Please tell me what I am doing wrong.
    Thanks
    Linda

  • Exec stored procedure from another stored procedure - not working

    Hey, we've got a bunch of .sql files that we run, and some of them are stored procedures. Our programs call the stored procedures from within the .sql files and that works, but we've tried calling a stored procedure from another stored procedure and it won't compile. The syntax looks the same, and we can run that second stored procedure from the SQL*Plus command prompt just fine, so we know it's in there. It doesn't matter whether we type exec or execute in the first stored procedure--it still gives us a compilation error. Here's the relevant bit of the code:
            delete CMHISTORYINDEX;
            commit;
            exec SP_DAILY_TOTAL;
    END SP_DAILY_CLOSING;
    /Here's where we go into SQL*Plus and try to compile it:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    SQL> @sp_daily_closing.sql
    Warning: Procedure created with compilation errors.
    SQL> show errors
    Errors for PROCEDURE SP_DAILY_CLOSING:
    LINE/COL ERROR
    34/7     PLS-00103: Encountered the symbol "SP_DAILY_TOTAL" when expecting
             one of the following:
             := . ( @ % ;
             The symbol ":=" was substituted for "SP_DAILY_TOTAL" to continue.
    SQL>We've also tried changing SP_DAILY_CLOSING to lowercase, but it doesn't seem to help. As I mentioned before, we can type that same sort of thing in .sql files that are not stored procedures and the exec is compiled fine and runs correctly. What are we doing wrong?

    In the stored procedure remove "exec" :
            delete CMHISTORYINDEX;
            commit;
            SP_DAILY_TOTAL;
    END SP_DAILY_CLOSING;

  • Oracle Stored Procedure not working

    Hi Guy's,
    I want to connect directly from Visual Composer to Oracle Database 10.2.x.x using Oracle Stored Procedure and JDBC System to demonstrate how easy you can show data vith VC. So I have created a simple Oracle Stored Procedure, a JDBC System with a valid alias, User mapping (Portal User --> Oracle User).
    When I invoke the stored procedure I receive the following error: "Portal request Failed (Could not execute stored procedure)". The Stored Procedure is working fine in Oracle iSQL*Plus.
    Any idea's?
    Thanks,
    Ridouan

    Hi,
    did you use the portal JDBC as it is described here:
    <a href="https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables">https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables</a>
    Best Regards,
    Marcel

  • MultiSelect Parameter with Stored Procedure not working

    I am using Crystal Reports 2008 and SQL Server 2008. I am using a stored procedure which works with a multiselect in SQL side. I am using a string to table utility function in the where clause with the In statment like below:
    WHERE FORMULARY_ID in
    --(@FORMULARY_ID)
      (SELECT Extractedtext
       FROM ClarityTST.[rpt].[LHfn_StringToTable]( @FORMULARY_ID, ',') ) 
    When I try to use the stored procedure I get an error message:
    "The stored procedure cannot accept multiple values. Please ensure that the multiple value is set to False:"
    I would like to use it with multiple parameters.

    Crystal uses arrays to handle multiple values.  As far as I'm aware, there is no way to get a multi-valued report parameter into SQL (command or SP) directly.  In the past, I have used a "shell" main report that gets the parameters, used Join() to concatenate the selected values into a single string, then pass that to the "main" subreport, and into its SQL or SP.  The SQL than would need to find the database field in the string.  If you make the string passed to the subreport valid SQL for an IN clause, you could do it that way, too.
    HTH,
    Carl

  • PL/SQL update not working against 9iR2 DB

    Hi,
    I am having a weird problem with several forms when run against a 9iR2 database. I have worked out that the problem only happens when referencing an unbound item in the WHERE clause of the update clause. For example:
    UPDATE table_a
    SET column_a = 'A value'
    WHERE column_b = :block.unbound_item;
    When I generate forms from Designer with this type of PL/SQL in a when-button-pressed trigger, it works fine against an 8.1.7 DB but does not update the record against a 9iR2 DB. If I put a specific value in the WHERE clause instead of referencing the unbound item, then it works. It also works if I put the value of the unbound item in a variable and then use the variable in the WHERE clause.
    If I create a simple form using Form Builder, which does not link to Headstart libraries, then it does work against a 9iR2 DB. I also tried generating a simple form out of Designer from a container not linked to Headstart libraries and that worked as well.
    Has anyone come across this sort of thing before?
    Thanks.
    Pierre.

    Pierre,
    I have heard from another customer that had a similar problem. I have not had time yet to investigate his solution, but maybe it can help you:
    For the other customer it seems to work fine if the update raises a CAPI error, but it does not work if the update raises a server error or a TAPI error (PK/UK/FK violation). The problem is that the rollback in abort_transaction is not executed.
    The other customer proposes the following solution:
    * in abort_transaction, don't clean up the error messages
    * in the exception handler of the button code, place the abort_transaction before the unhandled_exception.
    Pierre, do you also use CDM RuleFrame? Can you try if the tips of the other customer work for you?
    It sounds to me like this is a workaround for a database bug, which is OK, but it's better if the database bug is fixed. I would advise you to also check the available patches for 9iR2, or maybe report a bug yourself so a patch can be made in the future.
    It may also be related to the optimizer mode. See thread Transactions fail when OPTIMIZER_MODE=choose .
    Hope this helps,
    Sandra Muller

  • Do new ODAC 11 feature work against Database 10.2

    Hi,
    Do features new in ODAC 11 work against Database 10.2. I'm mainly interested in "End-to-End Tracing using Action and Module attributes"
    Thanks

    Here's a real quick and dirty knock up using ODAC 2.111.6.20 against a 10.2.0.3 database:
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace Miscellaneous
      class Program
        static void Main(string[] args)
          string constr = "User Id=scott; " +
                          "Password=tiger; " +
                          "Data Source=lt10gr2; " +
                          "Pooling=false; " +
                          "Enlist=false";
          OracleConnection con = new OracleConnection(constr);
          con.Open();
          con.ActionName = "MyAction1";
          con.ModuleName = "MyModule1";
          OracleCommand cmd1 = con.CreateCommand();
          cmd1.CommandText = "select user from dual";
          OracleDataReader dr = cmd1.ExecuteReader();
          while (dr.Read()) ;
          con.ActionName = "MyAction2";
          con.ModuleName = "MyModule2";
          OracleCommand cmd2 = con.CreateCommand();
          cmd2.CommandText = "select sysdate from dual";
          dr = cmd2.ExecuteReader();
          while (dr.Read()) ;
          Console.WriteLine("ENTER to continue...");
          Console.ReadLine();
    }I enabled tracing for the session and here are a couple of snippets from the trace file:
    *** ACTION NAME:(MyAction1) 2008-01-24 21:08:01.033
    *** MODULE NAME:(MyModule1) 2008-01-24 21:08:01.033
    -- snip --
    *** ACTION NAME:(MyAction2) 2008-01-24 21:08:01.049
    *** MODULE NAME:(MyModule2) 2008-01-24 21:08:01.049
    ...Whilst obviously not extensive, I think this is the expected result...
    - Mark
    EDIT:
    Just to be clear... this feature works with previous releases of the database; however, there are other features exposed via ODP.NET (or available to ODP.NET) such as the client side cache which will not work with previous releases. Possibly being pedantic, but thought it might be a good idea to state that anyway.
    - Mark

  • SET_UPDATE_CONFLICT_HANDLER is making all procedures invalid

    Oracle version 10.2.0.3
    DECLARE
    cols DBMS_UTILITY.NAME_ARRAY;
    BEGIN
    cols(1) := 'EMP_PK';
    cols(2) := 'TIMESTAMP';
    DBMS_APPLY_ADM.SET_UPDATE_CONFLICT_HANDLER(object_name => 'SEMP.EMP',method_name => 'MAXIMUM', resolution_column => TIMESTAMP, column_list =>cols);
    END;
    This is making all procedure using that table invalid.

    Check if you are modifying any other column as well. May be if you have LOG_ID column or something like this. Try to add all table columns in the column list.
    The other way is to try to exclude columns with DBMS_APPLY_ADM.COMPARE_OLD_VALUES() procedure.
    Svetoslav

Maybe you are looking for

  • How to gain different permissions than the user's current logon provides?

    I have a computer on a local network which contains a shared folder, and I've granted reading permissions for all users. How can I grant a certain Java application, or gain from a certain application, which a user running on a different computer, per

  • What is "Publish To New Folder?"

    Captivate's *Edit/Preferences/Global* preferences include options for the user to review a confirmation dialog before the software proceeds to execute a variety of user actions, mostly actions that would delete an asset or change an important setting

  • Raw Files Appear Deleted or Corrupted Suddenly in Aperture with Unsupported Image Format Error

    I have been using Aperture 3, latest update, for the past year. Today, I tried to import new raw files from my new Sony RX1r and, as far as I can see, all raw files in Aperture give the "Unsupported Image Format" and alert symbol in the library where

  • Firefox style jtabbed pane questions

    hey i am wondering if it is possible to create in java tabbed pane that can be closed independentaly for example firefox tabs, they can be closed by an X button on the right

  • How do I reset Airport Extreme Model A1034?

    How do I reset Airport Extreme Model A1034? I am using a MacBook Pro to set up the airport, but, I get this message: "This version of AirPort Utility doesn't support this base station. Go to AirPort Service and Support for more information."