Are PL/SQL Package Body Constants in Shared Area or Private Area

Based on this it not clear to me if PL/SQL Package Body Constants are stored in shared area or private area.
http://docs.oracle.com/cd/B28359_01/server.111/b28318/memory.htm
"PL/SQL Program Units and the Shared Pool
Oracle Database processes PL/SQL program units (procedures, functions, packages, anonymous blocks, and database triggers) much the same way it processes individual SQL statements. Oracle Database allocates a shared area to hold the parsed, compiled form of a program unit. Oracle Database allocates a private area to hold values specific to the session that runs the program unit, including local, global, and package variables (also known as package instantiation) and buffers for executing SQL. If more than one user runs the same program unit, then a single, shared area is used by all users, while each user maintains a separate copy of his or her private SQL area, holding values specific to his or her session.
Individual SQL statements contained within a PL/SQL program unit are processed as described in the previous sections. Despite their origins within a PL/SQL program unit, these SQL statements use a shared area to hold their parsed representations and a private area for each session that runs the statement."
I am also curious what are the fine grained differences from a memory and performance perspective (multi-session) for the two examples below. Is one more efficient?
Example 1.
create or replace
package body
application_util
as
c_create_metadata constant varchar2(6000) := ...
procedure process_xxx
as
begin
end process_xxx;
end application_util;
vs.
Example 2.
create or replace
package body
application_util
as
procedure process_xxx
as
c_create_metadata constant varchar2(6000) := ...
begin
end process_xxx;
end application_util;

>
What i am asking is fairly granular, so here it is again, let's assume latest version of oracle..
In a general sense, is the runtime process able to manage memory more effectively in either case, one even slightly more performant, etc
ie does example 1 have different memory management characteristics than example 2.
Specifically i am talking about the memory allocation and unallocation for the constant varchar2(6000)
Ok, a compiler's purpose is basically to create an optimized execution path from source code.
The constant varchar2(6000) := would exist somewhere in the parse tree/execution path (this is stored in the shared area?).
I guess among the things i'm after is
1) does each session use space needed for an additional varchar2(6000) or does runtime processor simply point to the constant string in the parse tree (compiled form which is shared).
2) if each session requires allocation of space needed for an additional varchar2(6000), then for example 1 and example 2
at what point does the constant varchar allocation take place and when is the memory unallocated.
Basically does defining the constant within the procedure have different memory characteristics than defining the constant at the package body level?
>
Each 'block' or 'subprogram' has a different scope. So the 'constant' defined in your example1 is 'different' (and has a different scope) than the 'constant' defined in example2.
Those are two DIFFERENT objects. The value of the 'constant' is NOT assigned until control passes to that block.
See the PL/SQL Language doc
http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/fundamentals.htm#BEIJHGDF
>
Initial Values of Variables and Constants
In a variable declaration, the initial value is optional (the default is NULL). In a constant declaration, the initial value is required (and the constant can never have a different value).
The initial value is assigned to the variable or constant every time control passes to the block or subprogram that contains the declaration. If the declaration is in a package specification, the initial value is assigned to the variable or constant once for each session (whether the variable or constant is public or private).
>
Perhaps this example code will show you why, especially for the second example, a 'constant' is not necessarily CONSTANT. ;)
Here is the package spec and body
create or replace package pk_test as
  spec_user varchar2(6000);
  spec_constant varchar2(6000) := 'dummy constant';
  spec_constant1 constant varchar2(6000) := 'first constant';
  spec_constant2 constant varchar2(6000) := 'this is the second constant';
  spec_constant3 constant varchar2(6000) := spec_constant;
  procedure process_xxx;
  procedure change_constant;
end pk_test;
create or replace package body pk_test as
procedure process_xxx
as
  c_create_metadata constant varchar2(6000) := spec_constant;
begin
  dbms_output.put_line('constant value is [' || c_create_metadata || '].');
end process_xxx;
procedure change_constant
as
begin
  spec_constant := spec_constant2;
end change_constant;
begin
  dbms_output.enable;
  select user into spec_user from dual;
  spec_constant := 'User is ' || spec_user || '.';
end pk_test;The package init code sets the value of a packge variable (that is NOT a constant) based on the session USER (last code line in package body).
The 'process_xxx' procedure gets the value of it's 'constant from that 'non constant' package variable.
  c_create_metadata constant varchar2(6000) := spec_constant;The 'change_constant' procedure changes the value of the package variable used as the source of the 'process_xxx' constant.
Now the fun part.
execute the 'process_xxx' procedure as user SCOTT.
SQL> exec pk_test.process_xxx;
constant value is [User is SCOTT.].Now execute 'process_xxx' as another user
SQL> exec pk_test.process_xxx;
constant value is [User is HR.].Now exec the 'change_constant' procedure.
Now exec the 'process_xxx' procedure as user SCOTT again.
SQL> exec pk_test.process_xxx;
constant value is [this is the second constant].That 'constant' defined in the 'process_xxx' procedure IS NOT CONSTANT; it now has a DIFFERENT VALUE.
If you exec the procedure as user HR it will still show the HR constant value.
That should convince you that each session has its own set of 'constant' values and so does each block.
Actually the bigger memory issue is the one you didn't ask about: varchar2(6000)
Because you declared that using a value of 6,000 (which is 2 ,000 or more) the actual memory allocation not done until RUN TIME and will only use the actual amount of memory needed.
That is, it WILL NOT pre-allocate 6000 bytes. See the same doc
http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/datatypes.htm#CJAEDAEA
>
Memory Allocation for Character Variables
For a CHAR variable, or for a VARCHAR2 variable whose maximum size is less than 2,000 bytes, PL/SQL allocates enough memory for the maximum size at compile time. For a VARCHAR2 whose maximum size is 2,000 bytes or more, PL/SQL allocates enough memory to store the actual value at run time. In this way, PL/SQL optimizes smaller VARCHAR2 variables for performance and larger ones for efficient memory use.
For example, if you assign the same 500-byte value to VARCHAR2(1999 BYTE) and VARCHAR2(2000 BYTE) variables, PL/SQL allocates 1999 bytes for the former variable at compile time and 500 bytes for the latter variable at run time.
>
So when you have variables and don't know how much space is really needed do NOT do this:
myVar1 VARCHAR2(1000);
myVar2 VARCHAR2(1000);
myVar3 VARCHAR2(1000);The above WILL allocate 3000 bytes of expensive memory even if it those variables are NEVER used.
This may look worse but, as the doc states, it won't really allocate anything if those variables are not used. And when they are used it will only use what is needed.
myVar1 VARCHAR2(2000);
myVar2 VARCHAR2(2000);
myVar3 VARCHAR2(2000);

Similar Messages

  • Hide Oracle PL/SQL Package Body

    Hi there
    I have a PL/SQL Package , and I would to Hide that Package Body to other Database users.
    How would I can hide Package Body in Oracle?
    Regards
    JOJI

    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/wrap.htm#LNPLS01602
    Note : you cannot easily unwrapped the wrapped code. You have to keep a copy of your source in an external deposit location.
    Nicolas.

  • JS Validation for Drop down List is not working in Oracle PL/SQL Package

    Hi All,
    I am facing an issue with JavaScript validation done in Oracle PL SQL package.
    System Requirement:
    There is one screen which contains two fields viz. FLD 1 & FLD 2 and one 'Submit' button.
    FLD 1 and FLD 2 fields are drop down list boxes.These are mandatory fields.
    The screen is developed in Oracle Mod PL SQL package.
    The html coding and java scripting are embedded in the respective Oracle PL SQL Package procedure which generates this screen,takes the input values provided by user,does the
    field validations and submits the form.
    Issue:
    The javascript validation for FLD 2 dropdown is working successfully.
    When the user leaves this field as blank,the embedded javascript pops up an error message 'Selection of FLD 2 is manadatory before submitting the form!'.
    As FLD 1 is also a mandatory field,the javascripting validation should pop up the similar error message 'Selection of FLD 1 is manadatory before submitting the form!'.
    But,this first field validation is not at all working.
    The system allows to submit the form even if the 'FLD 1' is left blank.
    The javascript code sysntax for validation of FLD 1 & FLD 2 drop down list boxes as follows:
    function validate_form_fields()
    if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
    [0].p_fld_1.selectedIndex < 1 )
    alert("Selection of FLD 1 is manadatory before submitting the form!!!");
    return false;
    else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
    [0].p_fld_2.selectedIndex < 1 )
    alert("Selection of FLD 2 is manadatory before submitting the form!!!");
    return false;
    return true;
    I am viewing the screen from the web browser IE version 8.0.
    Your timely help will really be appreciated.
    Regards & Thanking in advance,
    Alka

    Hi,
    1. Your problem is actually related to JavaScript, not SQL and PL/SQL. So, this is the wrong forum to post. The closest to JS is the Application Express forum {forum:id=137}. Clearly state that it is not an Apex issue and that you are looking for JS help.
    2. Your JS code, the way you has posted it, is syntactically incorrect, so if you post on Apex forum put the correct code and in tags as described in the FAQ
    {quote}
    function validate_form_fields()
    if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
    [0].p_fld_1.selectedIndex < 1 )
    alert("Selection of FLD 1 is manadatory before submitting the form!!!");
    return false;
    else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
    [0].p_fld_2.selectedIndex < 1 )
    alert("Selection of FLD 2 is manadatory before submitting the form!!!");
    return false;
    return true;
    {quote}
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • SQL Package not getting created

    Hi,
    We are in process of migrating out application from wl5.1/solaris/jdk1.2.2 to wl6.1/solaris/jdk1.3.
    We are using SQL package due to performance reasons. The package definition was done
    in the weblogic.properties file for 5.1 and we tried to do the same in 6.1 config.xml
    file. We use AS400 as our DB. SQL packages are not created if I use wl6.1. Below
    is the definition we used in xml file
    WL5.1
    weblogic.jdbc.connectionPool.eracDS=\
    url=jdbc:as400:RARMS,\
    driver=com.ibm.as400.access.AS400JDBCDriver,\
    initialCapacity=30,\
    maxCapacity=50,\
    capacityIncrement=5,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    testTable=A4TEST,\
    props=libraries=A4LIB;user=INTERNETDB;password=DBFIRST;lob threshold=1048578;extended
    dynamic=true;package=WEBL51;package library=A4LIB
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.eracDS=everyone
    weblogic.jdbc.TXDataSource.eracDS=eracDS
    WL6.1
    <JDBCConnectionPool CapacityIncrement="5"
    DriverName="com.ibm.as400.access.AS400JDBCDriver"
    InitialCapacity="5" MaxCapacity="30" Name="eracDS"
    PreparedStatementCacheSize="0"
    Properties="libraries=ELARMS8;lobthreshold=1048578;user=INTERNETDB;password=DBFIRST;package
    library=ELARMS8;extended package=WEBL61" ShrinkingEnabled="false" Targets="server1dev"
    URL="jdbc:as400:DEV"/>
    <JDBCTxDataSource JNDIName="eracDS" Name="eracDS" PoolName="eracDS" Targets="server1dev"/>
    Please let me know if I am missing anything.
    Thanks
    Krish.

    Krish wrote:
    Hi,
    We are in process of migrating out application from wl5.1/solaris/jdk1.2.2 to wl6.1/solaris/jdk1.3.
    We are using SQL package due to performance reasons. The package definition was done
    in the weblogic.properties file for 5.1 and we tried to do the same in 6.1 config.xml
    file. We use AS400 as our DB. SQL packages are not created if I use wl6.1. Below
    is the definition we used in xml file
    WL5.1
    weblogic.jdbc.connectionPool.eracDS=\
    url=jdbc:as400:RARMS,\
    driver=com.ibm.as400.access.AS400JDBCDriver,\
    initialCapacity=30,\
    maxCapacity=50,\
    capacityIncrement=5,\
    allowShrinking=true,\
    shrinkPeriodMins=15,\
    testTable=A4TEST,\
    props=libraries=A4LIB;user=INTERNETDB;password=DBFIRST;lob threshold=1048578;extended
    dynamic=true;package=WEBL51;package library=A4LIB
    weblogic.allow.reserve.weblogic.jdbc.connectionPool.eracDS=everyone
    weblogic.jdbc.TXDataSource.eracDS=eracDS
    WL6.1
    <JDBCConnectionPool CapacityIncrement="5"
    DriverName="com.ibm.as400.access.AS400JDBCDriver"
    InitialCapacity="5" MaxCapacity="30" Name="eracDS"
    PreparedStatementCacheSize="0"
    Properties="libraries=ELARMS8;lobthreshold=1048578;user=INTERNETDB;password=DBFIRST;package
    library=ELARMS8;extended package=WEBL61" ShrinkingEnabled="false" Targets="server1dev"
    URL="jdbc:as400:DEV"/>
    <JDBCTxDataSource JNDIName="eracDS" Name="eracDS" PoolName="eracDS" Targets="server1dev"/>
    Please let me know if I am missing anything.
    Thanks
    Krish.Well, the URL is different, and the properties aren't the same (missing some blanks in 'lob threshold'
    etc.
    and there's no test table...
    Joe

  • How to wrap a package body in the Oracle Cloud

    Does anyone know if it is possible to wrap a PL/SQL package body in the Oracle Cloud? I tried to wrap it on my local machine and then upload it but when I ran it, it said the wrapped package was corrupt. DBMS_DDL is a lot of extra work and only works for packages <= 32K. Is there any other way to do this?
    Maybe in the SQL Workshop, upload script section, there could be an option to wrap code when you run it?
    Thanks,
    Steve

    Rick,
    Thanks for the quick response. I used the SQL Workshop, script upload function (in Apex) to upload a package that I wrapped on my pc (Windows 7) using the wrap command line utility (11g). It uploaded fine but when I tried to run it, it returned a message like "Wrapped code is invalid or corrupted". This was not what I would have expected since I know you can import/export wrapped code between systems (different OS) without issue. Perhaps the command line wrap is OS specific and the import/export is doing some kind of translation?
    Anyway, I know you cannot use the command line option directly in the cloud because, as you say, you don't have access to the command line. DBMS_DDL is too tedious to use and has the 32K limit and unfortunately, there is no command like, "Alter package body xxx compile wrapped". So that leaves using the SQL Developer Cart option to move wrapped code from a local db to the cloud db. Unfortunately, I'm still having roles and permissions issues with my account which Oracle Support hasn't been able to fix over the last few weeks so I can't try this option (or even login using SQL Dev). Has anyone tried to do this? Does anyone know of another way to do this that I'm not thinking of?
    Thanks,
    Steve

  • Designer 9.0.2.7 - problems with capturing PL/SQL packages

    Hello,
    I would appreciate any help regarding the following issue:
    We tried to capture in Designer 9.0.2.7 the existing PL/SQL packages from an Oracle 9i database and we have met some problems.
    Even the package has a body containing two public procedures, when capturing, the Designer generates warnings that say the PL/SQL package body is empty. Therefore, the Designer capture the body content and write it in the PL/SQL Block of the PL/SQL Definition property, but the content of the body is preceded with the " character.
    This makes problem when generating the "ddl" for the package (the package is not created correctly in the DB).
    In addition, when generating the "ddl", the "END package_name" is added twice.
    Other problem is that the package specification information from Designer is just "END package_name;"
    For some of the packages containing only a list of public procedures, without any other variables declarations, the Designer does not capture these procedures as separate subprograms in the package definition, as it does other times. In this case, the package body is entirely captured in the PL/SQL Block and with the " character before content.
    Is it some settings that can be done or some rules about the format of the PL/SQL procedures in order for Designer to capture all packages in same manner and correctly?
    Thank you,
    Claudia

    Hi Keith,
    I am connecting to the database as the package owner..
    I have noticed earlier that I have problems when capturing triggers also.. The content of one large trigger contains 36371 characters and when capturing it from DB, the content was truncated to 28020 characters in Designer.
    Our ideas with capturing the DB packages/procedures were to use the Designer as version control system.
    We wanted to have all objects used in a project in Designer.. entities, tables, triggers, packages, procedures, Forms files, etc. in order to make a configuration for a project release.
    Thank you,
    Claudia

  • Sql developer hangs when saving pl/sql external package or package body fil

    When I open a package body file I can modify the contents of the file.
    Compilation of the file works fine but when I want to close or save the file SQL developer hangs. I use version 1.2 (previous version did have the same problem.)
    Somebody has an idee what I'am doing wrong?

    Are you using 1.2.1.32.13?
    Sue

  • && Substitution Variable in Package Body using SQL Developer

    Hi Folks,
    I've moved over to working to in SQL Developer (its a very early version - 1.0.0) from a combination of SQL*Plus command line and a text editor. I'm trying to get this upgrgraded, but I think the question will be the same with a newer version anyway.
    I am creating a package, and in the package body I have some &&my_var substitutions that I was previoulsy prompted for when calling the .sql from the command line SQL*Plus. I need this as the variable needs to be different for the development and live environment.
    When working in SQL Developer, I can load the package body from Connection->Packages->My Package->My Package Body, and click the edit button to edit the code, however, when I click the Compile button in the top of the window my code error's because of the substituion variablle. An example is:
    CREATE OR REPLACE
    PACKAGE BODY MY_PACKAGE AS
    PROCEDURE MY_PROCEDURE
    BEGIN
    my_variable := &&my_function_from_live_or_dev_database
    END MY_PROCEDURE
    Can anyone tell me if there is a way of defining a compiler variable within the IDE widow while editing a package body stored in the database, without manually copying the code into the Worksheet and running it as a script?
    Thanks,
    AM

    953104 wrote:
    Thanks for the reply, the code was just quickly typed to show the sort of thing I am doing, it wasn't actual code form my project.
    I've come from a C background so what I would have done would be create a #define and changed to when on live or development - or passed the variable to the build environment from the IDE or makefiles and the change would have reflected through my whole project.
    What I want to be able to do is alter a definition of some sort that will reflect throughout my whole project, so I can change it in one location to minimize code changes before going live. I don't really want to be prompted at all. On one system it needs to be DEV_10 and on the other it needs to be LIVE_10.Is there a possibility to elimiante this difference at all?
    For example if DEV_10 is the oracle schemauser on the development database and LIVE_10 would be the one on the production system. THen you could just remove all references to the schema from your code.
    IF you are already connected to this schema, then you don't need to specify the schema name anymore.
    example
    instead of
    create or replace package dev_10.myPackage
    ...you can simply use
    create or replace package myPackage
    ...If needed you can alter the cuurently connected user just before you run the script.
    alter session set current_schema = LIVE10;
    create or replace package myPackage
    ...This would be a different working window in the developer (script worksheet, instead of direct pl/sql editor).
    Substitution variables are allowed there.

  • Package body name in script - Oracle SQL Developer Data Modeler 3.0.0.6.

    Hi,
    I have problem with package body full name. In package body properties I have my <schema_name>. But there is something like "user5" insted my <schema_name> in package body script. I replaced it and saved it. But, when I re opened package body, there is user5 again, while name of package is OK.
    Can I set some property to stay there my schema_name?
    Thank you.
    Stefan.
    Edited by: user13617034 on 4.4.2011 5:10
    Edited by: user13617034 on 4.4.2011 5:12

    SQL Server Physical model doesn't save table identity column.
    here are the steps to get this bug:
    1. create a table in relational model with a column as an integer to be used as an identity.
    2. create or open a physical model for SQL-SERVER 2005
    3. open the table in the physical model
    4. edit the integer column property dialog
    5. tick the identity check box and close the property dialog
    6. save the model and close it
    7. open it again, you will find the identity check is removed! (probably not saved from the start)

  • Can't see package body in SQL Developer version 2.1.1.64

    When I go to the object browser, I can see all of the package specs but can't seem to get to the package body. I can access the package body just fine through Toad, so I don't think it is an Oracle user issue. Help?

    I can see any user's Package Body when I'm logged into the database as a DBA, so it must be some privilege that you need. The privilege I would have guessed you need is SELECT ANY DICTIONARY but you say you have that privilege. If you were granted that privilege through a role, make sure that the role is active, or that it is a default role.
    Another role it might be looking for is EXECUTE ANY PROCEDURE, but I'm not sure. See if you can do these selects, since these are probably the views that SQL Developer is using:
    select * from dba_objects where owner = 'some owner' and object_type = 'PACKAGE BODY';
    select * from dba_source where owner = ' some owner' and type = 'PACKAGE BODY';Of course, if your database administrator is willing to grant you the DBA role, that ought to do the trick - works for me. Otherwise, you and your DBA may have to try different system privileges until you find the one that works.

  • Split a PL/SQL Package Spec and Body

    I hope this was not discussed in some other thread somewhere (haven't found it), but my problem is:
    How to split the Package Spec and Package Body in JDeveloper if you want to have both (for database deployment) as files in e.g. a subversion repository?
    The problem arises if you have a couple of packages that are dependent on each other, so that you have to deploy the specs first to have the "public" part in place and afterwards the bodies to define the package functions/procedures.
    Is there a way to do this?
    TIA.
    --Ciao, FD.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    If you want to store for example the package "mypackage" source code in a subversion repository
    one possibility is to define 2 svn files:
    - mypackage.pks (which contains the package "specification") and
    - mypackage.pkb ( package "body").
    I haven't tried this from JDev 11.2 but it works for example when using a single-user
    svn repository from Sql Developer 2.1.1. ( in SQL Dev if you specify a database
    connection you can compile the file based pakage specification and after then the
    package body ...)
    Regards
    user_alex

  • SQL developer 3.1 in schema browser doesn't show package body

    Hi,
    When i search a package with schema browser, i can't see the package body of other owner, the menu "edit body" is disabled.
    My user as select any dictionary et select_catalog_role
    When i connect with a DBA's user, i can see all.
    I'am on windows with sqldev 3.1
    Thanks

    Hi erifet,
    This one seems to go back and forth. It was originally fixed in Schema Browser for 3.0. The "Edit Body" was greyed out, but an "Open Body" icon in the code editor toolbar for Package Spec was enabled. Here is the forum reference:
    30EA1 package bodies missing in schema browser still not fixed
    In 3.1, both "Edit Body" and "Open Body" are greyed out, and that applies both to Schema Browser and Connection Navigator for Other Users packages, so at least 3.1 is consistent. The difference between the Browser and the Navigator is Schema Browser has no option to display a Package Body type (must go through Package Spec type), while the Connection Navigator displays a Package Body node type in the tree beneath the Spec node. In the forum thread AM references, Vadim explains what 3.1 does: it uses the ALL_OBJECTS view, which apparently does not include package bodies. Off-hand I'm not sure why it does not include them, and the following link doesn't shed any light:
    http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_1001.htm
    Adding the execute privilege on the package does not help either. At least you have the workaround of using the Connection navigator to view the package body metadata (code) of Other Users if you have been granted either SELECT_CATALOG_ROLE or SELECT ANY DICTIONARY. As for returning to the 3.0 Schema Browser behavior, perhaps Vadim will notice your post and have some explanation as to why or why not that may be possible.
    Regards,
    Gary
    SQL Developer Team

  • PL/SQL Package with only Constants

    We have created a PL/SQL package with a Spec and NO BODY with only constant values.
    When a user logs onto the Database for the first time, and runs a program the first time the "Constants" package is called you get a ORA-06502, but every time after the first there is no issues. This only happens the first the user logs onto the database ( Session based ).
    Cory

    You have a wrong declaration in your package, some like c2 in the following example.
    EDV@mtso> create or replace package xxx
      2  is
      3    c1 number := 1;
      4    c2 number := 'aa';
      5    c3 number := 3;
      6  end;
      7  /
    Package created.
    EDV@mtso> var t number
    EDV@mtso> exec :t := xxx.c1;
    BEGIN :t := xxx.c1; END;
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at "EDV.XXX", line 4
    ORA-06512: at line 1
    EDV@mtso> print t
             T
    EDV@mtso> exec :t := xxx.c1;
    PL/SQL procedure successfully completed.
    EDV@mtso> print t
             T
             1
    EDV@mtso> exec :t := xxx.c3;
    PL/SQL procedure successfully completed.
    EDV@mtso> print t
             T
    EDV@mtso> Note that constants declared before the errorous one have a value, constants declare after that one have no value.
    Anton
    Message was edited by:
    ascheffer

  • How to open a package body in Oracle sql developer

    How to open a package body in Oracle sql developer..any shortcut for that

    I need another way to get to my package body. I'm on a locked down system, so the only way I can reference anything is if I already know the name of it. I accidentally overwrote my text document that I was using to work on it and I closed out of the package body in sqldeveloper. There must be a command, like an alter or some such. Anyone know the old fashioned way of looking at a package?

  • PL/SQL error package body

    Hi all,
    I am new to PL/SQL. I am getting the following errors during the runtime. Please help
    OWNER: BANINST1 NAME: GOKINTL TYPE: PACKAGE BODY
    LINE/COL ERROR
    115/14 PLS-00323: subprogram or cursor 'P_GOBINTL_INSERT' is declared in
    a package specification and must be defined in the package body
    147/14 PLS-00323: subprogram or cursor 'P_GORDOCM_INSERT' is declared in
    a package specification and must be defined in the package body
    167/14 PLS-00323: subprogram or cursor 'P_GOBINTL_UPDATE_ROW' is
    declared in a package specification and must be defined in the
    package body
    183/9 PL/SQL: SQL Statement ignored
    183/9 PLS-00394: wrong number of values in the INTO list of a FETCH
    statement
    199/14 PLS-00323: subprogram or cursor 'P_GORDOCM_UPDATE_ROW' is
    declared in a package specification and must be defined in the
    package body
    6 rows selected.
    PL/SQL code:
    /* Functions to determine whether international student */
    /* or not. */
    FUNCTION f_check_gobintl_exists
    ( pidm IN GOBINTL.GOBINTL_PIDM%TYPE)
    RETURN VARCHAR2 IS
    status VARCHAR2(1) := '';
    chk_gobintl_tab VARCHAR2(1) := '';
    CURSOR GOBINTL_C
    IS
    SELECT 'Y'
    FROM GOBINTL
    WHERE GOBINTL_PIDM = pidm;
    BEGIN
    OPEN GOBINTL_C;
    FETCH GOBINTL_C INTO chk_gobintl_tab;
    IF GOBINTL_C%NOTFOUND THEN
    status := 'N';
    ELSE
    status := 'Y';
    END IF;
    CLOSE GOBINTL_C;
    RETURN status;
    END f_check_gobintl_exists;
    /* Function to determine whether the student is a */
    /* non-resident alien or not. */
    FUNCTION f_check_nonresident_status(
    pidm IN GORVISA.GORVISA_PIDM%TYPE,
    input_date IN GORVISA.GORVISA_VISA_START_DATE%TYPE)
    RETURN VARCHAR2
    IS
    status VARCHAR2(1) := '';
    chk_non_resi_status VARCHAR2(1) := '';
    CURSOR CHK_NONRESI_STATUS_C
    IS
    SELECT 'Y'
    FROM GORVISA,
    STVVTYP
    WHERE STVVTYP_NON_RES_IND = 'Y'
    AND GORVISA_VTYP_CODE = STVVTYP_CODE
    AND GORVISA_PIDM = pidm
    AND GORVISA_VISA_START_DATE <= TRUNC(input_date)
    AND GORVISA_VISA_EXPIRE_DATE >= TRUNC(input_date);
    BEGIN
    OPEN CHK_NONRESI_STATUS_C;
    FETCH CHK_NONRESI_STATUS_C INTO chk_non_resi_status;
    IF CHK_NONRESI_STATUS_C%NOTFOUND THEN
    status := 'N';
    ELSE
    status := 'Y';
    END IF;
    CLOSE CHK_NONRESI_STATUS_C;
    RETURN status;
    END f_check_nonresident_status;
    /* Function to select a single row from gobintl table. */
    FUNCTION f_gobintl_select
    ( pidm GOBINTL.GOBINTL_PIDM%TYPE)
    RETURN GOBINTL%ROWTYPE
    IS
    gobintl_row GOBINTL%ROWTYPE;
    CURSOR GOBINTL_C
    IS
    SELECT GOBINTL_PIDM,
    GOBINTL_SPOUSE_IND,
    GOBINTL_SIGNATURE_IND,
    GOBINTL_USER_ID,
    GOBINTL_ACTIVITY_DATE,
    GOBINTL_PASSPORT_ID,
    GOBINTL_NATN_CODE_ISSUE,
    GOBINTL_PASSPORT_EXP_DATE,
    GOBINTL_I94_STATUS ,
    GOBINTL_I94_DATE,
    GOBINTL_REG_NUMBER,
    GOBINTL_DURATION,
    GOBINTL_CELG_CODE,
    GOBINTL_CERT_NUMBER ,
    GOBINTL_CERT_DATE_ISSUE,
    GOBINTL_CERT_DATE_RECEIPT,
    GOBINTL_ADMR_CODE,
    GOBINTL_NATN_CODE_BIRTH,
    GOBINTL_NATN_CODE_LEGAL,
    GOBINTL_LANG_CODE,
    GOBINTL_SPON_CODE,
    GOBINTL_EMPT_CODE,
    GOBINTL_FOREIGN_SSN,
    GOBINTL_CHILD_NUMBER,
    GOBINTL_VPDI_CODE
    FROM GOBINTL
    WHERE GOBINTL_PIDM = pidm;
    BEGIN
    OPEN GOBINTL_C;
    FETCH GOBINTL_C INTO gobintl_row;
    CLOSE GOBINTL_C;
    RETURN gobintl_row;
    END f_gobintl_select;
    /* Function to select a single row from gordocm table. */
    FUNCTION f_gordocm_select
    ( pidm IN GORDOCM.GORDOCM_PIDM%TYPE,
    seq_no IN GORDOCM.GORDOCM_SEQ_NO%TYPE,
    vtyp_code IN GORDOCM.GORDOCM_VTYP_CODE%TYPE,
    visa_number IN GORDOCM.GORDOCM_VISA_NUMBER%TYPE,
    docm_code IN GORDOCM.GORDOCM_DOCM_CODE%TYPE)
    RETURN GORDOCM%ROWTYPE
    IS
    gordocm_row GORDOCM%ROWTYPE;
    CURSOR GORDOCM_C
    IS
    SELECT GORDOCM_PIDM ,
    GORDOCM_SEQ_NO ,
    GORDOCM_VTYP_CODE,
    GORDOCM_VISA_NUMBER,
    GORDOCM_DOCM_CODE,
    GORDOCM_DISPOSITION ,
    GORDOCM_USER_ID ,
    GORDOCM_ACTIVITY_DATE ,
    GORDOCM_SRCE_CODE ,
    GORDOCM_REQUEST_DATE ,
    GORDOCM_RECEIVED_DATE
    FROM GORDOCM
    WHERE GORDOCM_PIDM = pidm
    AND GORDOCM_SEQ_NO = seq_no
    AND GORDOCM_VTYP_CODE = vtyp_code
    AND GORDOCM_VISA_NUMBER = visa_number
    AND GORDOCM_DOCM_CODE = docm_code;
    BEGIN
    OPEN GORDOCM_C;
    FETCH GORDOCM_C into gordocm_row;
    CLOSE GORDOCM_C;
    RETURN gordocm_row;
    END f_gordocm_select;
    /* Function to select the row id of the row for the */
    /* given pidm from gobintl. */
    FUNCTION f_get_gobintl_rowid
    (pidm IN GOBINTL.GOBINTL_PIDM%TYPE )
    RETURN ROWID
    AS
    gobintl_rowid rowid := null;
    CURSOR get_gobintl is
    SELECT rowid
    FROM gobintl
    WHERE gobintl_pidm = pidm;
    BEGIN
    OPEN get_gobintl;
    FETCH get_gobintl INTO gobintl_rowid;
    CLOSE get_gobintl;
    RETURN gobintl_rowid;
    END f_get_gobintl_rowid;
    /* Function to select the row id of the row for the */
    /* given pidm from gorvisa. */
    FUNCTION f_get_gorvisa_rowid
    (pidm IN GORVISA.GORVISA_PIDM%TYPE )
    RETURN ROWID
    AS
    gorvisa_rowid rowid := null;
    CURSOR get_gorvisa IS
    SELECT rowid
    FROM gorvisa
    WHERE gorvisa_pidm = pidm
    ORDER BY gorvisa_seq_no desc;
    BEGIN
    OPEN get_gorvisa;
    FETCH get_gorvisa INTO gorvisa_rowid;
    CLOSE get_gorvisa;
    RETURN gorvisa_rowid;
    END f_get_gorvisa_rowid;
    -- new functions for OA to return visa and international data
    FUNCTION f_gorvisa_value
    (p_pidm IN SPRIDEN.SPRIDEN_PIDM%TYPE ,
    p_return_value VARCHAR2)
    RETURN VARCHAR2 IS
    CURSOR get_gorvisa
    IS
         SELECT *
         FROM gorvisa
         WHERE gorvisa_pidm = p_pidm
         ORDER BY gorvisa_seq_no DESC;
         gorvisa_var NUMBER := 0;
    BEGIN
    IF gv_gorvisa_row.gorvisa_pidm is NULL or
    gv_gorvisa_row.gorvisa_pidm <> p_pidm then
    OPEN get_gorvisa;
    FETCH get_gorvisa INTO gv_gorvisa_row;
    IF get_gorvisa%NOTFOUND THEN
    gorvisa_var :=1;
    END IF;
    CLOSE get_gorvisa;
    end if;
    IF gorvisa_var = 0 THEN
    CASE p_return_value
    WHEN 'N' THEN
    RETURN gv_gorvisa_row.gorvisa_visa_number;
    WHEN 'C' THEN
    RETURN gv_gorvisa_row.gorvisa_vtyp_code;
    ELSE
    RETURN ' ';
    END CASE;
    END IF;
    RETURN NULL;
    END f_gorvisa_value;
    FUNCTION f_gobintl_value
    (p_pidm IN SPRIDEN.SPRIDEN_PIDM%TYPE ,
    p_return_value VARCHAR2)
    RETURN VARCHAR2 IS
    CURSOR get_gobintl
    IS
         SELECT      *
         FROM      gobintl
         WHERE      gobintl_pidm = p_pidm;
         gobintl_var NUMBER := 0;
    BEGIN
    IF gv_gobintl_row.gobintl_pidm is NULL or
    gv_gobintl_row.gobintl_pidm <> p_pidm then
    OPEN get_gobintl;
    FETCH get_gobintl INTO gv_gobintl_row;
    IF get_gobintl%NOTFOUND THEN
    gobintl_var := 1;
    END IF;
    CLOSE get_gobintl;
    end if;
    IF gobintl_var = 0 THEN
    CASE p_return_value
    WHEN 'B' THEN
    RETURN gv_gobintl_row.gobintl_natn_code_birth;
    WHEN 'L' THEN
    RETURN gv_gobintl_row.gobintl_natn_code_legal;
    ELSE
    RETURN ' ';
    END CASE;
    END IF;
    RETURN NULL;
    END f_gobintl_value;
    /* Procedure to insert a row into gobintl table. */
    PROCEDURE p_gobintl_insert
    ( pidm IN GOBINTL.GOBINTL_PIDM%TYPE,
    spouse_ind IN GOBINTL.GOBINTL_SPOUSE_IND%TYPE,
    signature_ind IN GOBINTL.GOBINTL_SIGNATURE_IND%TYPE,
    user_id IN GOBINTL.GOBINTL_USER_ID%TYPE,
    activity_date IN GOBINTL.GOBINTL_ACTIVITY_DATE%TYPE,
    passport_id IN GOBINTL.GOBINTL_PASSPORT_ID%TYPE,
    natn_code_issue IN GOBINTL.GOBINTL_NATN_CODE_ISSUE%TYPE,
    passport_exp_date IN GOBINTL.GOBINTL_PASSPORT_EXP_DATE%TYPE,
    i94_status IN GOBINTL.GOBINTL_I94_STATUS%TYPE,
    i94_date IN GOBINTL.GOBINTL_I94_DATE%TYPE,
    reg_number IN GOBINTL.GOBINTL_REG_NUMBER%TYPE,
    duration IN GOBINTL.GOBINTL_DURATION%TYPE,
    celg_code IN GOBINTL.GOBINTL_CELG_CODE%TYPE,
    cert_number IN GOBINTL.GOBINTL_CERT_NUMBER%TYPE,
    cert_date_issue IN GOBINTL.GOBINTL_CERT_DATE_ISSUE%TYPE,
    cert_date_receipt IN GOBINTL.GOBINTL_CERT_DATE_RECEIPT%TYPE,
    admr_code IN GOBINTL.GOBINTL_ADMR_CODE%TYPE,
    natn_code_birth IN GOBINTL.GOBINTL_NATN_CODE_BIRTH%TYPE,
    natn_code_legal IN GOBINTL.GOBINTL_NATN_CODE_LEGAL%TYPE,
    lang_code IN GOBINTL.GOBINTL_LANG_CODE%TYPE,
    spon_code IN GOBINTL.GOBINTL_SPON_CODE%TYPE,
    empt_code IN GOBINTL.GOBINTL_EMPT_CODE%TYPE,
    foreign_ssn IN GOBINTL.GOBINTL_FOREIGN_SSN%TYPE,
    child_number IN GOBINTL.GOBINTL_CHILD_NUMBER%TYPE,
    vpdi IN GOBINTL.GOBINTL_VPDI_CODE%TYPE
    IS
    BEGIN
    INSERT INTO GOBINTL
    ( GOBINTL_PIDM,
    GOBINTL_SPOUSE_IND,
    GOBINTL_SIGNATURE_IND,
    GOBINTL_USER_ID,
    GOBINTL_ACTIVITY_DATE,
    GOBINTL_PASSPORT_ID,
    GOBINTL_NATN_CODE_ISSUE,
    GOBINTL_PASSPORT_EXP_DATE,
    GOBINTL_I94_STATUS,
    GOBINTL_I94_DATE,
    GOBINTL_REG_NUMBER,
    GOBINTL_DURATION,
    GOBINTL_CELG_CODE,
    GOBINTL_CERT_NUMBER,
    GOBINTL_CERT_DATE_ISSUE,
    GOBINTL_CERT_DATE_RECEIPT,
    GOBINTL_ADMR_CODE,
    GOBINTL_NATN_CODE_BIRTH,
    GOBINTL_NATN_CODE_LEGAL,
    GOBINTL_LANG_CODE,
    GOBINTL_SPON_CODE,
    GOBINTL_EMPT_CODE,
    GOBINTL_FOREIGN_SSN,
    GOBINTL_CHILD_NUMBER,
    GOBINTL_VPDI_CODE
    VALUES
    ( pidm,
    NVL(spouse_ind,'T'),
    NVL(signature_ind,'T'),
    user_id,
    activity_date,
    passport_id,
    natn_code_issue,
    passport_exp_date,
    i94_status,
    i94_date,
    reg_number,
    duration,
    celg_code,
    cert_number,
    cert_date_issue,
    cert_date_receipt,
    admr_code,
    natn_code_birth,
    natn_code_legal,
    lang_code,
    spon_code,
    empt_code,
    foreign_ssn,
    child_number,
    'SV'
    END p_gobintl_insert;
    /* Procedure to insert a row into gordocm table. */
    PROCEDURE p_gordocm_insert
    pidm IN GORDOCM.GORDOCM_PIDM%TYPE,
    seq_no IN GORDOCM.GORDOCM_SEQ_NO%TYPE,
    vtyp_code IN GORDOCM.GORDOCM_VTYP_CODE%TYPE,
    visa_number IN GORDOCM.GORDOCM_VISA_NUMBER%TYPE,
    docm_code IN GORDOCM.GORDOCM_DOCM_CODE%TYPE,
    disposition IN GORDOCM.GORDOCM_DISPOSITION%TYPE,
    user_id IN GORDOCM.GORDOCM_USER_ID%TYPE,
    activity_date IN GORDOCM.GORDOCM_ACTIVITY_DATE%TYPE,
    srce_code IN GORDOCM.GORDOCM_SRCE_CODE%TYPE,
    request_date IN GORDOCM.GORDOCM_REQUEST_DATE%TYPE,
    received_date IN GORDOCM.GORDOCM_RECEIVED_DATE%TYPE,
    vpdi_gordocm IN GORDOCM.GORDOCM_VPDI_CODE%TYPE
    IS
    BEGIN
    INSERT INTO GORDOCM
    ( GORDOCM_PIDM,
    GORDOCM_SEQ_NO,
    GORDOCM_VTYP_CODE,
    GORDOCM_VISA_NUMBER,
    GORDOCM_DOCM_CODE,
    GORDOCM_DISPOSITION,
    GORDOCM_USER_ID,
    GORDOCM_ACTIVITY_DATE,
    GORDOCM_SRCE_CODE,
    GORDOCM_REQUEST_DATE,
    GORDOCM_RECEIVED_DATE,
    GORDOCM_VPDI_CODE
    VALUES
    ( pidm,
    seq_no,
    vtyp_code,
    visa_number,
    docm_code,
    disposition,
    user_id,
    activity_date,
    srce_code,
    request_date,
    received_date,
    'SV'
    END p_gordocm_insert;
    /* Procedure to update a row in gobintl table. */
    PROCEDURE p_gobintl_update_row
    ( pidm IN GOBINTL.GOBINTL_PIDM%TYPE,
    spouse_ind IN GOBINTL.GOBINTL_SPOUSE_IND%TYPE,
    signature_ind IN GOBINTL.GOBINTL_SIGNATURE_IND%TYPE,
    user_id IN GOBINTL.GOBINTL_USER_ID%TYPE,
    activity_date IN GOBINTL.GOBINTL_ACTIVITY_DATE%TYPE,
    passport_id IN GOBINTL.GOBINTL_PASSPORT_ID%TYPE,
    natn_code_issue IN GOBINTL.GOBINTL_NATN_CODE_ISSUE%TYPE,
    passport_exp_date IN GOBINTL.GOBINTL_PASSPORT_EXP_DATE%TYPE,
    i94_status IN GOBINTL.GOBINTL_I94_STATUS%TYPE,
    i94_date IN GOBINTL.GOBINTL_I94_DATE%TYPE,
    reg_number IN GOBINTL.GOBINTL_REG_NUMBER%TYPE,
    duration IN GOBINTL.GOBINTL_DURATION%TYPE,
    celg_code IN GOBINTL.GOBINTL_CELG_CODE%TYPE,
    cert_number IN GOBINTL.GOBINTL_CERT_NUMBER%TYPE,
    cert_date_issue IN GOBINTL.GOBINTL_CERT_DATE_ISSUE%TYPE,
    cert_date_receipt IN GOBINTL.GOBINTL_CERT_DATE_RECEIPT%TYPE,
    admr_code IN GOBINTL.GOBINTL_ADMR_CODE%TYPE,
    natn_code_birth IN GOBINTL.GOBINTL_NATN_CODE_BIRTH%TYPE,
    natn_code_legal IN GOBINTL.GOBINTL_NATN_CODE_LEGAL%TYPE,
    lang_code IN GOBINTL.GOBINTL_LANG_CODE%TYPE,
    spon_code IN GOBINTL.GOBINTL_SPON_CODE%TYPE,
    empt_code IN GOBINTL.GOBINTL_EMPT_CODE%TYPE,
    foreign_ssn IN GOBINTL.GOBINTL_FOREIGN_SSN%TYPE,
    child_number IN GOBINTL.GOBINTL_CHILD_NUMBER%TYPE,
    vpdi IN GOBINTL.GOBINTL_VPDI_CODE%TYPE
    IS
    BEGIN
    UPDATE GOBINTL
    SET GOBINTL_SPOUSE_IND = spouse_ind,
    GOBINTL_SIGNATURE_IND = signature_ind,
    GOBINTL_USER_ID = user_id,
    GOBINTL_ACTIVITY_DATE = activity_date,
    GOBINTL_PASSPORT_ID = passport_id,
    GOBINTL_NATN_CODE_ISSUE = natn_code_issue,
    GOBINTL_PASSPORT_EXP_DATE = passport_exp_date,
    GOBINTL_I94_STATUS = i94_status,
    GOBINTL_I94_DATE = i94_date,
    GOBINTL_REG_NUMBER = reg_number,
    GOBINTL_DURATION = duration,
    GOBINTL_CELG_CODE = celg_code,
    GOBINTL_CERT_NUMBER = cert_number,
    GOBINTL_CERT_DATE_ISSUE = cert_date_issue,
    GOBINTL_CERT_DATE_RECEIPT = cert_date_receipt,
    GOBINTL_ADMR_CODE = admr_code,
    GOBINTL_NATN_CODE_BIRTH = natn_code_birth,
    GOBINTL_NATN_CODE_LEGAL = natn_code_legal,
    GOBINTL_LANG_CODE = lang_code,
    GOBINTL_SPON_CODE = spon_code,
    GOBINTL_EMPT_CODE = empt_code,
    GOBINTL_FOREIGN_SSN = foreign_ssn,
    GOBINTL_CHILD_NUMBER = child_number,
    GOBINTL_VPDI_CODE = 'SV'
    WHERE GOBINTL_PIDM = pidm;
    END p_gobintl_update_row;
    /* Procedure to update a row in gordocm table. */
    PROCEDURE p_gordocm_update_row
    pidm IN GORDOCM.GORDOCM_PIDM%TYPE,
    seq_no IN GORDOCM.GORDOCM_SEQ_NO%TYPE,
    vtyp_code IN GORDOCM.GORDOCM_VTYP_CODE%TYPE,
    visa_number IN GORDOCM.GORDOCM_VISA_NUMBER%TYPE,
    docm_code IN GORDOCM.GORDOCM_DOCM_CODE%TYPE,
    disposition IN GORDOCM.GORDOCM_DISPOSITION%TYPE,
    user_id IN GORDOCM.GORDOCM_USER_ID%TYPE,
    activity_date IN GORDOCM.GORDOCM_ACTIVITY_DATE%TYPE,
    srce_code IN GORDOCM.GORDOCM_SRCE_CODE%TYPE,
    request_date IN GORDOCM.GORDOCM_REQUEST_DATE%TYPE,
    received_date IN GORDOCM.GORDOCM_RECEIVED_DATE%TYPE,
    vpdi_gordocm IN GORDOCM.GORDOCM_VPDI_CODE%TYPE
    IS
    BEGIN
    UPDATE GORDOCM
    SET GORDOCM_DISPOSITION = disposition,
    GORDOCM_USER_ID = user_id,
    GORDOCM_ACTIVITY_DATE = activity_date,
    GORDOCM_SRCE_CODE = srce_code,
    GORDOCM_REQUEST_DATE = request_date,
    GORDOCM_RECEIVED_DATE = received_date,
    GORDOCM_VPDI_CODE = vpdi_gordocm
    WHERE GORDOCM_PIDM = pidm
    AND GORDOCM_SEQ_NO = seq_no
    AND GORDOCM_VTYP_CODE = vtyp_code
    AND GORDOCM_VISA_NUMBER = visa_number
    AND GORDOCM_DOCM_CODE = docm_code;
    END p_gordocm_update_row;
    /* Procedure to delete a row from gobintl table. */
    PROCEDURE p_gobintl_delete_row
    pidm IN GOBINTL.GOBINTL_PIDM%TYPE
    IS
    BEGIN
    DELETE
    FROM GOBINTL
    WHERE GOBINTL_PIDM = pidm;
    END p_gobintl_delete_row;
    /* Procedure to delete a row from gordocm table. */
    PROCEDURE p_gordocm_delete_row
    pidm IN GORDOCM.GORDOCM_PIDM%TYPE,
    seq_no IN GORDOCM.GORDOCM_SEQ_NO%TYPE,
    vtyp_code IN GORDOCM.GORDOCM_VTYP_CODE%TYPE,
    visa_number IN GORDOCM.GORDOCM_VISA_NUMBER%TYPE,
    docm_code IN GORDOCM.GORDOCM_DOCM_CODE%TYPE
    IS
    BEGIN
    DELETE
    FROM GORDOCM
    WHERE GORDOCM_PIDM = pidm
    AND GORDOCM_SEQ_NO = seq_no
    AND GORDOCM_VTYP_CODE = vtyp_code
    AND GORDOCM_VISA_NUMBER = visa_number
    AND GORDOCM_DOCM_CODE = docm_code;
    END p_gordocm_delete_row;
    END GOKINTL;
    /

    Hello,
    Create a package specifiction see following example and add just defintions or all the function and procedure
    CREATE OR REPLACE PACKAGE gokintl
    AS
       PROCEDURE item_logging;
       FUNCTION get_sys_parms (i_parameter IN VARCHAR2)
          RETURN VARCHAR2;
    END gokintl;
    /Then package body, I have comment FIX THIS SOMETHING WRONG take a look and fix your logic
    CREATE OR REPLACE PACKAGE BODY gokintl
    AS
       FUNCTION f_check_gobintl_exists (pidm IN gobintl.gobintl_pidm%TYPE)
          RETURN VARCHAR2
       IS
          status            VARCHAR2 (1) := '';
          chk_gobintl_tab   VARCHAR2 (1) := '';
          CURSOR gobintl_c
          IS
             SELECT 'Y'
             FROM gobintl
             WHERE gobintl_pidm = pidm;
       BEGIN
          OPEN gobintl_c;
          FETCH gobintl_c INTO chk_gobintl_tab;
          IF gobintl_c%NOTFOUND
          THEN
             status   := 'N';
          ELSE
             status   := 'Y';
          END IF;
          CLOSE gobintl_c;
          RETURN status;
       END f_check_gobintl_exists;
       /* Function to determine whether the student is a */
       /* non-resident alien or not. */
       FUNCTION f_check_nonresident_status (pidm IN gorvisa.gorvisa_pidm%TYPE,
                                            input_date IN gorvisa.gorvisa_visa_start_date%TYPE
          RETURN VARCHAR2
       IS
          status                VARCHAR2 (1) := '';
          chk_non_resi_status   VARCHAR2 (1) := '';
          CURSOR chk_nonresi_status_c
          IS
             SELECT 'Y'
             FROM gorvisa, stvvtyp
             WHERE     stvvtyp_non_res_ind = 'Y'
                   AND gorvisa_vtyp_code = stvvtyp_code
                   AND gorvisa_pidm = pidm
                   AND gorvisa_visa_start_date <= TRUNC (input_date)
                   AND gorvisa_visa_expire_date >= TRUNC (input_date);
       BEGIN
          OPEN chk_nonresi_status_c;
          FETCH chk_nonresi_status_c INTO chk_non_resi_status;
          IF chk_nonresi_status_c%NOTFOUND
          THEN
             status   := 'N';
          ELSE
             status   := 'Y';
          END IF;
          CLOSE chk_nonresi_status_c;
          RETURN status;
       END f_check_nonresident_status;
       /* Function to select a single row from gobintl table. */
       FUNCTION f_gobintl_select (pidm gobintl.gobintl_pidm%TYPE)
          RETURN gobintl%ROWTYPE
       IS
          gobintl_row   gobintl%ROWTYPE;
          CURSOR gobintl_c
          IS
             SELECT gobintl_pidm,
                    gobintl_spouse_ind,
                    gobintl_signature_ind,
                    gobintl_user_id,
                    gobintl_activity_date,
                    gobintl_passport_id,
                    gobintl_natn_code_issue,
                    gobintl_passport_exp_date,
                    gobintl_i94_status,
                    gobintl_i94_date,
                    gobintl_reg_number,
                    gobintl_duration,
                    gobintl_celg_code,
                    gobintl_cert_number,
                    gobintl_cert_date_issue,
                    gobintl_cert_date_receipt,
                    gobintl_admr_code,
                    gobintl_natn_code_birth,
                    gobintl_natn_code_legal,
                    gobintl_lang_code,
                    gobintl_spon_code,
                    gobintl_empt_code,
                    gobintl_foreign_ssn,
                    gobintl_child_number,
                    gobintl_vpdi_code
             FROM gobintl
             WHERE gobintl_pidm = pidm;
       BEGIN
          OPEN gobintl_c;
          FETCH gobintl_c INTO gobintl_row;
          CLOSE gobintl_c;
          RETURN gobintl_row;
       END f_gobintl_select;
       /* Function to select a single row from gordocm table. */
       FUNCTION f_gordocm_select (pidm IN gordocm.gordocm_pidm%TYPE,
                                  seq_no IN gordocm.gordocm_seq_no%TYPE,
                                  vtyp_code IN gordocm.gordocm_vtyp_code%TYPE,
                                  visa_number IN gordocm.gordocm_visa_number%TYPE,
                                  docm_code IN gordocm.gordocm_docm_code%TYPE
          RETURN gordocm%ROWTYPE
       IS
          gordocm_row   gordocm%ROWTYPE;
          CURSOR gordocm_c
          IS
             SELECT gordocm_pidm,
                    gordocm_seq_no,
                    gordocm_vtyp_code,
                    gordocm_visa_number,
                    gordocm_docm_code,
                    gordocm_disposition,
                    gordocm_user_id,
                    gordocm_activity_date,
                    gordocm_srce_code,
                    gordocm_request_date,
                    gordocm_received_date
             FROM gordocm
             WHERE     gordocm_pidm = pidm
                   AND gordocm_seq_no = seq_no
                   AND gordocm_vtyp_code = vtyp_code
                   AND gordocm_visa_number = visa_number
                   AND gordocm_docm_code = docm_code;
       BEGIN
          OPEN gordocm_c;
          FETCH gordocm_c INTO gordocm_row;
          CLOSE gordocm_c;
          RETURN gordocm_row;
       END f_gordocm_select;
       /* Function to select the row id of the row for the */
       /* given pidm from gobintl. */
       FUNCTION f_get_gobintl_rowid (pidm IN gobintl.gobintl_pidm%TYPE)
          RETURN ROWID
       AS
          gobintl_rowid   ROWID := NULL;
          CURSOR get_gobintl
          IS
             SELECT ROWID
             FROM gobintl
             WHERE gobintl_pidm = pidm;
       BEGIN
          OPEN get_gobintl;
          FETCH get_gobintl INTO gobintl_rowid;
          CLOSE get_gobintl;
          RETURN gobintl_rowid;
       END f_get_gobintl_rowid;
       /* Function to select the row id of the row for the */
       /* given pidm from gorvisa. */
       FUNCTION f_get_gorvisa_rowid (pidm IN gorvisa.gorvisa_pidm%TYPE)
          RETURN ROWID
       AS
          gorvisa_rowid   ROWID := NULL;
          CURSOR get_gorvisa
          IS
             SELECT ROWID
             FROM gorvisa
             WHERE gorvisa_pidm = pidm
             ORDER BY gorvisa_seq_no DESC;
       BEGIN
          OPEN get_gorvisa;
          FETCH get_gorvisa INTO gorvisa_rowid;
          CLOSE get_gorvisa;
          RETURN gorvisa_rowid;
       END f_get_gorvisa_rowid;
       -- new functions for OA to return visa and international data
       FUNCTION f_gorvisa_value (p_pidm IN spriden.spriden_pidm%TYPE,
                                 p_return_value varchar2
          RETURN VARCHAR2
       IS
          CURSOR get_gorvisa
          IS
             SELECT *
             FROM gorvisa
             WHERE gorvisa_pidm = p_pidm
             ORDER BY gorvisa_seq_no DESC;
          gorvisa_var   NUMBER := 0;
       BEGIN
          IF (gv_gorvisa_row.gorvisa_pidm IS NULL
              OR gv_gorvisa_row.gorvisa_pidm = p_pidm) --- FIX THIS SOMETHIGNG WRONG HERE
          THEN
             OPEN get_gorvisa;
             FETCH get_gorvisa INTO gv_gorvisa_row;
             IF get_gorvisa%NOTFOUND
             THEN
                gorvisa_var   := 1;
             END IF;
             CLOSE get_gorvisa;
          END IF;
          IF gorvisa_var = 0
          THEN
             CASE p_return_value
                WHEN 'N'
                THEN
                   RETURN gv_gorvisa_row.gorvisa_visa_number;
                WHEN 'C'
                THEN
                   RETURN gv_gorvisa_row.gorvisa_vtyp_code;
                ELSE
                   RETURN ' ';
             END CASE;
          END IF;
          RETURN NULL;
       END f_gorvisa_value;
       FUNCTION f_gobintl_value (p_pidm IN spriden.spriden_pidm%TYPE,
                                 p_return_value varchar2
          RETURN VARCHAR2
       IS
          CURSOR get_gobintl
          IS
             SELECT *
             FROM gobintl
             WHERE gobintl_pidm = p_pidm;
          gobintl_var   NUMBER := 0;
       BEGIN
          IF gv_gobintl_row.gobintl_pidm IS NULL
             OR gv_gobintl_row.gobintl_pidm = p_pidm -- FIX THIS SOMETHIGNG WRONG HERE
          THEN
             OPEN get_gobintl;
             FETCH get_gobintl INTO gv_gobintl_row;
             IF get_gobintl%NOTFOUND
             THEN
                gobintl_var   := 1;
             END IF;
             CLOSE get_gobintl;
          END IF;
          IF gobintl_var = 0
          THEN
             CASE p_return_value
                WHEN 'B'
                THEN
                   RETURN gv_gobintl_row.gobintl_natn_code_birth;
                WHEN 'L'
                THEN
                   RETURN gv_gobintl_row.gobintl_natn_code_legal;
                ELSE
                   RETURN ' ';
             END CASE;
          END IF;
          RETURN NULL;
       END f_gobintl_value;
       /* Procedure to insert a row into gobintl table. */
       PROCEDURE p_gobintl_insert (pidm IN gobintl.gobintl_pidm%TYPE,
                                   spouse_ind IN gobintl.gobintl_spouse_ind%TYPE,
                                   signature_ind IN gobintl.gobintl_signature_ind%TYPE,
                                   user_id IN gobintl.gobintl_user_id%TYPE,
                                   activity_date IN gobintl.gobintl_activity_date%TYPE,
                                   passport_id IN gobintl.gobintl_passport_id%TYPE,
                                   natn_code_issue IN gobintl.gobintl_natn_code_issue%TYPE,
                                   passport_exp_date IN gobintl.gobintl_passport_exp_date%TYPE,
                                   i94_status IN gobintl.gobintl_i94_status%TYPE,
                                   i94_date IN gobintl.gobintl_i94_date%TYPE,
                                   reg_number IN gobintl.gobintl_reg_number%TYPE,
                                   duration IN gobintl.gobintl_duration%TYPE,
                                   celg_code IN gobintl.gobintl_celg_code%TYPE,
                                   cert_number IN gobintl.gobintl_cert_number%TYPE,
                                   cert_date_issue IN gobintl.gobintl_cert_date_issue%TYPE,
                                   cert_date_receipt IN gobintl.gobintl_cert_date_receipt%TYPE,
                                   admr_code IN gobintl.gobintl_admr_code%TYPE,
                                   natn_code_birth IN gobintl.gobintl_natn_code_birth%TYPE,
                                   natn_code_legal IN gobintl.gobintl_natn_code_legal%TYPE,
                                   lang_code IN gobintl.gobintl_lang_code%TYPE,
                                   spon_code IN gobintl.gobintl_spon_code%TYPE,
                                   empt_code IN gobintl.gobintl_empt_code%TYPE,
                                   foreign_ssn IN gobintl.gobintl_foreign_ssn%TYPE,
                                   child_number IN gobintl.gobintl_child_number%TYPE,
                                   vpdi IN gobintl.gobintl_vpdi_code%TYPE
       IS
       BEGIN
          INSERT INTO gobintl
             gobintl_pidm,
             gobintl_spouse_ind,
             gobintl_signature_ind,
             gobintl_user_id,
             gobintl_activity_date,
             gobintl_passport_id,
             gobintl_natn_code_issue,
             gobintl_passport_exp_date,
             gobintl_i94_status,
             gobintl_i94_date,
             gobintl_reg_number,
             gobintl_duration,
             gobintl_celg_code,
             gobintl_cert_number,
             gobintl_cert_date_issue,
             gobintl_cert_date_receipt,
             gobintl_admr_code,
             gobintl_natn_code_birth,
             gobintl_natn_code_legal,
             gobintl_lang_code,
             gobintl_spon_code,
             gobintl_empt_code,
             gobintl_foreign_ssn,
             gobintl_child_number,
             gobintl_vpdi_code
          VALUES (
                    pidm,
                    NVL (spouse_ind, 'T'),
                    NVL (signature_ind, 'T'),
                    user_id,
                    activity_date,
                    passport_id,
                    natn_code_issue,
                    passport_exp_date,
                    i94_status,
                    i94_date,
                    reg_number,
                    duration,
                    celg_code,
                    cert_number,
                    cert_date_issue,
                    cert_date_receipt,
                    admr_code,
                    natn_code_birth,
                    natn_code_legal,
                    lang_code,
                    spon_code,
                    empt_code,
                    foreign_ssn,
                    child_number,
                    'SV'
       END p_gobintl_insert;
       /* Procedure to insert a row into gordocm table. */
       PROCEDURE p_gordocm_insert (pidm IN gordocm.gordocm_pidm%TYPE,
                                   seq_no IN gordocm.gordocm_seq_no%TYPE,
                                   vtyp_code IN gordocm.gordocm_vtyp_code%TYPE,
                                   visa_number IN gordocm.gordocm_visa_number%TYPE,
                                   docm_code IN gordocm.gordocm_docm_code%TYPE,
                                   disposition IN gordocm.gordocm_disposition%TYPE,
                                   user_id IN gordocm.gordocm_user_id%TYPE,
                                   activity_date IN gordocm.gordocm_activity_date%TYPE,
                                   srce_code IN gordocm.gordocm_srce_code%TYPE,
                                   request_date IN gordocm.gordocm_request_date%TYPE,
                                   received_date IN gordocm.gordocm_received_date%TYPE,
                                   vpdi_gordocm IN gordocm.gordocm_vpdi_code%TYPE
       IS
       BEGIN
          INSERT INTO gordocm
             gordocm_pidm,
             gordocm_seq_no,
             gordocm_vtyp_code,
             gordocm_visa_number,
             gordocm_docm_code,
             gordocm_disposition,
             gordocm_user_id,
             gordocm_activity_date,
             gordocm_srce_code,
             gordocm_request_date,
             gordocm_received_date,
             gordocm_vpdi_code
          VALUES (
                    pidm,
                    seq_no,
                    vtyp_code,
                    visa_number,
                    docm_code,
                    disposition,
                    user_id,
                    activity_date,
                    srce_code,
                    request_date,
                    received_date,
                    'SV'
       END p_gordocm_insert;
       /* Procedure to update a row in gobintl table. */
       PROCEDURE p_gobintl_update_row (pidm IN gobintl.gobintl_pidm%TYPE,
                                       spouse_ind IN gobintl.gobintl_spouse_ind%TYPE,
                                       signature_ind IN gobintl.gobintl_signature_ind%TYPE,
                                       user_id IN gobintl.gobintl_user_id%TYPE,
                                       activity_date IN gobintl.gobintl_activity_date%TYPE,
                                       passport_id IN gobintl.gobintl_passport_id%TYPE,
                                       natn_code_issue IN gobintl.gobintl_natn_code_issue%TYPE,
                                       passport_exp_date IN gobintl.gobintl_passport_exp_date%TYPE,
                                       i94_status IN gobintl.gobintl_i94_status%TYPE,
                                       i94_date IN gobintl.gobintl_i94_date%TYPE,
                                       reg_number IN gobintl.gobintl_reg_number%TYPE,
                                       duration IN gobintl.gobintl_duration%TYPE,
                                       celg_code IN gobintl.gobintl_celg_code%TYPE,
                                       cert_number IN gobintl.gobintl_cert_number%TYPE,
                                       cert_date_issue IN gobintl.gobintl_cert_date_issue%TYPE,
                                       cert_date_receipt IN gobintl.gobintl_cert_date_receipt%TYPE,
                                       admr_code IN gobintl.gobintl_admr_code%TYPE,
                                       natn_code_birth IN gobintl.gobintl_natn_code_birth%TYPE,
                                       natn_code_legal IN gobintl.gobintl_natn_code_legal%TYPE,
                                       lang_code IN gobintl.gobintl_lang_code%TYPE,
                                       spon_code IN gobintl.gobintl_spon_code%TYPE,
                                       empt_code IN gobintl.gobintl_empt_code%TYPE,
                                       foreign_ssn IN gobintl.gobintl_foreign_ssn%TYPE,
                                       child_number IN gobintl.gobintl_child_number%TYPE,
                                       vpdi IN gobintl.gobintl_vpdi_code%TYPE
       IS
       BEGIN
          UPDATE gobintl
          SET gobintl_spouse_ind          = spouse_ind,
              gobintl_signature_ind       = signature_ind,
              gobintl_user_id             = user_id,
              gobintl_activity_date       = activity_date,
              gobintl_passport_id         = passport_id,
              gobintl_natn_code_issue     = natn_code_issue,
              gobintl_passport_exp_date   = passport_exp_date,
              gobintl_i94_status          = i94_status,
              gobintl_i94_date            = i94_date,
              gobintl_reg_number          = reg_number,
              gobintl_duration            = duration,
              gobintl_celg_code           = celg_code,
              gobintl_cert_number         = cert_number,
              gobintl_cert_date_issue     = cert_date_issue,
              gobintl_cert_date_receipt   = cert_date_receipt,
              gobintl_admr_code           = admr_code,
              gobintl_natn_code_birth     = natn_code_birth,
              gobintl_natn_code_legal     = natn_code_legal,
              gobintl_lang_code           = lang_code,
              gobintl_spon_code           = spon_code,
              gobintl_empt_code           = empt_code,
              gobintl_foreign_ssn         = foreign_ssn,
              gobintl_child_number        = child_number,
              gobintl_vpdi_code           = 'SV'
          WHERE gobintl_pidm = pidm;
       END p_gobintl_update_row;
       /* Procedure to update a row in gordocm table. */
       PROCEDURE p_gordocm_update_row (pidm IN gordocm.gordocm_pidm%TYPE,
                                       seq_no IN gordocm.gordocm_seq_no%TYPE,
                                       vtyp_code IN gordocm.gordocm_vtyp_code%TYPE,
                                       visa_number IN gordocm.gordocm_visa_number%TYPE,
                                       docm_code IN gordocm.gordocm_docm_code%TYPE,
                                       disposition IN gordocm.gordocm_disposition%TYPE,
                                       user_id IN gordocm.gordocm_user_id%TYPE,
                                       activity_date IN gordocm.gordocm_activity_date%TYPE,
                                       srce_code IN gordocm.gordocm_srce_code%TYPE,
                                       request_date IN gordocm.gordocm_request_date%TYPE,
                                       received_date IN gordocm.gordocm_received_date%TYPE,
                                       vpdi_gordocm IN gordocm.gordocm_vpdi_code%TYPE
       IS
       BEGIN
          UPDATE gordocm
          SET gordocm_disposition     = disposition,
              gordocm_user_id         = user_id,
              gordocm_activity_date   = activity_date,
              gordocm_srce_code       = srce_code,
              gordocm_request_date    = request_date,
              gordocm_received_date   = received_date,
              gordocm_vpdi_code       = vpdi_gordocm
          WHERE     gordocm_pidm = pidm
                AND gordocm_seq_no = seq_no
                AND gordocm_vtyp_code = vtyp_code
                AND gordocm_visa_number = visa_number
                AND gordocm_docm_code = docm_code;
       END p_gordocm_update_row;
       /* Procedure to delete a row from gobintl table. */
       PROCEDURE p_gobintl_delete_row (pidm IN gobintl.gobintl_pidm%TYPE)
       IS
       BEGIN
          DELETE FROM gobintl
          WHERE gobintl_pidm = pidm;
       END p_gobintl_delete_row;
       /* Procedure to delete a row from gordocm table. */
       PROCEDURE p_gordocm_delete_row (pidm IN gordocm.gordocm_pidm%TYPE,
                                       seq_no IN gordocm.gordocm_seq_no%TYPE,
                                       vtyp_code IN gordocm.gordocm_vtyp_code%TYPE,
                                       visa_number IN gordocm.gordocm_visa_number%TYPE,
                                       docm_code IN gordocm.gordocm_docm_code%TYPE
       IS
       BEGIN
          DELETE FROM gordocm
          WHERE     gordocm_pidm = pidm
                AND gordocm_seq_no = seq_no
                AND gordocm_vtyp_code = vtyp_code
                AND gordocm_visa_number = visa_number
                AND gordocm_docm_code = docm_code;
       END p_gordocm_delete_row;
    END gokintl;
    /Regards

Maybe you are looking for

  • Compatibility View Settings

    Microsoft in their infinite wisdom has decided that Compatibility View is to be treated as Browsing History and therefore cleared on closure of the current Window.  Wonderful stuff!  We deal with lots of sites that are developed for IE7 such as Banks

  • I have an imac running 10.4.11 and want to install 10.5.8. How do I do that?

    I have an imac running 10.4.11 and want to install 10.5.8. How do I do that?

  • Macbook pro 15" display flicker/glitch

    i got a macbook pro retina last month which has recently started to have some display issues. recently this glitch/flicker has become permanent.  approx 5cm wide and runs down the length of my screen are colored lines. i have attached a picture i too

  • Standard MRP report ( or ABAP BAPI)

    Pl. Guide for a standard MRP report ( or ABAP BAPI) which can provide details Like Stock, Material MRP Element Receipt/Reqmt , QM Stock , CusOrd , PrdOrd , PldOrd , Ord.DS I am aware of MD04 But I Need a Report for Bulk materials.

  • GUI TAX Issue in MIR7

    Hi Friends, i found strange thing in MIR7, Scenario: i am trying to park the account assignment PO and i checked the calculate Tax check box, then tax amount is showing wrongly, but in tax tab it is showing correct. Due to this issue balance showing