Accessing database package variables from Forms

I have a database package that populates a table of values, i.e.
type t_route_list is table of rt_route.RTR_ID%type;
route_list t_route_list
route_list gets populated by a package function and I want to access route_list in the Form.
While I can access other package variables by writing a function that returns the variable, Forms doesnt seem to like functions that return a user defined datatype as above. I have also tried using a procedure with an OUT param instead of a function but it also fails with same error.
i.e.
declare
v_route_list pkg_bulk_route_replace.t_route_list;
begin
pkg_bulk_route_replace.init;
pkg_bulk_route_replace.get_route_list(v_route_list);
message(v_route_list(1));
end;
This will not compile, but removing the index (1) from the last line makes it compile but crash with ORA-0600.
The code above with message replaced with dbms_out.put_line works fine on TOAD.
So my question is......
Can my database package return a plsql table to a form and if so, how?!

Actually I've got this to work now!
Thde main culprit appears to be a difference in the version of sql or pl/sql used on forms (version 5) and the database (8.1.7).
I had defined my table as a nested table. By redefining this as a indexed table, simply by adding on 'index by binary_integer' on my server package, I am suddenly able to access the elements of the table on my form. Fortunately this did not break the server code either - the table was populated using bulk collect and that still works.
Still got a bit of coding to do, but things are looking up now.

Similar Messages

  • To view package variables in Forms 6i debugger

    Can anyone tell me how to view the value of the variables declared in the package spec(from forms side)? i can see only the local variables and global variables(declared using :GLOBAL) in the debugger window.

    In the 6i Debugger the visible Package variables are restricted to the Variables defined in the package body and these are only visible whilst you are instanciating the package for the first time - e.g. running through the anonymous block that you can have at the bottom of the package Definition.
    Otherwise they are invisble. Variables defined within Program units inside the Package are of course visble.
    The new Debugger in Forms 9i has fixed this problem and you can always view (and watch!) Variables defined both in the package Spec and Body.

  • Accessing a packaged variable through db link

    How do I access a packaged variable remotely? (Syntax)

    You cannot do that:
    SQL> conn xx/xx@xx
    Connected.
    SQL> create package p is
      2   a number;
      3  end;
      4  /
    Package created.
    SQL> conn yy/yy@yy
    Connected.
    SQL> desc p@yy
    SQL> set serveroutput on
    SQL> create synonym p1 for p@xx;
    Synonym created.
    SQL> desc p1;
    SQL> begin
      2    p1.a := 1;
      3    dbms_output.put_line(p.a);
      4  end;
      5  /
      p1.a := 1;
    ERROR at line 2:
    ORA-06550: line 2, column 6:
    PLS-00512: Implementation Restriction: 'P1.A': Cannot directly access remote package variable or cursor
    ORA-06550: line 2, column 3:
    PL/SQL: Statement ignoredInstead you should access these variables via functions and/or procedures. In following example I've created the private variable in package p but this doesn't matter whether it is private or public.
    SQL> conn xx/xx@xx
    SQL> create or replace package p is
    2 procedure set_a (v in number);
    3 function get_a return number;
    4 end;
    5 /
    Package created.
    SQL> ed
    Wrote file afiedt.buf
    1 create or replace package body p is
    2 a number;
    3 procedure set_a (v in number) is
    4 begin
    5 a := v;
    6 end;
    7 function get_a return number is
    8 begin
    9 return a;
    10 end;
    11* end;
    SQL> /
    Package body created.
    SQL> conn yy/yy@yy
    Connected.
    SQL> set serveroutput on
    SQL> desc p1
    FUNCTION GET_A RETURNS NUMBER
    PROCEDURE SET_A
    Argument Name Type In/Out Default?
    V NUMBER IN
    SQL> ed
    Wrote file afiedt.buf
    1 begin
    2 p1.set_a(1);
    3 dbms_output.put_line(p1.get_a);
    4* end;
    SQL> /
    1
    PL/SQL procedure successfully completed.
    Gints Plivna
    http://www.gplivna.eu

  • How do I access Captivate 6 variables from a playbar?

    I need to access Captivate 6 variables from a playbar. Does anybody know how? I know the parent/child relationship has changed from previous versions.

    Dear Herod,
    Thanks for the request, To program a FPGA target you must have the module
    Labview FPGA. So you cannot directly access the FPGA with LabWindows/CVI.
    But there is a way. Firstly create with Labview a Host VI that communicate with
    the FPGA target and compile this VI into a dll and then call it from CVI program.
    See the following link:
    Can I Use a Programming Language
    Other Than LabVIEW with a Reconfigurable I/O Board?
    LabWindows/CVI support for PXI 7831 R
    Best regards,
    Nick_CH

  • Accessing database packages in a different schema

    This is frustrating me...
    I've created a forms 6 application under the username vimich.
    In order to access the tables using a different user name I simply created public synonyms for the tables.
    This process does not seem to work for packages in the vimich schema.
    How can I get around this?
    Thanks for your help.
    Lesley.

    Lesley;
    I'm not a fan of creating public synonyms. The technique for making your forms schema independent that I perfer is as follows. Your tables are in the vimich schema. So when you log into the database from Forms log in as the SYSTEM user (default password is MANAGER... hopefully you've changed it).
    SYSTEM is the default DBA and has privileges on all tables. When you use the Data Block Wizard to create your data blocks, the fact that you're not logged in as vimich will cause the wizard to preface all table names with vimich. in the SQL that it generates. Then anyone with priviledges on your tables can use the forms. I have not tried this with packages, but it might work.
    One thing to remember about this approach is that if you log in as vimich using the forms, they will work fine until you try to reference a sequence. Oracle does not like you to prefix your own sequences with schema. even though it has no problems with you prefixing your own tables.
    Best!

  • Accessing clustered report servers from Forms

    Hi
    The "Oracle Fusion Middleware Publishing Reports to the Web with Oracle Reports Services 11g R2 (11.1.2)" manual in Section 2.5 talks about setting up a High Availability environment for Reports.
    It discusses how to set the cluster configuration and how to create a reports job repository in the database. It says that you need to have a unique name for each report server, finally it says that you should use Oracle Web Cache to load balance for the reports cluster.
    If you are calling the report server from Forms with a run_report_object then you don't go via the web cache, so I am confused how you send your report request to the reports cluster in a load balanced fashion.
    Has anyone done this or can explain how this works for Forms?
    TIA
    Tony

    I know that this is an old thread, but I've taken the liberty to bump it up, as I have the same question.
    The Reports documentation describes quite succinctly how to configure the report servers to be clustered - no problem there.
    The issue is that when you run a report from forms using run_report_object, you are required to specify a report server name. The Reports docs specify that all of the server names must be unique, so this seems to indicate that you cannot use a clustered report server environment from Forms, or am I missing something somewhere? Oh, wait - an insight coming here - Can you (I'll test this, but it would be good to know) specify a cluster name instead of an actual report server name? Google to the rescue:
    Using RUN_REPORT_OBJECT: If the call specifies a Reports Server cluster name instead of a Reports Server name, the reports_servermap environment variable must be set in the Oracle Forms Services default.env file. If your Oracle Forms application uses multiple Reports Server cluster names, you can map each of those cluster names to a different Reports Server using reports_servermap in rwservlet.properties, as follows:
    There's the answer. Sometimes writing the question down helps figure out the answer :)
    Regards,
    John

  • Accessing a private variable from a public method of the same class

    can anyone please tell me how to access a private variable, declared in a private method from a public method of the same class?
    here is the code, i'm trying to get the variable int[][][] grids.
    public static int[][] generateS(boolean[][] constraints)
      private static int[][][] sudokuGrids()
        int[][][] grids; // array of arrays!
        grids = new int[][][]
        {

    Are you sure that you want to have everything static here? You're possibly throwing away all the object-oriented goodness that java has to offer.
    Anyway, it seems to me that you can't get to that variable because it is buried within a method -- think scoping rules. I think that if you want to get at that variable your program design may be under the weather and may benefit from a significant refactoring in an OOP-manner.
    If you need more specific help, then ask away, but give us more information please about what you are trying to accomplish here and how you want to do this. Good luck.
    Pete
    Edited by: petes1234 on Nov 16, 2007 7:51 PM

  • How to access a javascript variable from Java?

    Here is my code:
    function validateLoginForm() {
        var username = document.getElementById('un');
        setCookie('un', username, 3650);
        //etc.
    <%   
        HttpSession httpSession = request.getSession();
        httpSession.setMaxInactiveInterval(30 * 60); //30 minutes
        httpSession.setAttribute("un", username); //!prob here - cannot resolve 'username'
    %>
    }...but how do I access the javascript variable 'username' from the Java code?
    Thanks,
    James

    The only way to pass values between JavaScript and JSP is through cookies. It sucks, I know, but right now that is the only option.
    You already are creating a cookie in JavaScript. So go ahead and read it in Java:
    Cookie[] cookies = request.getCookies();
    for(int i = 0; i < cookies.length; i++) {
        Cookie c = cookies;
    if (c.getName().equals("un")) {
    // Do what you need here.

  • Update Access database via OleDB from DataGridView

    I have been scouring these forums and the internet in general as well as doing a lot of reading, all to no avail.  I can not seem to successfully update the Access database from an edited DataGridView.  I am trying to use Stored Procedures that
    are in the Access database and work fine therein.  The DGV is filled in properly.  I have tried an ever-increasing number of variants to update the database (Private Sub BtnUpdate...)  without success.  I'd really, really appreciate some
    guidance here.
    Here is my code thus far:
    Public Class Form1
        Dim con As OleDbConnection    
        Dim cmd As OleDbCommand
        Dim da As OleDbDataAdapter
        Dim ds As DataSet
        Dim ProviderConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
        Dim TargetList As String = "C:\Users\Administrator\Documents\Visual Studio 2010\Projects\Development5\Test.mdb"
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            'establish a connection to the database
            con = New OleDbConnection(ProviderConnectionString & TargetList)
            con.Open()
            'define the command to be used
            cmd = New OleDbCommand
            cmd.Connection = con
            cmd.CommandType = CommandType.StoredProcedure
            cmd.CommandText = "ListAllTargets"
             'create the data adapter based on the command
            da = New OleDbDataAdapter(cmd)
            'fill the data set based on the command
            ds = New DataSet
            da.Fill(ds, "AllTargets")
            'bind and load dgvTargets with the data
            dgvTargetList.DataSource = ds.Tables("AllTargets")  ' Binding to dgvtargetlist
         End Sub
        Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
             da.UpdateCommand = New OleDbCommand("UPDATE TargetList SET;", con)
            Validate()
            da.Update(ds.Tables("AllTargets"))
            Me.ds.AcceptChanges()
        End Sub
    End Class

    Hi John,
    Welcome to MSDN forums!
    Cor pointed you to the right direction. An OleDBCommandbuilder object is required, which can be used to automatically
    generate DeleteCommand, UpdateCommand and InsertCommand for DataAdapter object.
    Here is detailed walkthrough: How to update
    (Insert/Update/Delete) data back into MS Access database from DataGridView.
    1) New a WinForms project, drag&drop DataGridView1 and Button1 onto
    Form1.
    2) Add database file test.mdb to project via: Data menu -> Add New Data Source
    Wizard ... then you can use ralative path to this database file in code
    3) Select/click
    your database file test.mdb in Solution Explorer
    -> Properties Pane
    -> change the "copy to ouput directory" to "copy
    if newer"
    4) Code sample
    Imports System.Data.OleDb
    Public
    Class Form1
    Dim myDA As OleDbDataAdapter
    Dim myDataSet As DataSet
    Private Sub Form1_Load(ByVal sender
    As System.Object, ByVal e
    As System.EventArgs) Handles
    MyBase.Load
    Dim con As OleDbConnection =
    New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=|DataDirectory|\test.mdb")  ' Use relative path to database file
    Dim cmd As OleDbCommand =
    New OleDbCommand("SELECT * FROM Table1", con)
    con.Open()
    myDA = New OleDbDataAdapter(cmd)
    'Here one CommandBuilder object is required.
          'It will automatically generate DeleteCommand,UpdateCommand and InsertCommand for DataAdapter object  
    Dim builder As OleDbCommandBuilder =
    New OleDbCommandBuilder(myDA)
    myDataSet = New DataSet()
    myDA.Fill(myDataSet, "MyTable")
    DataGridView1.DataSource = myDataSet.Tables("MyTable").DefaultView
    con.Close()
    con = Nothing
    End Sub
    ' Save data back into database  
    Private Sub Button1_Click(ByVal sender
    As System.Object, ByVal e
    As System.EventArgs) Handles Button1.Click
    Me.Validate()
    Me.myDA.Update(Me.myDataSet.Tables("MyTable"))
    Me.myDataSet.AcceptChanges()
    End Sub
    End
    Class
    Best regards,
    Martin Xie
    MSDN Subscriber
    Support in Forum
    If you have any feedback on our support, please contact
    [email protected]
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

  • Passing variables from form to report.

    I have a portal form that goes to a report on submit. I need to pass a couple of variables from the form to the report for display. How do I do this?

    Hi Sharmila
    thanks for that, the thing is I've tried this and it doesn't seem to work.
    My report fields are :p_property and :p_event.
    The code in my form is:
    declare
    l_property_reference VARCHAR2(20);
    CURSOR get_event_reference IS
    SELECT max(event_reference)
    FROM eh_event
    WHERE property_reference = l_property_reference;
    event_v VARCHAR2(10);
    begin
    l_property_reference := p_session.get_value_as_varchar2(p_block_name=>'DEFAULT', p_attribute_name => 'A_P_PROPERTY');
    OPEN get_event_reference;
    FETCH get_event_reference INTO event_v;
    CLOSE get_event_reference;
    go('mobileweb.rpt_prop_event_success.show?p_arg_names=p_property&p_arg_values='||l_property_reference||'&p_arg_names=p_event&p_arg_values='||event_v);
    end;
    The report gets called but the fields are blank.
    Rich

  • Access session scope variables from a filter

    I have a filter I am using to check if 2 people are loged in with the same user name.
    When my web app loads I store the user name in a class that has session scope.
    Is there a way for me to access this class from the Filter class?
    How do I access the session instance from this class?
    How do I pass parameters to the Filter class?
    Thank you,
    Al

    http://forum.java.sun.com/thread.jspa?threadID=5122925&tstart=0

  • Exception Handling in packages called from forms

    I am running 10g forms that have many calls to packages/procedures in the database. I am seeing hanging processes on the web server (even after forms processes are stopped) and 1 of the causes Oracle listed was not having proper exception handling in the procesdures. Do I need to add an Exception (' when others then null') to my package specs to handle this?

    "Do I need to add an Exception (' when others then null') to my package specs to handle this? "
    That will hide the problem not handle it. You really need is to find out where the code is failing...
    There is a method for logging message for debugging here...
    http://oracle-developer.net/display.php?id=424
    An another which is less good for a live system (the one above lets you set different levels of importance for logs messages and can be turned on or off for each user) but looks easier to implement in case you might be in a hurry...
    Re: Zdebug -- Download a Forms debugging message tool

  • Access database using Java from HTML webpage

    Hi,
    I've got to create some online maths tests to be taken by students with their marks being stored in a database.
    I've wrote some simple java code which can add/remove and modify entries in a test mySQL database that I made. What I now need to do is be able to add entries to the database from a html page.
    The math tests will be java applets with the students having to interact according to questions, press submit and their score will be output. The score will then be entered into the database.
    The problem I'm having is that with an Applet their are all sorts of security issues (I'm having problems getting images to load in an Applet) so assume I'll face the same security issues when I try to access a database through an applet.
    So, could someone please help get started.
    Cheers

    MVC - I assume you mean model-view-control and not Marvel vs Capcom :)
    If so then does this mean I should completely seperate the user interface (the actual applets that will contain the test), the database (that will store the results) and the link between the two?
    is it possible to acheive this using Java, Java Applets, Java Script and the database (in my case mySQL) and could you give me some tips on how best to tackle the problem.
    Thanks

  • Database procedure called from Forms

    If a database procedure that updates a table is called from Oracle Forms, does it commit the changes automatically or do you have to issue a commit in Forms to commit the changes the database procedure has done, assumming there is no commits in the database procedure.
    I'm not sure since I have seen cases where a commit was needed after the database procedure has been called and a case where a commit was needed. I checked the database procedure and there was no commits, there was a commit above the statement where the procedure was being called.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by NAB ():
    If a database procedure that updates a table is called from Oracle Forms, does it commit the changes automatically or do you have to issue a commit in Forms to commit the changes the database procedure has done, assumming there is no commits in the database procedure.
    I'm not sure since I have seen cases where a commit was needed after the database procedure has been called and a case where a commit was needed. I checked the database procedure and there was no commits, there was a commit above the statement where the procedure was being called.<HR></BLOCKQUOTE>
    Database procedure do have commit. You can issue commit in the procedure itself.
    null

  • Migrating Access Database to Web WITH FORMS (not just backend)

    How difficult would this be, what steps would be involved and is Dreamweaver capable of helping?
    The server uses IIS and ASP so compatibility should be fine with access.
    I have enough of a programming history to replace vbasic code with ASP code if I read about the language, but would like to do the least amount of work required.

    Lets just say that Access and Oracle are completly different animals and leave it at that. What I believe you need to do is:
    1. Create an Oracle Database using the Database Creation Assistant. (Keep all the Defaults, and keep track of any passwords that are used.
    2. Using the System (DBA) account, crate a user to hold the Access Schema (Never create objects in the SYS account and you shouldn't do that with the SYSTEM account either.
    3. Run the Access Migration Workbench.

Maybe you are looking for

  • Increase Speed

    I have exactly 1212 photos in my library mostly 5.1 megapixels. I noticed that the speed at which photos show up in full screen mode is really slow. Is there a way I can rebuild the cache and possibly speed things up?

  • Resolution for scaled up apps in ios 8

    I just received my iphone 6 this morning :-) As I got everything setup I am noticing that the 3rd party apps that are getting scaled up due to the bigger screen size look really bad and feel low resolution due to this I recall during the setup there

  • Oracle 10gDbConsole servvice not starting

    Hi All Gurus, I have a problem with my ORacle 10g. I had installed Oracle 10g (10.2.0.1) on my office PC and it was running fine. But yesterday our office moved from 1 floor to another in the same building. And my PC's IP address got changed, after t

  • Adobe CS 6.0 issue

    I have installed the Cs 6.0 in a pc and entered all the serial number & signed in to adobe too. After cloning to another PC, it will still prompt me for serial number. Is there any workaround method to resolve this issue? This is because i have 1000

  • Employee Responsible relationship flow to ECC

    Dear all, We are maintaining Employee responsible relationship to each customer in CRM. And we are expecting that Employee number would be visible in ECC system ---  in Customer Master - Sales Area Data - Partner Functions tab - Employee Responsible