Stored Procedure At Runtime !!!!

Hi all,
I want to create a stored procedure or function at run time!!
Which mean when the user click a button, it will reflect a dynamically created stored procedure or function in the data base.
But APex processes cannot do that,Can anyone help me??
thanks & Regards,
Ola

Hi Lev,
The user cannot enter any SQL or PL/SQL , he only can enter Mathematical equations like "a=100+(v*25)/2"
where a and v are predefined variables, actually it is a dimmed text box and he drag and drop elements into it.
Then I have to validate this equation before converting it to PL/SQL anonymous block or procedure.
But my question is if i use anonymous blocks,how can i execute it later on
for example if we saved the previous equation as 'e1' how can i say "x=e1(10)".
Regards,
Ola

Similar Messages

  • How to debug Stored Procedures on Runtime?

    Is there any way or any tool available using which I could debug stored procedures on runtime ? Please also pass the links if you know any.

    Check out the PL/SQL Developer tool:
    http://www.allroundautomations.nl/plsqldev.html
    You can download a fully functional version for a 30 day trial. Much less expensive than TOAD, and better yet, it actually works (the TOAD PL/SQL debugger in version 8 is so buggy as to render it useless)

  • Access stored procedure in runtime

    I would like to know how I can access the stored procedure in the runtime and is there any way to call the stored procedure from fx (edit formula button).Otherwise, any suggestion is much appreciated.
    Thanks and Regards

    Hi All,
    Problem is solved after adding files to microsoft access 2000 runtime. runtime missing some DLLs related to sql server 2000 to update those files follow the links below
    http://support.microsoft.com/?kbid=287484
    http://www.microsoft.com/office/orkarchive/2000ddl.htm#accsql
    Thanks,
    Brahma

  • Invoking "java myClass" using Runtime.Exec from a Java Stored Procedure

    Hi All,
    This is regarding the use of Runtime.getRunTime().exec, from a java programme (a Java Stored Procedure), to invoke another Java Class in command prompt.
    I have read many threads here where people have been successuful in invoking OS calls, like any .exe file or batch file etc, from withing Java using the Runtime object.
    Even i have tried a sample java programme from where i can invoke notepad.exe.
    But i want to invoke another command prompt and run a java class, basically in this format:
    {"cmd.exe","java myClass"}.
    When i run my java programme (in command prompt), it doesnt invoke another command prompt...it just stays hanging.
    When i run the java programme from my IDE, VisualCafe, it does open up a command prompt, but doesnt get the second command "java myCLass".
    Infact on the title of the command prompt (the blue frame), shows the path of the java.exe of the Visual Cafe.
    and anyway, it doesnt run my java class, that i have specified inside the programme.
    Even if i try to run a JAR file, it still doesnt do anything.
    (the JAR file other wise runs fine when i manually invoke it from the command prompt).
    Well, my question is, actually i want to do this from a Java Stored Procedure inside oracle 8.1.7.
    My feeling is, since the Java Stored Procedure wont be running from the command prompt (i will be actually invoking it through a Oracle trigger), it may be able to invoke the command prompt and run the java class i want. and that java class has to run with the SUn's Java, not Oracle JAva.
    Does any one have any idea about it?
    Has anyone ever invoked a java class or JAR file in command prompt from another Java Programme?
    YOur help will be highly appreciated.
    (P:S- Right now, my database is being upgraded, so i havent actually been able to create a Java Stored procedure and test it. But i have tested from a normal java programme running in command prompt and also from Visual Cafe).
    Thanks in advance.
    -- Subhasree.

    Hello Hari,
    Thanks for your quick reply.
    Can you please elaborate a little more on exactly how you did? may be just copy an dpaste taht part of teh code here?
    Thanks a lot in advance.
    --Subhasree                                                                                                                                                                                                                                                                                                                                                                                                           

  • WCF OData Service stored procedure call generates "Operation could destabilize the runtime" error with $select option

    I've been trying to call a stored procedure through Entity Framework and WCF Data Services (OData). It returns an entity not a complex type. Following walkthroughs found all over the web, I came up with this code inside my service:
    [WebGet]
    public IQueryable<Entity> GetEntitiesByParameterId(int parameterId)
    return CurrentDataSource.GetEntitiesByParameterId(parameterId).AsQueryable();
    Calling the proc this way: ~WcfService.svc/GetEntitiesByParameterId?parameterId=1 executes
    the stored procedure and returns entities that should be returned. No problem there.
    Everything works well until I try to use $select OData option ie. ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$select=name.
    Upon debugging, the method above runs without any error but it returns an Operation could destabilize the runtime error upon reaching the
    client. After so much research, apparently it is a very general error pointing to a lot of different causes. I haven't found one that really matches my particular problem. Closest are 
    http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime
    https://social.msdn.microsoft.com/Forums/en-US/d2fb4767-dc09-4879-a62a-5b2ce96c4465/for-some-columns-entity-properties-executestorequery-failed-with-error-operation-could?forum=adodotnetdataservices 
    but none of the solutions worked on my end.
    Also, from the second article above:
    This is a known limitation of WCF DS. ...
    Second is that some of the queries won't work correctly because LINQ to EF needs little different LINQ expressions than LINQ to Objects in some cases. Which is the problem you're seeing.
    It has been posted on 2012. If it its true, are there still no updates on this? And is there any other workaround to get the $select working on the stored proc call?
    What works:
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$top=1
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$skip-5
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$filter={filter query}
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$expand=SomeNavigationProperty
    What doesn't work:
    ~WcfService.svc/GetEntitiesByParameterId?parameterId=1&$select=name
    Tech details:
    EntityFramework 5, WCF Data Service 5.0, OData V3
    *I've also tried upgrading to EF6 and WCF 5.6.2 and it still didn't work.
    Any help would be appreciated. Thanks!

    Someone from SO replied to my question there and said that $select is still not supported though I couldn't find any definitive documentation about it.
    From what I gather and observed, $select breaks the stored procedure call because it tries to alter the data shape already gotten from the database and attempts to return a dynamic entity instead. Something about the stored proc returning an ObjectResult might
    be messing it up. As I have said, these are merely my observations.
    Workaround: I found a simple and elegant workaround for it though. Since my stored procedures are only getting data from the database and does
    not alter data in any way (INSERT, UPDATE, DELETE), I tried using table-valued functions that returns a table equivalent to the entity on my EF. I've found that calling this function on the Service Operation method returns an IQueryable<Entity> which
    is basically what is needed. $select also works now and so does other OData query options.
    Steps:
    Create a function on the database
    Update EDMX -> Add function
    Add new Function Import with Entity return type
    Create service operation in WCF Data Service that calls CurrentDataSource.<FunctionName>()
    Test in fiddler.
    CODES
    Database Function:
    CREATE FUNCTION GetEntities(@parameter)
    RETURN @entites TABLE(
    [Id] [int],
    [Name] [nvarchar](100),
    AS
    BEGIN
    INSERT INTO @entities
    SELECT [Id], [Name], ... FROM [EntityTable]
    RETURN
    END
    WCF:
    [WebGet]
    public IQueryable<Entity> GetEntity(int parameter)
    return CurrentDataSource.GetEntity(parameter);
    It doesn't really solve the stored procedure problem but I'm marking this as answer until someone can provide a better one as it does solve what I'm trying to do.
    Hope this helps others too. :)

  • Firing Stored Procedure Into Database At Runtime

    HI All,
    I need a help !. I have created a stored procedure that creates a dynamic SP at runtime depending upon certain values stored in my database. Now I want that as soon as the dynamic SP is written in a flat file on the database server it should be compiled into database.
    What I am doing right now is :
    step1: create a SP
    step2: fetch values from database
    step3: create a string from it which actually contains syntax for creating another SP
    step4: open a new file "test.sql" on the database server
    step5: write this string into "test.sql"
    step6: close the file "test.sql"
    step7: exit SP
    This creates a file named "test.sql" on oracle database server.
    Now my requirement is to include another step after step6 say
    step6.1: compile "test.sql" into the database.
    Does any one have idea how to achieve this using SP.
    Thanks & regards
    Vivek Verma

    I don't know which solution you're attempting, but here goes.
    You cannot build a procedure using objects (e.g. tables, views) etc when you have been granted rights to them via role. Similarly you cannot use execute immediate to use a system privilege (e.g. CREATE PROCEDURE) if you have been granted it through a role (e.g. CONNECT).
    In both cases the relevant solution is to get the grantor (table owner, dba user) to grant the privilege to your account by name.
    Cheers, APC

  • Runtime.Exec() fails -- Through java stored procedure in Oracle8i

    HI,
    I HAVE A JAVA STORED PROCEDURE WHICH EXECUTES
    A HOST COMMAND USING Runtime.Exec().
    BUT IT IS NOT WORKING.
    RIGHTS FOR THE USER HAVE BEEN GIVEN USING
    Dbms_grant_persmission(). The database in on
    SUN SOLARIS. THE EXITVALUE OF THE RUNTIME.EXEC COMMAND IS 255(SEGMENTATION
    ERROR - CORE DUMPED).
    PLEASE LET ME KNOW WHERE THE PROBLEM LIES. THE FUNCTION IS WORKING WELL IF THE DATABASE IS ON NT PLATFORM BUT FAILS TO WORK WHEN I STORED THE PROCEDURE IN A DATABASE RUNNING ON SUN SOLARIS AND TRIED TO EXECUTE A SOLARIS COMMAND THROUGH THE PROCEDURE.
    Thanks for ur interest!
    with best regards,
    Mathan

    I have similar problem on HP-UX, I would appreciate if you
    somehow were able to solve it.
    Thanks
    Rahul Shah

  • How do I modify a report to show new fields in a stored procedure?

    The server uses Crystal Reports Embedded Server 2008 SP3 (running on Windows Server 2008 R2 / IIS 7.5), and I am using Crystal Reports Developer 2008 SP3 on my PC.
    Hello,
    I am a MSSQL database administrator with little experience with Crystal Reports.  At my job, we have a need to add a couple of fields to a report.  The report comes with an enterprise procurement web-based application and displays the details of a given purchase order.  They want me to add the supplieru2019s address below the supplieru2019s name on the report.  I was hoping there might be a fairly straight-forward, not overly complicated answer to my question.
    The report works with a stored procedure (OrderForm1) which creates a temp table called #ReportParameters.  It then executes another stored procedure (GetReportParameters), in which it uses 'sp_xml_preparedocument' and eventually 'sp_xml_removedocument'.  It then executes a stored procedure called  (OrderForm1Main) which contains the select statement that brings in the bulk of the fields and joining the pertinent tables.  I made a backup copy of OrderForm1Main and modified the original, to include the supplier address fields.
    Don't know if I'm on the right track, but hereu2019s what I tried so far:
    When I open the OrderForm1.rpt in Crystal Designer, I have found that I can go to Database > Set Datasource Location, create a connection (OLE DB (ADO)) to the database, highlight the name of the stored procedure under u2018Current Data Sourceu2019, then find the same stored procedure in the database in the section u2018Replace withu2019:
    http://i.imgur.com/KXBuf.png
    When I clicked the u2018Updateu2019 button, a u2018Enter Valuesu2019 for parameters window pops up:
    http://i.imgur.com/5uQ9V.png
    Iu2019m confused as to what to do at this part.  Whether I click u2018OKu2019 or u2018Cancelu2019, it then adds my database connection with stored procedure to the list in the u2018Current Data Sourceu2019 section:
    http://i.imgur.com/aD4KH.png
    After completing this data source change, in the Field Explorer under Database Fields > OrderForm1, it then includes the new fields I added to the stored procedure.  However, when dragging the new supplier address fields to the report layout, saving the report in this state, and trying to run it in the web application, the report window displays the message u2018Missing parameter valuesu2019 instead of the report:
    http://i.imgur.com/gz8S3.png
    In Field Explorer > Database Fields > Parameters, Iu2019m seeing a list of parameters that arenu2019t the exact ones in the stored procedure, which leads me to believe, they are somehow defined in the report itself.  Also, under u2018Parameter Fieldsu2019 in the Fields Explorer there is the @fParameters listing with a question mark icon, that appeared since the data source change:
    http://i.imgur.com/llkrk.png
    There does not seem to be an equivalent set of parameters in the database, as there were defined in the report.  I imagine that the actual parameter values come from the data held in the currently displayed purchase order (from which you can push a button 'Print PO' that will display the report in question).  I have read that when you change a data source in Crystal, you have to complete the task of resetting, or adding back in the parameters.  That would be easy if they were in the database somewhere.  Whenever I attempt to look at the properties of the u2018ReportInformationu2019 in u2018Set Datasource Locationu2019, or simply try Database > 'Verify Database' to refresh the datasource, an u2018ADO.NET (XML) windows pops up with a file path in it, something to the effect of:
    MyLoanerLaptop\ebo bk\orderform1.xml:
    http://i.imgur.com/SEVOE.png
    I did a search on the entire server for the file OrderForm1.XML and could not find it anywhere.  So Iu2019m thinking that the software companyu2019s development team used that file originally, to create the report (did they use a dataset to do this, or is the temporary XML file created during the process actually the schema here?).  I think Iu2019m basically trying to change the data source in the report, to an updated version of the original stored procedure referenced, while still somehow leaving the parameters list in the report alone and have them still work?
    Any and all help would be greatly appreciated.  I realize that this type of work most likely is routine stuff that can be learned by taking the time to do so.  My team is only interested in allowing me a certain amount of time and resources to delve into Crystal and we do not have a Crystal dev team.  So, hopefully you understand my dilemma here.
    Thank you,
    Mike
    Edited by: Mike_DBA on Jan 23, 2012 8:03 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:05 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:11 PM (2:12 pm EST)
    Edited by: Mike_DBA on Jan 23, 2012 8:13 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:18 PM
    Edited by: Mike_DBA on Jan 23, 2012 8:30 PM
    Edited by: Mike_DBA on Jan 23, 2012 10:58 PM

    Hi Mike,
    CRSE is an OEM Product and for use with a custom application they have written. Unfortunately we don't their reports or how they are connecting, it would appear they were originally built off a SQL and then set to a Dataset in the app or they could be adding the data source at runtime. Lots of variations and without access to the source code to see what they are doing not much we can help you with.
    You need to contact the OEM Partner for help in resolving this and find out what you can and need to do to update your SP and work with their canned reports,
    Thank you
    Don

  • Executing batch file from Java stored procedure hang

    Dears,
    I'm using the following code to execute batch file from Java Stored procedure, which is working fine from Java IDE JDeveloper 10.1.3.4.
    public static String runFile(String drive)
    String result = "";
    String content = "echo off\n" + "vol " + drive + ": | find /i \"Serial Number is\"";
    try {
    File directory = new File(drive + ":");
    File file = File.createTempFile("bb1", ".bat", directory);
    file.deleteOnExit();
    FileWriter fw = new java.io.FileWriter(file);
    fw.write(content);
    fw.close();
    // The next line is the command causing the problem
    Process p = Runtime.getRuntime().exec("cmd.exe /c " + file.getPath());
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line;
    while ((line = input.readLine()) != null)
    result += line;
    input.close();
    file.delete();
    result = result.substring( result.lastIndexOf( ' ' )).trim();
    } catch (Exception e) {
    e.printStackTrace();
    result = e.getClass().getName() + " : " + e.getMessage();
    return result;
    The above code is used in getting the volume of a drive on windows, something like "80EC-C230"
    I gave the SYSTEM schema the required privilege to execute the code.
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'java.io.FilePermission', '&lt;&lt;ALL FILES&gt;&gt;', 'read ,write, execute, delete');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC DBMS_JAVA.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    GRANT JAVAUSERPRIV TO SYSTEM;
    I have used the following to load the class in Oracle 9ir2 DB:
    loadjava -u [system/******@orcl|mailto:system/******@orcl] -v -resolve C:\Server\src\net\dev\Util.java
    CREATE FUNCTION A1(drive IN VARCHAR2) RETURN VARCHAR2 AS LANGUAGE JAVA NAME 'net.dev.Util.a1(java.lang.String) return java.lang.String';
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    The problem that it hangs when I execute the call to the function (I have indicated the line causing the problem in a comment in the code).
    I have seen similar problems on other forums, but no solution posted
    [http://oracle.ittoolbox.com/groups/technical-functional/oracle-jdeveloper-l/run-an-exe-file-using-oracle-database-trigger-1567662]
    I have posted this in JDeveloper forum ([t-853821]) but suggested to post for forum in DB.
    Can anyne help?

    Dear Peter,
    You are totally right, I got this as mistake copy paste. I'm just having a Java utility for running external files outside Oracle DB, this is the method runFile()
    I'm passing it the content of script and names of file to be created on the fly and executed then deleted, sorry for the mistake in creating caller function.
    The main point, how I claim that the line in code where creating external process is the problem. I have tried the code with commenting this line and it was working ok, I made this to make sure of the permission required that I need to give to the schema passing security permission problems.
    The function script is running perfect if I'm executing vbs script outside Oracle using something like "cscript //NoLogo aaa1.vbs", but when I use the command line the call just never returns to me "cmd.exe /c bb1.bat".
    where content of bb1.bat as follows:
    echo off
    vol C: | find /i "Serial Number is"
    The above batch file just get the serial number of hard drive assigned when windows formatted HD.
    Same code runs outside Oracle just fine, but inside Oracle doesn't return if I exectued the following:
    variable serial1 varchar2(1000);
    call A1( 'C' ) into :serial1;
    Never returns
    Thanks for tracing teh issue to that details ;) hope you coul help.

  • Trying to use Java Stored Procedure to create  directories

    Hello, I have the followqing simple Java code I am using to run OS commands from PL SQL. When I call my function, it does not create the directory, but it does say completed successfully. Here is the code and the call I am using:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED Command
    AS
    import java.io.*;
    import java.util.*;
    public class Command{
    public static void run(String cmdText)
    throws IOException, InterruptedException
    try {
    int rtn;
    Runtime rt = Runtime.getRuntime();
    Process prcs = rt.exec(cmdText);
    rtn = prcs.waitFor();
    catch ( Throwable ex ) {
    ex.printStackTrace();
    CREATE OR REPLACE FUNCTION runoscommand(cmd IN VARCHAR2) RETURN NUMBER
    AS LANGUAGE JAVA
    NAME 'Command.run(java.lang.String) return int';
    DECLARE
    v_directory VARCHAR2(100):= 'C:\SYSTEM Interface\PL\files\';
    v_rtn VARCHAR2(2000);
    v_oscmd VARCHAR2(420);
    BEGIN
                v_oscmd := 'mkdir "' || v_directory || '"';
                dbms_output.put_line(v_oscmd);
                SELECT runoscommand(v_oscmd) INTO v_rtn FROM DUAL;
                dbms_output.put_line(v_rtn);
    END;
    /Any ides on why this is not working? Any better suggestions for doing this? I need to be able to create directories from with in a PL SQL Stored Procedure. Thank you

    Simple dude, you java code returns void, whereas your function returns an int. Change the java code to return an int (and return an int)

  • Crystal Report Source is MS SQL Stored Procedure Causes Login Popup

    My environment is this:  Visual Studio 2010 with CRforVS_13_0_9 installed.  MS SQL Server is source for all report data.  I use three different databases for all my reports.
    I have a number of working CR reports that work fine in IDE and at runtime.  However, one report works in IDE report designer Main Report Preview but does not work at runtime.  Instead, it pops up the Database Login dialog box.  This particular report is the only one that I have that uses a Stored Procedure for report source data.  The following code is used for all reports.  Can someone please help me to identify what is causing this anomaly?
         ' _Options contains parameter name and value pairs, if any
         Dim oReport As New ReportDocument()
         Dim FullReportName = "MA_CustomerUsage"
         oReport.Load(FullReportName, OpenReportMethod.OpenReportByDefault)
         DoCRLogin(oReport)
         If _Options.ParameterList IsNot Nothing Then ImplementCRParameters(oReport)
         With CrystalReportViewer
              .SelectionFormula = _SelectionFormula
              .ReportSource = oReport
              .Zoom(zoomPageWidth)
              .ShowParameterPanelButton = False
              .ToolPanelView = ToolPanelViewType.None
         End With
         Private Sub DoCRLogin(ByVal oRpt As ReportDocument)
                Dim oCRDb As Database = oRpt.Database
                Dim oCRTables As Tables = oCRDb.Tables
                Dim oCRTableLogonInfo As CrystalDecisions.Shared.TableLogOnInfo
                Dim DatabaseName = oCRTables(0).LogOnInfo.ConnectionInfo.DatabaseName
                Dim oCRConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo() _
                    With {.DatabaseName = ScanInvenConStrSetting("Initial Catalog=", DatabaseName),
                          .ServerName = ScanInvenConStrSetting("Data Source=", DatabaseName),
                          .IntegratedSecurity = True}
                For Each oCRTable As Table In oCRTables
                    oCRConnectionInfo.DatabaseName = oCRTable.LogOnInfo.ConnectionInfo.DatabaseName
                    oCRTableLogonInfo = oCRTable.LogOnInfo
                    oCRTableLogonInfo.ConnectionInfo = oCRConnectionInfo
                    oCRTable.ApplyLogOnInfo(oCRTableLogonInfo)
                Next
         End Sub
         Private Sub ImplementCRParameters(ByRef oReport As ReportDocument)
                Dim oparamFields = New ParameterValues
                Dim oFieldDefs = oReport.DataDefinition.ParameterFields
                For Each CRParameter In _Options.ParameterList
                    Dim oFieldDef = oFieldDefs("@" & CRParameter.Name)
                    Dim oDiscrete As New ParameterDiscreteValue()
                    oDiscrete.Value = CRParameter.Value.ToString
                    oparamFields.Add(oDiscrete)
                    oFieldDef.ApplyCurrentValues(oparamFields)
                Next
         End Sub
         Private Function ScanInvenConStrSetting(ByVal Src As String, ByVal DBName As String) As String
                Dim MyDB As String = String.Empty
                Select Case DBName.ToUpper
                    Case "Database1".ToUpper
                        MyDB = Global.My.Settings.Database1ConnectionString
                    Case "Database2".ToUpper
                        MyDB = Global.My.Settings.DatabaseConnectionString
                    Case "Database3".ToUpper
                        MyDB = Global.My.Settings.Database3ConnectionString
                End Select
                Dim ndx1 As Integer = InStr(MyDB, Src, CompareMethod.Text) + Src.Length
                Dim ndx2 As Integer = InStr(ndx1, MyDB, ";", CompareMethod.Text)
                If ndx2 = 0 Then ndx2 = MyDB.Length
                ScanInvenConStrSetting = Mid(MyDB, ndx1, ndx2 - ndx1)
         End Function

    Check what else is different with the report:
    1) Connection type (ODBC vs. OLEDB, vs. Native, etc)
    2) Check for subreports
    3) Check that the report uses the SQL Native 10 Driver
    Enable the report options "Verify on 1st refresh" and "Verify stored procedure on 1st refresh".
    Comment out the db logon code as well as the parameter code and let the report prompt. Does that work?
    If it does, add the db logon code but leave the param code commented out. Does that work?
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Null pointer in setTableLocation for a report based on a stored procedure

    im using the crjavahelper class and setTableLocation to change the datasource of a stored procedure based report and its throwing a null pointer exception somewhere in the sdk.  This is happening with sqljdbc4.jar and sql2005 and jdk 1.6.
    Jan 20, 2010 12:43:37 PM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NullPointerException
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.do(SourceFile:4605)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:621)
         at com.crystaldecisions.sdk.occa.report.application.b0.if(SourceFile:75)
         at com.crystaldecisions.sdk.occa.report.application.b0.b(SourceFile:106)
         at com.crystaldecisions.sdk.occa.report.application.bb.int(SourceFile:96)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:151)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:2159)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:543)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(SourceFile:3898)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.setTableLocation(SourceFile:2906)
         at com.businessobjects.samples.CRJavaHelper.changeDataSource(CRJavaHelper.java:191)
         at org.apache.jsp.index_jsp._jspService(index_jsp.java:114)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    any ideas? I tried using the jtds driver and it doesnt throw the exception but it doesnt return any data either, ive never gotten a stored procedure based report to work with it.
    Jeremy

    Check out this forum post:
    Problem using Null as a parameter with a stored procedure

  • ERROR WHILE INSERTING BLOBS AS PARAMETERS OF EXISTING STORED PROCEDURE

    I have 2 simple tables to keep large application data (as XMLDOCUMENT in one table and BLOB in another):
    SQL> desc bindata_tbl;
    Name Null? Type
    BDATA_ID NOT NULL NUMBER(10)
    BDATA NOT NULL BLOB
    SQL> desc metadata_tbl;
    Name Null? Type
    MDATA_ID NOT NULL NUMBER(10)
    MDATA NOT NULL SYS.XMLTYPE
    and stored preocedure to input new data into those tables:
    "SP_TEST_BIN_META_DATA"
    i_MetaData in METADATA_TBL.MDATA%TYPE,
    i_BinData in BINDATA_TBL.BDATA%TYPE
    as
    begin
    if i_MetaData is not null then
    insert into METADATA_TBL (MDATA_ID, MDATA)
    values (METADATA_SEQ.nextval, i_MetaData);
    end if;
    if i_BinData is not null then
    insert into BINDATA_TBL (BDATA_ID, BDATA)
    values (BINDATA_SEQ.nextval, i_BinData);
    end if;
    COMMIT;
    -- Handle exceptions
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    RAISE;
    end;
    I communicate with database from .Net application using "Oracle.DataAccess 10.1.0.200 (Runtime version v1.0.3705)" component.
    Following procesure is a [simplified] examlple of the code I use, which demonstrates the errors while inserting XMLDOCUMENT and BLOB values simultaneously.
    In my application those should be quite big objects (~200 K XML and ~5-25M binary image data), but following sample keeps failing even with very small-sized objects:
    Line Number
    1          private void PureTest()
    2          {
    3               OracleConnection conn = null;
    4               OracleTransaction tx = null;
    5               OracleCommand command = null;
    6
    7               try
    8               {
    9                    // Open connection
    10                    string strConn = "Data Source=AthenaWf; User ID=AthenaWf; Password=Poseidon";
    11                    conn = new OracleConnection( strConn );
    12                    conn.Open();
    13
    14                    // Begin transaction (not sure if really needed)
    15                    tx = conn.BeginTransaction();
    16
    17                    // Create command
    18                    string strSql = "SP_TEST_BIN_META_DATA";
    19                    command = new OracleCommand();
    20                    command.Connection = conn;
    21                    command.CommandText = strSql;
    22                    command.CommandType = CommandType.StoredProcedure;
    23
    24                    // Create parameters
    25                    // 1) XmlType parameter
    26                    string strXml = "<?xml version=\"1.0\"?><configuration testValue=\"123456789\"/>";
    27                    XmlDocument xmlDoc = new XmlDocument();
    28                    xmlDoc.LoadXml( strXml );
    29                    OracleXmlType oraXml = new OracleXmlType( conn, xmlDoc );
    30                    //oraXml = null;
    31                    //
    32                    OracleParameter xmlPrm = new OracleParameter();
    33                    xmlPrm.ParameterName = "i_MetaData";
    34                    xmlPrm.Direction = ParameterDirection.Input;
    35                    xmlPrm.OracleDbType = OracleDbType.XmlType;
    36                    xmlPrm.Value = oraXml;
    37                    command.Parameters.Add( xmlPrm );
    38
    39                    // 2) Blob type
    40                    byte[] buf = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    41                    OracleBlob oraBlob = new OracleBlob( conn, true );
    42                    //oraBlob.Write( buf, 0, buf.Length );
    43                    oraBlob = null;
    44                    //
    45                    OracleParameter blobPrm = new OracleParameter();
    46                    blobPrm.ParameterName = "i_BinData";
    47                    blobPrm.Direction = ParameterDirection.Input;
    48                    blobPrm.OracleDbType = OracleDbType.Blob;
    49                    blobPrm.Value = oraBlob;
    50                    command.Parameters.Add( blobPrm );
    51
    52
    53                    // Execute command finally
    54                    command.ExecuteNonQuery();
    55                    tx.Commit();
    56               }
    57               catch( Exception ex )
    58               {
    59                    // Clean-up
    60                    if( command != null )
    61                    {
    62                         command.Dispose();
    63                    }
    64                    if( tx != null )
    65                    {
    66                         tx.Dispose();
    67                    }
    68                    if( conn != null )
    69                    {
    70                         conn.Dispose();
    71                    }
    72
    73                    // Display error message
    74                    MessageBox.Show( ex.Message, "Error" );
    75               }
    76          }
    If I try insert only XMLDOCUMENT object (lines 30, 42 are commented out, 43 IS NOT) - everything is OK.
    If I try to insert only BLOB object (lines 30, 42 are NOT COMMENTED OUT, line 43 is commented out) - everything is OK again.
    If I try to insert them both having some values (lines 30, 43 are commented out, 42 is not commented out) - it fails right on "command.ExecuteNonQuery();" (line 54)
    with the following exception:
    "ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%]".
    Even when I nullify oraBlob before assigning it to OracleParameter value (line 30 is commented out, line 42 and 43 are not) I have the same exception.
    XMLDOCUMENT and DLOB data logically are very coupled objects (in my application), so I really want to insert them simultaneously in one stored procedure in transactional way.
    Is it bug of drivers, server, .net environment, or I miss something in implementation?
    PS. In some articles on Oracle web and in MSDN site I found a mention about necessity of wrapping all write/update operations in a transaction, while working with temporary LOBs. I use it here, but it does not look like changing anything.

    Hello,
    I tested your code with the 10.1.0.4.0 ODP and 10.1.0.4.0 Client and it worked fine.
    Can you please apply the 10.1.0.4.0 patches for both ODP and client to see if this resolves the issue for you.
    Here is the output from the same execution of the ODP application you provided as a testcase. These rows were inserted at the same time when I executed the application and passed the data as parameters to the SP you provided.
    Results of Testing with 10.1.0.4.0
    ==========================
    SQL> select count(*) from BINDATA_TBL
    2 ;
    COUNT(*)
    1
    SQL> select count(*) from METADATA_TBL;
    COUNT(*)
    1
    SQL> select dbms_lob.getlength(bdata) from BINDATA_TBL;
    DBMS_LOB.GETLENGTH(BDATA)
    10
    SQL> select mdata from METADATA_TBL;
    MDATA
    <?xml version="1.0"?><configuration testValue="123456789" />

  • Calling a java class in my oracle database from a oracle stored procedure

    my oracle stored procedure is:
    create or replace
    PROCEDURE openpdffile
    AS LANGUAGE JAVA
    NAME 'pdfopenbook.mainbook()';
    it is valid and so is this java class;
    import java.sql.*;
    import oracle.jdbc.*;
    public class pdfopenbook //class pdfopen
    public static void mainbook(String args[]) //main function
    try //try statement
    Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + "c:\\temp
    final_book.pdf");
    // Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + "sol.exe");
    } catch (Exception e) //catch any exceptions here
    System.out.println("Error" + e ); //print the error
    but i get the error:
    onnecting to the database caprs.
    ORA-29531: no method mainbook in class pdfopenbook
    ORA-06512: at "CAPRS.OPENPDFFILE", line 1
    ORA-06512: at line 2
    Process exited.
    Disconnecting from the database caprs.
    it says there is no mainbook method but there is, what am i doing wrong??
    Thanks,
    Doug

    Pass String[] as an argument to mainbook():
    create or replace PROCEDURE openpdffile
    AS LANGUAGE JAVA
    NAME 'pdfopenbook.mainbook(java.lang.String[])';Have you posted it on the Database forum?
    Regards,
    Nick

  • Executing a shell script from pl/sql stored procedure

    Hi,
    I have Oracle 8i on HP-UX.
    I am passing a shell script name as a parameter to a user defined function from a pl/sql stored procedure. This user defined function has insterface to a user defined Java class file in Aurora java virtual machine which is written using runtime class which can execute any OS command or any shell script. I am getting any OS command run successfully, but could not run my own shell script. It's is not getting environment variables of my own, so not getting executed. So please suggest how can get these env variables in my shell script and also suggest other sucurity concerns to be taken into consideration.
    If you have any questions please let me know.
    This is really a very urgent issue.....
    Please help me.
    Thanks
    Srinivasa Rao Kolla

    Your best bet is to use the dbms_pipe builtin package to send the command to the host

Maybe you are looking for

  • Re: SSO Configuration in ep 7.3

    HI, Experts Can any one please help me how to configuare SSO in ep 7.3.....any help would be appreciated....thank u.. Regards, Naveen Edited by: naveen.raju on Dec 10, 2011 10:02 AM

  • Dynamic Query string in Receiver HTTP_AAE adapter

    Hi All,      Currently I am working with a scenario where I need to use HTTP_AAE receiver adapter. I need to create the query string http://server:port/WebOrder?param=value dynamically. I created below mentioned UDF. DynamicConfiguration conf = (Dyna

  • Execute logic at application startup

    Hi, I was previously using a servlet init method to write a JMS message to a queue. Since then, I've found that the FacesServlet is final and can't be extended. I know I have an application scope managed bean. Where is the recommended place to put ap

  • How can i use the parallel port

    I was wondering how to adress my PC´s parallel port. I did'nt find a suitable VI in the palettes. Do I have to read/write somehow directly to the port adress in memory 0378 ...? If so, how can this be done ? Thanks for any help, Holsch

  • Need help in jndi

    guys, i am very new to java and jndi. i am doing a simple jms programs to send a message between 2 clients. but when i run the programs, it shows the following exceptions. JNDI API lookup failed: javax.naming.NoInitialContextException: Need to specif