Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 4th, 2006, 06:30 PM
o0MattE0o's Avatar
o0MattE0o o0MattE0o is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Location: West London
Posts: 258 o0MattE0o User rank is Corporal (100 - 500 Reputation Level)o0MattE0o User rank is Corporal (100 - 500 Reputation Level)o0MattE0o User rank is Corporal (100 - 500 Reputation Level)o0MattE0o User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 5 m 20 sec
Reputation Power: 5
Send a message via MSN to o0MattE0o
Filling tables from other tables?

ok not shore how to describe this but what I trying to do is this when I create a Person they will automaticly get a National Identification Card but how will I be able to do this?

This is the UK Citizen Table Insert code:-
Code:
INSERT INTO UKCITIZEN VALUES("citizenid", "convictionid", "contactid", "nationalidentificationregister", "addressid", "bioid", name, surname, dateofbirth, placeofbirth, nationalinsurancenumber, ethnicity, workstatus);


But when this gets created it will also need to fill out this part of the codeing automaticly: -
Code:
INSERT INTO NIC VALUES(nationalidentificationregister, citizenid, auditid, dateissued, dateexpires);


dateissued will be sysdate
dateexpires will be sysdate + 157784630 (5 Year)

*Current SQL Tables, Objects, Inserts are in the Attached file, if you wish to see the table layout
Attached Files
File Type: txt UK National Identification Card Database.txt (7.9 KB, 175 views)

Reply With Quote
  #2  
Old January 5th, 2006, 05:04 AM
shammat shammat is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 1,045 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 8 h 9 m 14 sec
Reputation Power: 68
Not sure, what you want to achieve, but it sounds like a problem that can be solved by creating an insert trigger on the table UKCITIZEN.

Two additional things:

1) you should always specifiy the column list in the INSERT statement (INSERT INTO table (col1, col2, ..) VALUS (...)) in order to avoid problems when the table or the column order changes at a later stage

2) in Oracle never use double quotes for column names, that will save you a lot of problems (because then Oracle - as most other DBMS - will be case sensitiv in regards to the column names)

Reply With Quote
  #3  
Old January 5th, 2006, 12:12 PM
o0MattE0o's Avatar
o0MattE0o o0MattE0o is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Location: West London
Posts: 258 o0MattE0o User rank is Corporal (100 - 500 Reputation Level)o0MattE0o User rank is Corporal (100 - 500 Reputation Level)o0MattE0o User rank is Corporal (100 - 500 Reputation Level)o0MattE0o User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 2 Days 5 m 20 sec
Reputation Power: 5
Send a message via MSN to o0MattE0o
Are there any examples of triggers you chould point out please?

1)Like this? : -
INSERT INTO UKCITIZEN (citizenid, convictionid, contactid, ...) VALUS("001", null, "008", ...);

2)the double quotes are not in the name there just put there so I know its a char/varchar2 that gose in there.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Filling tables from other tables?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT