How to implement SubType/SuperType in Oracle ?
Hi,
I have a supertype and three subtypes, as attached below, how is the
best approach to implement it in Oracle (9i/10g) ?
Thank you for your help,
Krist
Supertype : Employee
Employee_Number
Employee_Name
Address
Employee_Type
Date_Hired
SubType : Hourly_Employee
Hourly_Rate
SubType : Salaried_Employee
Annual_Salary
Stock_Options
SubType : CONSULTANT
Contract_Number
Billing_Rate
Assuming you want to model this relationally, try something like this.
http://groups-beta.google.com/group/comp.databases.oracle.server/msg/a23ffb19bfde2f20?hl=en
Note its a generic SQL approach, and somewhat over fussy but I think the genral approach holds up for this type of relationship.
I would sort of stay away from objects in the database, it over complicates everything else you will ever do.
Similar Messages
-
Anyone knows how to implement Decomposition Tree in Oracle BI products? to
Hello Everybody
Recently I'm trying to use Oracle BIEE plus to upgrade our old report service in our product. I'm a newbee to OracleBI products but I have a question that oracle support guys in our region also could figure out a clear answer. If anybody here can give me some clues it would be appreciated.
I once used ProClarity BI product before, and ProClarity report service can provide a very powerful visualization tool like Decomposition Tree. I'm quite interested this function. But I searched many Oracle BIEE plus and ESSBASE documents, it seems Oracle BI can' implements the functional for which Proclrity Decomposition Tree can provided?
Is there any body knows any other solution to implement Decomposition Tree in Oracle BI product?
ThanksAppreciated the quick response:)
Yes. I don't find the directory object .. I'm not very familiar with biee so far so might be me slight this object in my investigation.
I need to check this object and see how it works.
And thanks for your advise. -
How to implement invoker rights in oracle 9i
implement invoker rights in oracle 9i
Invoker rights is a new model for resolving references to database elements in a PL/SQL program unit. From Oracle 8i onwards, we can decide if a program unit should run with the authority of the definer or of the invoker. This means that multiple schemas, accessing only those elements belonging to the invoker, can share the same piece of code.
To enable code to run with Invoker rights, an AUTHID clause needs to be used before the IS or AS keyword in the routine header. The AUTHID clause tells Oracle whether the routine is to be run with the invoker rights (CURRENT_USER), or with the Owner rights (DEFINER). If you do not specify this clause, Oracle by default assumes it to be AUTHID DEFINER.
create or replace procedure update_par(pi_parcod in varchar2,
pi_val in varchar2,
pio_status in out varchar2)
authid current_user is
begin
pio_status = 'OK';
update appparmst
set parval = pi_val
where parcod = pi_parcod
and rownum = 1;
if sql%notfound then
pio_status = 'Error in resetting the parameter';
end if;
end; Restriction in using Invoker rights
1. When compiling a new routine, direct privileges are only considered to resolve any external references. Grants through roles are ignored. The same applies when executing a routine created with invoker rights.
2. AUTHID is specified in the header of a program unit. The same cannot be specified for individual programs or methods within a package or object type.
3. Definer rights will always be used to resolve any external references when compiling a new routine.
4. Maintain extra caution on privileges being assigned to a different user. If the wrong privileges are assigned, a routine with invoker rights may have a mind of its own! Such issues would be difficult to debug. So ensure that the grants are perfectly in place.
5. For an invoker rights routine referred in a view or a database trigger, the owner of these objects is always considered as the invoker, and not the user triggering it.
~ Madrid. -
How to Implement User Area in Oracle Forms 6i
Hi,
Could anyone please let me know how to implement Item Type *"User Area"* ?
How to add User Area in layout Editor?,
Thanks and Regards,
ManasaHi,
Please post your question in the appropriate forum.
Forms
Forms
Thanks,
Hussein -
How to implement C2 Audit in Oracle 10g Express Edition?
Hi,
I am developing a database using 10g Express Edition in which I need to implement c2 audit. I am planning to use triggers for this. Does anyone have a better method to implement audit in Express Edition?
Thanks.I don't know what C2 audit exactly is, but before programming anything read this Security Guide chapters on Database Auditing http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/auditing.htm#i1011984 and http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm#i1014788.
All this should be available in XE also, except for Fine Grained Auditing, which is in Enterprise Edition only.
If you are only interested in knowing when, who, did what command, including failed attempts than you don't have to program anything - you just define what activities you want to audit and set AUDIT_TRAIL initialization parameter to start auditing.
You only need to write triggers if you need to catch column values before/after the change. -
How to implement "Filtered Indexes" in Oracle?
I know that function-based index can (kind-of) create index for only a portion of all the rows in a table,
create index idx_abc_01 on t_abc (case when end_dt > '01-APR-2008' then end_dt else null end);
/* to use the index, you have to use the same express in the filter clause */
select * from t_abc where xyz in ('O', 'S', 'X') and
case when end_dt > '01-APR-2008' then end_dt else null end
between '12-JUL-2008' and '15-JUL-2008';But this approach is very inflexible because the expression in the where clause has to exactly match the index creation, otherwise that filtered index will not be used.
MS SQL Server 2008 has a new feature called - Filtered Indexes
CREATE NONCLUSTERED INDEX fidx_abc_01
ON t_abc ( EndDate )
WHERE EndDate > '20040401';
select * from t_abc where EndDate between '20050121' and '20050130';[url http://msdn.microsoft.com/en-us/library/cc280372.aspx]Filtered Indexes can be very helpful in both OLTP and DW. I'm wondering how to get the same thing done in Oracle.
Any suggestion beyond [url http://erturkdiriksoy.wordpress.com/2008/06/30/filtered-indexes-on-oracle/]Dunyada?In 11.2, if you're building a data warehouse (and assuming that implies you have the partitioning option), you can declare that certain partitions of a local index are unusable which prevents Oracle from building them. If T_ABC were partitioned on END_DT, that would allow arbitrary queries where Oracle could perform partition pruning to make use of the index if it was available for those partitions without the need for an exact expression match.
Beyond that, if you are creating a function-based index, you would often want to create (or modify) the view that your application queries to specify the condition (i.e. a VW_RECENT_ABC that only has post-April, 2008 data) so that queries didn't have to specify the condition exactly.
Justin -
How to implement Dual Authentication in Oracle Apex
Currently I am learning an oracle Apex tools. I am pretty confuse and not able to find any help for authentication scheme offered from oracle Apex. Like I would like to implement dual authentication scheme i.e. I want to implement Database Authentication and LDAP authentication. If user is fail in authenticate in Database Credential then I would like to check him in LDAP Credential. If user is present in LDAP credential then User is able to login. But if user is not present in any of them then again Login page should get displayed.
Edited by: user2074688 on Jun 24, 2010 3:27 PMDual Authentication doesn't exist as predefined Authentication Scheme, you need to program that yourself.
So what you need to do is create a custom Authentication Scheme where you at first check user credentials against Database and then against LDAP.
Have fun,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
Work: http://www.click-click.at -
How can implement running total in oracle forms
I want to implement a running total in oracle form
like
100 100
300 400
200 600
500 1100
200 1300
100 1400
PROCEDURE calculate_srno IS
current_rownum integer:=:System.Cursor_Record;
starting_srno integer:=:rs_1;
last_rownum integer;
BEGIN
last_record;
last_rownum:=:system.cursor_record;
go_record(1);
FOR counter IN 1..last_rownum LOOP
:sum_1:=:rs_1;
:rs_1:=:sum_1+:rs_1;
-- :offered_srno_to:=starting_srno;
if last_rownum=:System.Cursor_Record then exit;
end if;
END LOOP;
END;
it is not working after want to insert between in the tableWhy write code for this? Oracle Forms 10g has Calculated/Summary fields that will do this for you without the need of writing any PL/SQL.
Simply add a non-table item to the data block with the item you want to keep the running total for. Then change the following properties of the item:
Data Type: Number
Calculation Mode: Summary
Summary Function: Sum
Summarized Block: <Your Data Block>
Summarized Item: <Your Block Item>
Number of Items Displayed: 1 (if your item is in a Multi-Record (Tabular) layout else you don't need to change this property.
You will also need to change the following property of the block: Query All Records: Yes
If changing the Block's "Query All Records" property causes your form to be too slow because of the number of records in your block, then you could keep a running total manually by using a combination of the Post-Query and When-Validate-Item (WVI) triggers. If your block does not allow data entry, then you could do this with just the Post-Query trigger. For example:
BEGIN
/* This code sample assumes you have added a non-table item */
/* to your block called SUMMARY. */
:YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
END;If your block allows data entry, then you would add the following to your existing WVI trigger.
BEGIN
/* Perform your data entry validation logic first... */
IF ....
ELSE
...Validation is successful...
:YOUR_BLOCK.SUMMARY := :YOUR_BLOCK.SUMMARY + NVL(:RS_1,0);
END IF;
END;Hope this helps.
Craig... -
How to implement hasing algorithm in oracle
implement hasing algorithm in oracle
Assuming you're using the enterprise edition of the database and that you've licensed the partitioning option, you specify the number of hash partitions you want when you create the table. The SQL Reference for the CREATE TABLE statement has the following example
CREATE TABLE hash_products
( product_id NUMBER(6)
, product_name VARCHAR2(50)
, product_description VARCHAR2(2000)
, category_id NUMBER(2)
, weight_class NUMBER(1)
, warranty_period INTERVAL YEAR TO MONTH
, supplier_id NUMBER(6)
, product_status VARCHAR2(20)
, list_price NUMBER(8,2)
, min_price NUMBER(8,2)
, catalog_url VARCHAR2(50)
, CONSTRAINT product_status_lov_demo
CHECK (product_status in ('orderable'
,'planned'
,'under development'
,'obsolete')
PARTITION BY HASH (product_id)
PARTITIONS 5
STORE IN (tbs_01, tbs_02, tbs_03, tbs_04); You'd just specify 4 or 8 partitions, your partition key, etc.
It doesn't make sense, however, to try to join two hash-partitioned tables on the hash key value. What is it, exactly, that you're trying to accomplish.
Justin -
How to implement parallel processing in oracle.
Hi Gurus,
In one our procedures we are calling 7 procedures internally. We want to execute them parallely insted of sequentially.
Please help me to resolve this issue.
thanks in advance...Hi,
You have dbms_job package in Oracle 9i and dbms_scheduler from Oracle 10g.
Though you can run all these procedures parallel submitting via dbms_job, any exception/error out in any of these procedures need to be handled explicitly. Just be aware that once you submit these jobs, your application loses control of the execution and you have to build a whole infrastructure for rerun in case of an exception(log/exception tables, monitoring application to periodically check the exception tables, alerts from procedures in case of an exception and so on ...)
It's going to become more complex if you have any dependencies between these procedures. -
How to implement simple replication with Oracle 8.0.5 ?
Hello,
I want to replicate some tables of my database's tables with simple replication :
I use local naming configuration.
Both databases have the same default ID ORCL.
But every time I create a database link and I want to test it, I receive the message : "The link is not active!".
So, if some DBA could help me, I will be very grateful.
Thank you.Hi,
In our project we are using this type. Since in this project server in UNIX(DEC) and client is running on windows. We have created a listener which always listen requests from client and doing the according to the request.
Step1. create a request table, where u are inserting ur request.
step2. create PRO*C proram, which is listening request on the table. If there is any request, call the imp (executable). This is happening on server side.
Benifit. U can make a request from cleint and ftp the file client sit.
Are u interested in more details and code, pls send a mail to me
---- Boby Jose Thekkanath
[email protected]
Dharma Computers(p) Ltd. Bangalore.
null -
How to implement Custom Authentication and Authorization in Oracle SOA 11g
Can anyone please tell me, how to implement Custom Authentication in Oracle SOA 11g ?
Because in Oracle SOA 10.1.3.4 , i have implemented this custom authentication and authorization by implementing BPMAuthenticationService, BPMAuthorizationService, BPMIdentityService to verify againt my database systems.
implementation classes like the mentioned below
1).
public class SampleAuthenticationService extends SampleServiceBase implements BPMAuthenticationService {
2).
public class SampleAuthorizationService extends SampleServiceBase implements BPMAuthorizationService {
3).
public class SampleIdentityService extends SampleServiceBase implements BPMIdentityService {
Please help me to implement the authentication and authorization in Oracle SOA 11g .
thanks in advanceTo start with please go through following document
http://docs.oracle.com/cd/E21764_01/integration.1111/e10231/adptr_jms.htm
http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/adptr_file.htm
Regards
Arpit -
Implementing Event listeners in Oracle ADF
I have a selectonechoice UI component by which the user selects the user name and an UI table component which displays all the documents the user has access to. There are three tables involved 1) User 2) Access 3) Documents. USER table has a FK relation to ACCESS table. The ACCESS table has FK relation to DOCUMENTS table.
I have written two SQL queries/view objects (userView) to get the user name and another join query (userAccessView) to get the document names that a particular user has access to.
I want to link the two UI components such that when the selectonechoice UI component changes value, the table UI component should display document list has the user has access to.
Is there any sample example of how to implement the functionality using Oracle ADF? Or any suggestion on how to do it.
Regards
ThomasYou should be able to achieve this with PPR - for example see this demo of the navigation list:
http://blogs.oracle.com/shay/2008/11/the_navigation_list_select_som.html -
How to implement this in Oracle Apps 11i
Hello Friends
I am working as a consultant for a manufacturing company.
They have a format for charging Excise and Sales tax on their products (example below). I dont know how to implement this using oracle apps. Please help me ASAP.
eg.
Product A:
MRP = Rs. 100
Assessable Value (i.e. the value at which I have contract with the Government to pay Excise Duty) = 60% of MRP = Rs. 60 in this case.
Excise Duty = 16% of AV =0.16*60 = Rs. 9.6
Now, lets suppose I am selling my product to a dealer at 30% discount.
Therefore, Sale Price = 70% of MRP = Rs. 70
Sales Tax = 4% of Sale Price = 0.04*70 = 2.8
Therefore, total revenue from the deal = 70-9.6-2.8 = Rs. 57.6you can use Advance Pricing or creating discount or attiribute while calculating.
this is not much complex, possible even with Advance Pricing too. Thanks
Shiv -
How to implement the spell check in oracle forms 10g or 6i...
How to implement the spell check in oracle forms.
Is there any different method is there.
Please help me....
Praveen.KHere is one different from Jspell..
In 6i client/server you can call MS Word spell checker using OLE. Below sample code for 6i.
For 10g you will need webutil to use same code. install webutil and just replace "OLE2." with "CLIENT_OLE2."
PROCEDURE spell_check (item_name IN VARCHAR2)
IS
my_application ole2.obj_type;
my_documents ole2.obj_type;
my_document ole2.obj_type;
my_selection ole2.obj_type;
get_spell ole2.obj_type;
my_spell ole2.obj_type;
args ole2.list_type;
spell_checked VARCHAR2 (4000);
orig_text VARCHAR2 (4000);
BEGIN
orig_text := NAME_IN (item_name);
my_application := ole2.create_obj ('WORD.APPLICATION');
ole2.set_property (my_application, 'VISIBLE', FALSE);
my_documents := ole2.get_obj_property (my_application, 'DOCUMENTS');
my_document := ole2.invoke_obj (my_documents, 'ADD');
my_selection := ole2.get_obj_property (my_application, 'SELECTION');
ole2.set_property (my_selection, 'TEXT', orig_text);
get_spell :=ole2.get_obj_property (my_application, 'ACTIVEDOCUMENT');
ole2.invoke (get_spell, 'CHECKSPELLING');
ole2.invoke (my_selection, 'WholeStory');
ole2.invoke (my_selection, 'Copy');
spell_checked := ole2.get_char_property (my_selection, 'TEXT');
spell_checked :=SUBSTR (REPLACE (spell_checked, CHR (13), CHR (10)),1,LENGTH (spell_checked));
COPY (spell_checked, item_name);
args := ole2.create_arglist;
ole2.add_arg (args, 0);
ole2.invoke (my_document, 'CLOSE', args);
ole2.destroy_arglist (args);
ole2.RELEASE_OBJ (my_selection);
ole2.RELEASE_OBJ (get_spell);
ole2.RELEASE_OBJ (my_document);
ole2.RELEASE_OBJ (my_documents);
ole2.invoke (my_application, 'QUIT');
ole2.RELEASE_OBJ (my_application);
END;Call it like this: SPELL_CHECK ('BLOCK.MY_TEXT_ITEM' );
Maybe you are looking for
-
Hello friends I just wanted to know whether there is any delta queue maintained in the BI source system apart from the R/3 system? If yes how does it function? Secondly, what is the max no of char in the Key fields in DSO(BI 7.0) that we can have? re
-
How tonswap new email address for old one in apple ID. When I try to make my new gmail address my apple ID it won't accept it because it's already in use as my rescue email. I'd like my other email to be rescue email and gmail to be apple ID but th
-
Problem with IDN (internationalized domain name)
i want load images from a domain which contain non-latin character (ex: www.bücher.com) but Flash only display a secury message. how to resolve this issue , please help me .Thanks. I use as3.
-
Does anybody know how to bring the last initiated process instance to be seen first in the worklist views in OBPM 10GR3? By default, the last initiated worklist item is posted at the end and one has to scroll down all the way to the last initiated it
-
IPhoto will not open completely, just loading
iPhoto is just loading, it does not open fully... I have tried repairing the library and also tried opening it in safe mode but it still doesnt work. How can I fix this?