Create package body
It's been so long since I've created a package that I can't remember how. The package spec I can create easily enough by right clicking the Package icon in the navigator and clicking "New Package", but where does the body come from? Thanks.
Never mind. The “Create Body” option on the right-click menu appears AFTER you select the package icon and click "Refresh."
Similar Messages
-
Error while creating Package body
Hi I tried the following package is created but body is created with errors
CREATE OR REPLACE PACKAGE pack_ttt IS
TYPE rec_ttt_colinfo IS RECORD (
columnName VARCHAR2(30));
TYPE nt_ttt_colInformation IS TABLE OF rec_ttt_colinfo;
FUNCTION getColumns(schemaNm VARCHAR2 , TableNm VARCHAR2)
RETURN nt_ttt_colInformation;
END;
CREATE OR REPLACE PACKAGE BODY pack_ttt IS
function getColumns(
schemaNm VARCHAR2 ,
TableNm VARCHAR2)
RETURN nt_ttt_colInformation IS
colvarfunc1 nt_ttt_colInformation;
EXECUTE IMMEDIATE 'SELECT COLUMN_NAME, DATA_TYPE FROM ALL_TAB_COLUMNS WHERE OWNER = ''' || schemaNm || ''' AND TABLE_NAME = ''' || TableNm || ''''
BULK COLLECT INTO columnsList;
RETURN colvarfunc1;
END;
END;And the error is
LINE/COL ERROR
7/20 PLS-00103: Encountered the symbol "SELECT COLUMN_NAME, DATA_TYPE
FROM ALL_TAB_COLUMNS WHERE OWNER =" when expecting one of the
following:
:= . ( @ % ; not null range default character
The symbol ":=" was substituted for "SELECT COLUMN_NAME,
DATA_TYPE FROM ALL_TAB_COLUMNS WHERE OWNER =" to continue.
8/7 PLS-00103: Encountered the symbol "BULK" when expecting one of
the following:
* & = - + ; < / > at in is mod remainder not rem
<an exponent (**)> <> or != or ~= >= <= <> and or like LIKE2_
LINE/COL ERROR
LIKE4_ LIKEC_ between || member SUBMULTISET_Why are you using dynamic SQL, there is absolutely no need for that. And the way you are using it is plain wrong, since it is subject to SQL injection and hard parsing.
CREATE OR REPLACE PACKAGE BODY pack_ttt IS
FUNCTION getcolumns (
schemanm VARCHAR2,
tablenm VARCHAR2
RETURN nt_ttt_colinformation IS
colvarfunc1 nt_ttt_colinformation;
BEGIN
SELECT column_name,
data_type
BULK COLLECT INTO columnslist
FROM all_tab_columns
WHERE owner = schemanm
AND table_name = tablenm;
RETURN colvarfunc1;
END;
END;
/Don't get into the habbit of doing dynamic sql, it just demonstrates that you have no clue whatsoever as to what you are dealing with.
Regards
Peter -
BUG 1.5 : Can't create package body.
I'm getting this stack dump in the console trying to create a package body.
I'm logged in as a dba.
executed 'alter session set current schema=x';
created package in the worksheet.
opened package from Other users|x|packages.
Edited and compiled package.
Tried to create body from connection tree context menu.
I have both viewer and edit window open on the package. The stack dump occurs regardless of which one had focus before I go to the tree to create the body.
Exception while performing action Create Body
java.lang.IllegalStateException: Not in compound edit
at oracle.javatools.buffer.AbstractTextBuffer.endEdit(AbstractTextBuffer.java:1126)
at oracle.ide.model.TextNode$FacadeTextBuffer.endEdit(TextNode.java:1074)
at oracle.dbtools.raptor.dialogs.actions.CreateBodyAction.launch(CreateBodyAction.java:94)
at oracle.dbtools.raptor.controls.sqldialog.ObjectActionController.handleEvent(ObjectActionController.java:140)
at oracle.ide.controller.IdeAction.performAction(IdeAction.java:524)
at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:855)
at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:496)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)This has been fixed for the patch release 1.5.1.
Sue -
Table or views does not exists on create package body
Hi folks.....
I',m having a problem....
I am trying to create the pakage body, but i can't because i'm get the error ORA-000942 TABLE OR VIEWS DOES NOT EXIST, i don't understand !!!!
When i create de procedure, it's suscessful
I did GRANT ALL ON GEMCO.CAD_FILIAL TO USR_MLADMIN;
But the error persisits
Someone has any idea ?
Tanks SpaulonciIs USR_MLADMIN a role or a schema?
You need to grant the privileges directly to the schema and not through a role -
Problem in package body creation
Hello,
I am a newbie in PL/SQL.I am sorry for posting a very silly question,but I am struggling since 2 days trying to get this PL/SQL code working.Dont know whats wrong with it.I consulated a lot of tutorials and online sources..But still couldnt figure out whats wrong.I get the following error
LINE/COL ERROR
6/1 PLS-00103: Encountered the symbol "CREATE"
The code is like following
CREATE or replace package test AS
procedure extract_tmp_reifs ;
end;
CREATE OR REPLACE PACKAGE BODY test IS procedure extract_info(models IN varchar2,rulebases IN varchar2) is
stmt varchar2(4000);
model_name varchar2(4000);
rulebase_name varchar2(4000);
--Create table invocation
begin
model_name := models;
rulebase_name := rulebases;
stmt := 'create table '|| model_name ||'_'||rulebase_name||'_t$'||'(id number primary key, triple_id number, sd date, ed date)';
execute immediate stmt;
commit;
end extract_tmp_reifs;
end temporal_reification;
The line 6 is for the Create package body thing.
WIll be grateful if some one can give a hint as to whats wrong wiith it.Please help me
Thanks
Regards
Prateek!> The requirement is to have a procedure which when provided two parameters
creates a table based on the parameters,and then values are inserted into the
table by using data from other tables.Thats why the dynamic creation of table.
I still don't like it. Besides the dynamic create issue, there is a relational design issue at stake here.
Attribute data is to be carried in the columns of a table - and not in the table name. The correct relation (from the little code I've seen posted here) is:
Model Rules = ( Model ID, Rulebase ID, Tripple ID, Start Date, End Date)
And not multiple relations where the relational table's name is dynamic and the attribute data carried in the name of the table. To put it into context, it is the same as defining an Invoice Relation as:
Invoices_20070305 = ( Invoice ID, Customer ID, Product ID, Quantity, Unit Cost, ..etc.. )
Instead of putting the date as an attribute value into the relation:
Invoices = ( Invoice ID, Invoice Date, Customer ID, Product ID, Quantity, Unit Cost, ..etc.. )
Using this dynamic method you can wind up with 1000's of tables for Model Rules. How are you going to make use of referential integrity? What about indexing? What about the complexity of having all these many dynamic tables and attempting to query them with a single query?
99% of the time, dynamically creating relations (tables) in a RDBMS is the wrong thing to do. And unless you can convince me that you have the 1% exception to the rule, I'm going to be very skeptical about the dynamic table create approach you have chosen. It is simply wrong. -
Trying to create package and do not understand error message
What is wrong with this statement. Its say ASH411APPROVALEMAIL_PKG is not declared. I am trying to create it. Whats wrong?
ERROR MESSAGE
I get the following error.
Error at line 1: PLS-00201: IDENTIFIER 'ASH411APPROVALEMAIL_PKG' must be declared1. CREATE OR REPLACE PACKAGE BODY ASH411APPROVALEMAIL_PKG
2. AS
3. PROCEDURE ASH411APPROVALEMAIL_async (P_ATS_NO NUMBER
CODE
CREATE OR REPLACE PACKAGE BODY ASH411APPROVALEMAIL_PKG
AS
PROCEDURE ASH411APPROVALEMAIL_async (P_ATS_NO NUMBER)
AS
BEGIN
DBMS_SCHEDULER.define_program_argument (program_name => 'ASH411APPROVALEMAIL',
argument_position => 1,
argument_name => 'P_ATS_NO',
argument_type => 'NUMBER'
--,DEFAULT_VALUE => whatever_value
DBMS_SCHEDULER.ENABLE (NAME => 'ASH411APPROVALEMAIL');
DBMS_SCHEDULER.create_job (job_name => 'ASH411APPROVALEMAIL_JOBNAME'
|| P_ATS_NO,
program_name => 'ASH411APPROVALEMAIL',
enabled => TRUE,
comments => 'Comments'
EXCEPTION
WHEN NO_DATA_FOUND THEN
null;
END ASH411APPROVALEMAIL_async;
end ASH411APPROVALEMAIL_PKG;Hi, Howard,
csphard wrote:
Now when I go back and create the package again with the procedures it say package body created but does not
display anything."Package body created" is all it ever says (unless there's an error message).
How do I see the procedures I just created when I ran the package again with the procedures?If you want to see the source code, look at the CREATE PACKAGE BODY command in the script you just ran, or query the data dictionary view user_source:
SELECT text
FROM user_source
WHERE name = 'ASH411APPROVALEMAIL_PKG'
AND type = 'PACKAGE BODY'
ORDER BY line
; -
3.1EA1: Database Diff Package Body
I've had some problems when comparing package bodies.
1. Sometimes two or more lines in package bodies are combined into one in the DDL and script tabs of the comparison pane in the difference report.
2. Sometimes differences in package bodies are missed completely. When this happens, the package body text shown in both sides of the DDL tab of the comparison pane are from the same connection.
RodneyTurns out the consequences of the first problem (merging lines) I mentioned can be severe. The problem occurs when a line ends with a single quotation mark as in the following contrived example.
CREATE PACKAGE b AS END;
CREATE PACKAGE BODY b AS
v --'
INTEGER --'
:= --'
1; --'
END;
/The difference process produces the following:
CREATE OR REPLACE PACKAGE BODY "B" AS
v --' INTEGER --' := --' 1; --'END;/That ends up in the final script as well which means the script will fail upon execution.
Rodney -
Package body variable- is it always safe to use it?
In a package spec i have a function "function1" and in package body this functions does following:
1) it evaluate/calculate a variable/value "Flag1".
2) it calls 4 (package body) functions that needs to use value "Flag1".
I have forgotten how "package body variables" work. Is it safe to declare variable "Flag1" in a "package body" level? So that "function1" can initialize this variable and 4 functions can use this variable later too. Or it is not safe if i have lot of sessions in my database which may go into conflict with sharing this "flag1"? And i perhaps better send "flag1" as function parameter to all 4 functions?Easy enough to test, but it depends on what you mean by the "next run".
In the same session:
SQL > CREATE PACKAGE p AS
2 FUNCTION f1(p_v1 IN NUMBER) RETURN NUMBER;
3 END;
4 /
Package created.
SQL > CREATE PACKAGE BODY p AS
2 g_var VARCHAR2(10);
3
4 FUNCTION f2(p_v2 IN VARCHAR2) RETURN NUMBER IS
5 BEGIN
6 DBMS_OUTPUT.Put_Line('Value of g_var in f2 is: '||g_var);
7 RETURN 1;
8 END;
9
10 FUNCTION f1 (p_v1 IN NUMBER) RETURN NUMBER IS
11 l_res NUMBER;
12 BEGIN
13 DBMS_OUTPUT.Put_Line('Value of g_var at start f1 is: '||g_var);
14 SELECT dummy INTO g_var FROM dual;
15 l_res := f2(g_var);
16 g_var := 'A';
17 DBMS_OUTPUT.Put_Line('Value of g_var at end f1 is: '||g_var);
18 RETURN l_res;
19 END;
20 END;
21 /
Package body created.
SQL > var v number;
SQL > exec :v := p.f1(1);
Value of g_var at start f1 is:
Value of g_var in f2 is: X
Value of g_var at end f1 is: A
PL/SQL procedure successfully completed.
SQL > exec :v := p.f1(2);
Value of g_var at start f1 is: A
Value of g_var in f2 is: X
Value of g_var at end f1 is: A
PL/SQL procedure successfully completed.but after running it in one session, then doing the "next run" in a different session:
SQL > exec :v2 := p.f1(1);
Value of g_var at start f1 is:
Value of g_var in f2 is: X
Value of g_var at end f1 is: A
PL/SQL procedure successfully completed.John -
Error! Package Body Creating
hi, i am trying to setup DBMS_PROFILER package with sqlplus by typing :
"@E:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN\profload.sql"
after, i've typed, this results is displayed :
SQL> @E:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN\profload.sql
Package created
Grant succeeded
Synonym created
Library created
Warning: Package body created with compilation errors
Testing for correct installation
PACKAGE BODY sys.DBMS_PROFILER - missing or invalid
PL/SQL procedure successfully completed
So, as expected, when i trying to invoke start_profiler method, this errors would be appeared :
SQL> exec dbms_profiler.start_profiler('Hello');
begin dbms_profiler.start_profiler('Hello'); end;
ORA-04063: package body "SYS.DBMS_PROFILER" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_PROFILER"
ORA-06512: at line 2
SQL>
so, how can i fix this problem?
thanx for responsesim using oracle xe 10.0.2.0, and i've logined as SYSDBA.
i think that there is another problem. may be my profload.sql is broken. Is it possible?
SQL> @E:\oraclexe\app\oracle\product\10.2.0\server\RDBMS\ADMIN\profload.sql
Package created
Grant succeeded
Synonym created
Library created
Warning: Package body created with compilation errors
Testing for correct installation
PACKAGE BODY sys.DBMS_PROFILER - missing or invalid
PL/SQL procedure successfully completed
i couldnt find any solution yet. -
RMAN-06444 dbms_rcvman package body created with compliation errors
I am trying to install Recovery manager but I get the above error message "RMAN-06444 dbms_rcvman package body created with compliation errors" and "RMAN-06433 error installing recovery cataolog"
Can someone tell me what I did wrong?My Oracle version is 8i.
I started from scratch again and was able to create a catalog, create a user(RMAN) with sysdba privleges.
But when I try to connect to the target I get insufficient privleges.???
I tried these methods and still have insufficient privleges.
rman target / catalog rman/rman@rcat
rman target system/manager@jem03 catalog rman/rman@rcat
RMAN> connect target
What am I doing wrong?
Thanks for responding by the way.
James -
Hi Everybody,
I'm trying to create a package body but i keep getting an error message saying package created with complication. What i am i missing? Thanks in advance.
CREATE OR REPLACE PACKAGE BODY MY_PACK
IS
PROCEDURE MY_PROC(A NUMBER, B NUMBER)
IS
C NUMBER(4);
BEGIN
C:=A+B;
DBMS_OUTPUT.PUT_LINE('RESULT= '||C);
END;
FUNCTION NETSAL(TEMPNO EMP.EMPNO%TYPE) RETURN NUMBER
IS
TSAL EMP.SAL%TYPE;
TCOMM EMP.COMM%TYPE;
NETSAL NUMBER(10,2);
BEGIN
SELECT SAL,NVL(COMM,0) INTO TSAL,TCOMM FROM EMP WHERE EMPNO=TEMPNO;
NETSAL:=TSAL+TCOMM;
RETURN(NETSAL);
END;
END;
/980155 wrote:
Hi Everybody,
I'm trying to create a package body but i keep getting an error message saying package created with complication. What i am i missing? Thanks in advance.
CREATE OR REPLACE PACKAGE BODY MY_PACK
IS
PROCEDURE MY_PROC(A NUMBER, B NUMBER)
IS
C NUMBER(4);
BEGIN
C:=A+B;
DBMS_OUTPUT.PUT_LINE('RESULT= '||C);
END;
FUNCTION NETSAL(TEMPNO EMP.EMPNO%TYPE) RETURN NUMBER
IS
TSAL EMP.SAL%TYPE;
TCOMM EMP.COMM%TYPE;
NETSAL NUMBER(10,2);
BEGIN
SELECT SAL,NVL(COMM,0) INTO TSAL,TCOMM FROM EMP WHERE EMPNO=TEMPNO;
NETSAL:=TSAL+TCOMM;
RETURN(NETSAL);
END;
END;
/what does SHOW ERROR report?
How do I ask a question on the forums?
SQL and PL/SQL FAQ
since we don't have your table or data, we can't run posted code. -
3.1EA2 bug still not fixed - Members of package body not listed in the tree
Hi, I was working today with SQL Developer again and found that this bug is still not fixed even when it was reported more than 1 year ago!!!
I did a quick search and found it here
Package Body Tree not always showing
The problem is when you expand the package specification or package body tree, not all members of the specification/body are listed. This is mostly observable in the package body, but it regards to the specification as well.
Consider this case:
CREATE TABLE EMP (
ID NUMBER(6,0) DEFAULT 0,
NAME VARCHAR2(20 BYTE) DEFAULT NULL,
DEPT VARCHAR2(20 BYTE) DEFAULT NULL,
FUNCTION VARCHAR2(20 BYTE),
PROCEDURE VARCHAR2(20 BYTE));
CREATE TABLE LOOP (
AREA VARCHAR2(5),
VALUE VARCHAR2(2));
CREATE OR REPLACE PACKAGE Test_Package1 AS
gvc_const CONSTANT VARCHAR2(10) := 'xxx';
PROCEDURE Test(p_RC OUT NUMBER,
p_ID IN NUMBER);
END Test_Package1;
CREATE OR REPLACE PACKAGE BODY Test_Package1 AS
PROCEDURE Test(p_RC OUT NUMBER,
p_ID IN NUMBER)
IS
BEGIN
--INSERT INTO EMP (ID, NAME, DEPT, PROCEDURE) VALUES (1, 'Tina', 'xxx', 'xxx');
--INSERT INTO EMP (ID, NAME, DEPT, FUNCTION) VALUES (2, 'Jeff', 'xxx', 'xxx');
--INSERT INTO LOOP(AREA, VALUE) VALUES('a','b');
NULL;
END;
END Test_Package1;Compile the package specification and the body. Expand the spec + body in the tree. Uncomment any of the commented lines in the package body and compile the body again. Now expand the package body again and look what is displayed.
Why? It is because SQL Developer handles words "Function", "Procedure" and "Loop" as keywords and according to them does the parsing.
Another case
CREATE OR REPLACE PACKAGE Test_Package1 AS
gvc_const CONSTANT VARCHAR2(10) := 'xxx';
TYPE Loop_rec IS RECORD(
item1 LOOP.AREA%TYPE);
PROCEDURE Test(p_RC OUT NUMBER,
p_ID IN NUMBER);
END Test_Package1;Compile just this specification and try to expand it in the tree. Again, during parsing the package, SQL Developer takes the word "LOOP" into consideration and fails to parse the specification.
There is exactly the same problem when you declare functions from external dll libraries in package body. Since there is no "END;" in this case, SQL Developer's parser fails...
To me it seems you simply blindly took some keywords like "FUNCTION" and expect there will be some "END;" keyword corresponding with it.
Can anyone have a look at this and finally fix it?Hi,
Thanks for trying out SQL Developer 3.1 EA2 and providing a clear, reproducible test case for this issue. I logged an internal bug for it:
Bug 13438696 - 3.1EA2: FORUM: CERTAIN KEYWORDS IN PKG BODY BLOCK MEMBERS FROM CONN VIEW TREE
It seems the bug noted in the other forum thread you reference has been fixed, but really had nothing to do with problems discussed either here or there. That fix involved adding an Edit Body... item to the Package context menu in the Schema Browser, not displaying Package members correctly in the Connection view tree.
Regards,
Gary
SQL Developer Team -
Oracle: Problem creating package via CF
G'day
I've got a <cfquery> that creates a package header,
another that creates
the body, and then a <cfstoredproc> which calls one of
the procedures in
the package.
I am getting this error, when my code comes to execute the
procedure:
[Macromedia][Oracle JDBC Driver][Oracle]ORA-06550: line 1,
column 7:
PLS-00905: object myDB.myPkg is invalid ORA-06550: line 1,
column 7:
PL/SQL: Statement ignored
However if I go into Oracle SQL Developer, and examine the
package, it's
all present and accounted for, and indeed works fine.
If I manually recompile the package, I get no errors
(right-click > compile
on both the header and the body).
If having manually recompiled the package, I re-execute my
<cfstoredproc>
call, it works fine.
If I re-run the process, and the simply recompile the header
before trying
the <cfstoredproc>, I get this error:
[Macromedia][Oracle JDBC Driver][Oracle]ORA-04068: existing
state of
packages has been discarded ORA-04063: package body
"myDB.myPkg" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at
line 1
If I then recompile the body too, and then call my
<cfstoredproc>, it all
runs fine.
I have added the following two addition <cfquery> calls
after my first two:
<cfquery name="qTemp" datasource="#dsn#">
alter package pkg_tree compile package
</cfquery>
<cfquery name="qTemp" datasource="#dsn#">
alter package pkg_tree compile body
</cfquery>
And they execute fine, but do not affect the results (ie: I
still get the
same erroing behaviour).
If I copy and paste my <cfquery> code into Oracle SQL
Developer and execute
it, it all works fine.
Anyone encountered this before, and know what I'm doing wrong
(or what -
additionally - I need to do to complete the job)?
Cheers for any thoughts.
AdamPS: The user I am using to connect to the DB is the same one
whether via CF
or Oracle SQL Developer, in both cases, and said user has
full DBA
priveleges.
Adam -
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 -
Issue with viewing Package Body in SQL Developer 2.1 RC1
Were anybody able to see the package body of other user in 2.1 RC1.
I had an issue since 2.1 EA 1 so... just curious.
- Oracle 9i
- Windows XP SP3
Please do let me know if there is any hint or setting that can be change to view the package body.
Thanks!Thanks for your msg.
Below is the info:
1.
SQL: SELECT * FROM v$version;
Result:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
PL/SQL Release 9.2.0.8.0 - Production
"CORE 9.2.0.8.0 Production"
TNS for Solaris: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production
2.
Result:
The account has 'EXECUTE' privilege on the package.
3.
SQL: SELECT username "User"
,granted_role "Granted_Role"
,initcap(admin_option) "Admin_Option"
,initcap(default_role) "Default_Role"
FROM user_role_privs
ORDER BY username
,granted_role;
Result:
User``````````Granted_Role```````````Admin_Option``Default_Role
~~~~ ~~~~~~~~~ ~~~~~~~~~ ~~~~~~~~
USER_NAME```SELECT_CATALOG_ROLE``No````````````Yes
4.
SQL:
SELECT privilege "Privilege"
,initcap(admin_option) "Admin_Option"
FROM user_sys_privs
ORDER BY privilege;
Result:
Privilege````````````Admin_Option
~~~~~~ ~~~~~~~~~
ALTER SESSION`````No
CREATE SESSION````No
CREATE SYNONYM```No
Maybe you are looking for
-
My husband used my iCloud account before I had an iPhone. Now that I have one, I am still finding information from when my husband used the account. I try to backup my iCloud account and it says I do not have enough space, but I know I still 3.9GB le
-
LaserJet 1022 on Windows 8 64-bit driver problem
Hello! After I've upgraded my computer and installed Windows 8 my printer LaserJet 1022 won't work - the drivers fail to install. Operating system: Windows 8 64-bit Printer: HP LaserJet 1022 connected via USB I 'm trying to install latest drivers for
-
Running CS6 on Mac OS 10.9.5 - File Name Change - Flash
- When one of my students was working with Flash they some how managed to save their name to the program so that when you create a new file their name is part of the file name. I am unsure how to remove this as I don't see anything in the preferences
-
.
-
Itunes download not installed indicating apple application support was not loaded
A couple of days ago, an iTunes update came thru and the update failed. Support advised to uninstall iTunes and re-install it. I have uninstalled & installed iTunes several times now. Installer goes thru full process, says install is successful bu