Code from package body
how can we view the code from package body
Edited by: 872959 on Oct 3, 2011 9:06 AM
Hi,
You can use dbms_metadata
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_metada.htm#i1015856
of query the data dictionary views user_source or all_source.
SELECT text
FROM all_source
WHERE owner = 'SCHEMA_NAME'
AND name = 'PACKAGE_NAME'
AND type = 'PACKAGE BODY'
ORDER BY line
;Remember, anything inside quotes is case-sensitive.
Similar Messages
-
Redemption Code from package not valid?
I just purchased Adobe Acrobat XI Standard 30 minutes ago and am trying to enter the redemption code on the adobe website. I enter it and the site states that it is not valid. What do I do now?
You need to contact Adobe Support either by chat or via phone when you have serial number and activation issues.
Here are some links to help make contact:
http://www.adobe.com/support/chat/ivrchat.html
http://www.adobe.com/support/download-install/supportinfo/
If your id name has anything to do with the code you are talking about you should change it immediately. Anyone could take it and make it theirs. -
Package Body from SQL Developer ?
Team I am using SQL Developer Version 2.1.1.64 But I can not able to see the package body.
Right click on the package provides an option to 'Save Package Spec and Body', but when I save it .. it only store the package spec ..
Is it not possible to view the package body from SQL Developer ?
Can anyone confirm ... how to get code of package body ... ?Hi Bipul,
Although there might be people here using that specific tool, there is still the dedicated SQL Developer forum to ask in:
SQL Developer
Regards
Peter -
Hi
I have upgraded my Oracle 11g 11.2.0.4 from standard to enterprise version.
When I try to use the sqladvisor I recevie the error:
There was a problem creating a SQL tuning task.
ORA-04063: package body "SYS.DBMS_SQLTUNE_INTERNAL" has errors
ORA-06508: PL/SQL: could not find program unit being called: "SYS.DBMS_SQLTUNE_INTERNAL"
ORA-06512: at "SYS.PRVT_SQLADV_INFRA", line 245 ORA-01403: no data found
ORA-06512: at "SYS.DBMS_SQLTUNE", line 684 ORA-06512: at line 1
Looking the status of the packages, the package appears like invalid, When i try to recompile it fails with error:
Body
3233
25
PL/SQL:
ORA-00904: "P"."MASKED_BINDS_FLAG": invalid identifier
Anybody know how can i recompile it ?
I have look for the error in metakink but i can't find nothing
thanksPl detail how you upgraded to EE version
https://docs.oracle.com/cd/E11882_01/server.112/e23633/intro.htm#UPGRD12355 -
NetBeans: Calling code from other packages?
Normally, when I would call code from eclipse, I would type something like:
import +<package name>.<class name>+But somehow, this approach doesn't seem to work in NetBeans, how can I import code from another package? I can seem to import from the same package, but not a different one.
Edited by: px7659 on Jun 15, 2010 6:21 PMpx7659 wrote:
Normally, when I would call code from eclipse, I would type something like:
import +<package name>.<class name>+But somehow, this approach doesn't seem to work in NetBeans, how can I import code from another package? I can seem to import from the same package, but not a different one.Then the package is not part of the project. Did you perhaps forget to add the jar library in question? -
3.0EA4: NPE when open package body from file.
What I did:
1. start sqldeveloper
2. goto Files tab
3. dblclick a package body file (a_pkg.pkb) in recent file list.
4. dblclick another package spec file (a_pkg.pks) in recent file list.
5. error !
Here is the stack trace.
java.lang.NullPointerException
at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1420)
at oracle.ideimpl.editor.EditorManagerImpl.createEditor(EditorManagerImpl.java:1337)
at oracle.ideimpl.editor.EditorManagerImpl.openEditor(EditorManagerImpl.java:1263)
at oracle.ideimpl.navigator.OpenEditorController.whenOpenEditor(OpenEditorController.java:41)
at oracle.ideimpl.navigator.OpenEditorContextMenuListener.handleDefaultAction(OpenEditorContextMenuListener.java:51)
at oracle.ide.controller.ContextMenuListenersHook$LazyContextMenuListener.handleDefaultAction(ContextMenuListenersHook.java:200)
at oracle.ide.controller.ContextMenu.fireDefaultAction(ContextMenu.java:434)
at oracle.ideimpl.explorer.BaseTreeExplorer.fireDefaultAction(BaseTreeExplorer.java:1835)
at oracle.ideimpl.explorer.BaseTreeExplorer.dblClicked(BaseTreeExplorer.java:2176)
at oracle.ideimpl.explorer.BaseTreeExplorer.mouseReleased(BaseTreeExplorer.java:2205)
at oracle.ideimpl.explorer.CustomTree.processMouseEvent(CustomTree.java:211)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2059)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2118)
at java.awt.Component.dispatchEvent(Component.java:4244)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2441)
at java.awt.Component.dispatchEvent(Component.java:4244)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)I have several schemas but let us just look at the 2 .
I have open connections to both of the 2 schemas.
I do some work in the A schema and then returns
to the B-Schema, but forget to change the connection in the connection drop down list.
So now my connection points at the A-schema.
I open a package body file (from the file system !!!! not from the database)
do some corrections in the package body and then compiles the package body (belonging to the B-schema)
erroneously in the A-schema. I do not do this on purpose, but because i forgot to change the connection
and the connection in the "drop-down connection list" still points to the A-schema and I'm not prompted for
a password as the connection is open.)
The compiler compiles my package body in the A-schema with an error and tells me "package spec"
does not exist which is true - the package spec exists in the B-schema and not in the A-schema.
Therefore I choose the B-schema connection in the connection drop-down list in order to compile
the package body in the right schema (the B-schema).
Now I receive a message "your priviliges are insufficient" - which they are not.
The only way I can get back into business is to close down sqldeveloper re-open it and now
compile the package body in the right schema.
Sqldeveloper compiles the pck-body in the A-schema as it was told to do, it is not a random schema
I have to remove the pck-body afterwards !!
The annoying thing about this is I have to close down sqldeveloper in order to be able to compile my package.
I do not have explicit schema object reference in my declaration
regards -
When I give the redeem code from the package I bought today from over an hour away, this is what i get and no forun seems to deal with it nor do I have days to chase adobe down. Oops! This code doesn't seem to be active. Please contact the retailer you purchased the card from, or use a different code. For more information contact Customer Support and order by phone
See if this helps:
https://helpx.adobe.com/x-productkb/global/find-serial-number.html -
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 -
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. -
&& 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,
AM953104 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. -
How to put connect in the package body
Oracle 10.2 on Windows 2003
I have package body as follows: in the code, I want to connect to different user. what's the correct syntax?
create or replace package body xxx as
procedure abc1 is
begin
connect username/password@sid name.
select * from table
end;
Thanks
SActuall, my problem is solved. Thank you very much.please close the thread as answered. so that users of OTN can look into some other threads.
-
How to find proc/func name from package name and line number?
Hi,
We are using the pl/sql call stack dump (dbms_utility.format_call_stack) for some debugging purposes. But in the case of a package body execution, the dump does not return the name of the procedure/function that is being executed, but only the name of the package and the line number being executed. So, we have a requirement wherein we need to extract the type and name of a package subunit from the package name and line number.
e.g.
From the information package 'A', line number 739
we should be able to deduce that line 739 is a part of *'function A.f'*
Does the oracle database provide any native mechanism (PL/SQL packages or otherwise) to support such functionality? If it does not, how can we achieve the desired result?
Thanks in advance,
ShashankThe approach we are currently planning to take up is this :
1. Write PL/SQL code to parse the entire source (user_source) and build a database table with a structure like this :
PACKAGE_NAME | UNIT_TYPE | UNIT_NAME | START_LINE | END_LINE
=============================================
A | PROCEDURE | P1 | 20 | 345
A | FUNCTION | F1 | 347 | 629
etc..
2. Start PL/SQL package execution.
3. Keep dumping call stack snapshots whenever a custom debug procedure is called.
4. Dump the package name and line number to a log file.
5. Using the package name and line number, query the table built in step 1 and build the final report which shows the control flow in a readable form.
What we want is to get rid of step 5 and by some means get the logic to extract the unit type and name in step 4 itself.
Keep them coming..
Thanks and regards,
Shashank -
Search Package Body for Keywords
I would like to know if anyone has a query to search a package body for a particular word and then return all of the procedure names where that word (or words) are found. I am in the beginning stages of a 3-5 year upgrade/re-write project and just when I think that I have been given all of the requirements "they" come up with something else. Go figure! For instance I might need to find all of the procedures for a package or packages that contain the word product. Manually searching through all of my packages is very time consuming and I'm sure that someone out there has already written a query to do this.
Any help will be greatly appreciated!
Thanks!
Randy>
I would like to know if anyone has a query to search a package body for a particular word and then return all of the procedure names where that word (or words) are found. I am in the beginning stages of a 3-5 year upgrade/re-write project and just when I think that I have been given all of the requirements "they" come up with something else. Go figure! For instance I might need to find all of the procedures for a package or packages that contain the word product. Manually searching through all of my packages is very time consuming and I'm sure that someone out there has already written a query to do this.
>
A query? No
Would you settle for Oracle supplied functionality that can probably provide all of that cross-reference information for you?
As you can tell from all of the other replies it seems many, if not most, people are not familiar with PL/Scope, which was introduced in version 11.1 (you should always provide your 4 digit Oracle version).
>
PL/Scope is a compiler-driven tool that collects data about identifiers in PL/SQL source code at program-unit compilation time and makes it available in static data dictionary views. The collected data includes information about identifier types, usages (declaration, definition, reference, call, assigment) and the location of each usage in the source code.
PL/Scope enables the development of powerful and effective PL/Scope source code browsers that increase PL/SQL developer productivity by minimizing time spent browsing and understanding source code.
PL/Scope is intended for application developers, and will usually be used in the environment of a development database.
>
See Chapter 8 Using PL/Scope in the Advanced Appication Developer's Guide
http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_plscope.htm
>
Specifying Identifier Collection
By default, PL/Scope does not collect data for identifiers in the PL/SQL source program. To have PL/Scope collect data for all identifiers in the PL/SQL source program, including identifiers in package bodies, set the PL/SQL compilation parameter PLSCOPE_SETTINGS to 'IDENTIFIERS:ALL'.
>
Without knowing your actual needs or requirements I can't speculate on whether this will give you everything you are looking for.
But don't reinvent the wheel without checking this out first.
Basically just set the compilation parameter and recompile all of the code. Then there will be static dictionary views available with the cross-reference data.
Even if you are not currently using 11g if I were you I would create an 11g sandbox with all of the objects and code (no data needed) just so you could use PL/Scope to get this cross-reference information. -
SYSDBA - problem with viewing other users package body texts on sys account
Hi,
SQL Dev 1.0.0.15.27 has problem with correct display of other users package body texts on sys account. All bodies have "create or replace" text instead of all pck. bodies text.
I guest it's problem with SYSDBA role. On system account text is displayed correctly. Quest SQL Navigator 5.x has no problem with this. Any ideas ?
Regards,
MMHi Everyone,
Just so I can close the case on this issue, although I was successful in
using CSS to resolve the issue, actually, the issue was not really
resolved. There was (for me) still the problem of rollover images not
working in IE, and if I were ever to get another good night's sleep, I
would need to resolve it -- so I did. Recall me saying earlier about the
sizes being brought in to the javascript code by Dreamweaver? The original
issue with having the size of the small image in the code caused the code
to see the larger image as small also! However, when I deleted those size
attributes' numbers, I failed to delete the words "width" and "height"
along with the double quotes following each. So, while the other browsers
ignored these "blank" attributes within these double quotes, IE apparently
didn't, reading these "blank" values as some very small value, thus
displaying the image in the absolutely smallest size possible! Wow! When I
removed these two blank attributes, my problem went away! Live and learn!
So, to all who were desperately trying to assist me, please accept my
deepest and most sincere apologies. All the while I was blaming IE, I was
the guilty one!!! Shame on me, and thanks for the wonderful responses I
received from the Dreamweaver forum team. I will go and stand in the corner
for 8 hours with my dunce cap on...
Joe Dardard -
Help required in compilation of package body.....
Hi ..
While taking the export i encounter the error message..
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
EXP-00056: ORACLE error 6550 encountered
ORA-06550: line 1, column 26:
PLS-00201: identifier 'XDB.DBMS_XDBUTIL_INT' must be declared
ORA-06550: line 1, column 14:
PL/SQL: Statement ignored
EXP-00056: ORACLE error 6550 encountered
ORA-06550: line 1, column 26:
PLS-00201: identifier 'XDB.DBMS_XDBUTIL_INT' must be declared
ORA-06550: line 1, column 14:
PL/SQL: Statement ignored
EXP-00000: Export terminated unsuccessfully..
SELECT status,object_id,object_type,owner,object_name
FROM dba_objects
WHERE object_name = 'DBMS_XDBUTIL_INT';
gives the output as...
status object type owner object_name
valid synonym public DBMS_XDBUTIL_INT
valid package xdb DBMS_XDBUTIL_INT
invalid package body xdb DBMS_XDBUTIL_INT
when i try to compile the invalid object...
SQL> alter package XDB.DBMS_XDBUTIL_INT COMPILE BODY;
Warning: Package Body altered with compilation errors.
SQL> sho err
Errors for PACKAGE BODY XDB.DBMS_XDBUTIL_INT:
LINE/COL ERROR
61/7 PL/SQL: Statement ignored
61/17 PLS-00306: wrong number or types of arguments in call to
'IS_HIERARCHY_ENABLED_INTERNAL'
74/7 PL/SQL: Statement ignored
74/29 PLS-00302: component 'GENERATE_TRGNM' must be declared
108/9 PL/SQL: Statement ignored
108/37 PLS-00302: component 'TRUNCATE_NAME' must be declared
123/7 PLS-00201: identifier 'SYS.DBMS_SYS_SQL' must be declared
123/7 PL/SQL: Statement ignored
135/9 PL/SQL: Statement ignored
LINE/COL ERROR
135/37 PLS-00302: component 'TRUNCATE_NAME' must be declared
153/9 PL/SQL: Statement ignored
153/33 PLS-00302: component 'TRUNCATE_NAME' must be declared
168/7 PLS-00201: identifier 'SYS.DBMS_SYS_SQL' must be declared
168/7 PL/SQL: Statement ignored
181/9 PL/SQL: Statement ignored
181/33 PLS-00302: component 'TRUNCATE_NAME' must be declared
Since the code is wrapped .. i cant do anything.. needs ur help.
sorry for explaining in such a detail...
Message was edited by:
437022Hi,
In side the Package Body,
a) invalid arguments for IS_HIERARCHY_ENABLED_INTERNAL
b) invalid components GENERATE_TRGNM, etc.
First, you need to correct the above errors and then
try to compile the Package Body
Regards,
Sailaja
Maybe you are looking for
-
Dear gurus, i have maintained inspection type 13 for repetative mfg, 1) wht setting should be done in rate routing for inspection point? 2) when the inspection lot generated automatically. pleased help me out Regards Pravin
-
How to limit the number of movie clips on stage?
I am making a game where tempEnemy in an array of enemies gets made on random. Every time the player advances a level, more insects appear. This is how I want it to be, but when the user is high on a level, too many enemies get made that are impossib
-
hiee I am in the process of creating a GUI for an Application similar to the PaintBrush. On clicking the 'New' option of the menubar a JInternal frame opens.now ,i want to add on to it a canvas. how do i do that. i have written a code for it but the
-
I upgraded the software on my iphone 4 and now it's downloading every email message from all my accounts (all previously read). 200 at a time. Manual delete is a problem since there are 3500. Suggestions?
-
Oracle Business Intelligence Essbase Cube Builder
hi does any one prior exp on Oracle Business Intelligence Essbase Cube Builder or can any one tell me whats the use of it and how does it work with essbase ?