Home » SQL & PL/SQL » SQL & PL/SQL » 2 employes in the register table, it is possible?
2 employes in the register table, it is possible? [message #361915] Fri, 28 November 2008 09:49 Go to next message
lopes_andre
Messages: 14
Registered: October 2008
Junior Member
Hi,

I have one table that must to contain 2 employes in the same register.

The situation is this:

In the register I have onde doctor and one patient, and the identification of both is made by "id_worker".

It is possible that in the same register to reffer the doctor and the paatient?

Best Regards,
André.
Re: 2 employes in the register table, it is possible? [message #361916 is a reply to message #361915] Fri, 28 November 2008 09:52 Go to previous messageGo to next message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
How should we know? We have no idea as to the design and structure of your database / schema / application.
Re: 2 employes in the register table, it is possible? [message #361918 is a reply to message #361915] Fri, 28 November 2008 09:54 Go to previous messageGo to next message
lopes_andre
Messages: 14
Registered: October 2008
Junior Member
Hi,

Sorry.

The doctor and the patient use the same table.

TABLE_WORKERS and the PK is ID_WORKER


Best Regards
Re: 2 employes in the register table, it is possible? [message #361920 is a reply to message #361918] Fri, 28 November 2008 10:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Same answer: we haven't your model.

What is a "register"?

Post your table(s) definition.

Also post your Oracle version (4 decimals).

Regards
Michel
Re: 2 employes in the register table, it is possible? [message #361927 is a reply to message #361915] Fri, 28 November 2008 10:33 Go to previous messageGo to next message
lopes_andre
Messages: 14
Registered: October 2008
Junior Member
Hi,

The "register" table was an type error, sorry.

Let me explain better...

I have one table with workers of a company:

TABLE_WORKERS
id_worker (PK)
name_worker

In this "table_workers" I have doctors and patients, both workers of the company.

I must to create a new table that will register the "Consultations", but this table must to contain the "id_worker" of the patient, and the "id_worker" of the doctor. This is possible?

TABLE_CONSULTATIONS
id_worker (PK)(FK) /* id_worker of the patient */
diagnostic
id_worker2 (FK) /* id_worker of the doctor */

Ps: the id_worker2 solve me the problem? both id_worker and id_worker2 reference is the id_worker on TABLE_WORKERS


If you can help me on this. Thanks.

Best Regards,
André.

[Updated on: Fri, 28 November 2008 10:36]

Report message to a moderator

Re: 2 employes in the register table, it is possible? [message #361928 is a reply to message #361927] Fri, 28 November 2008 10:40 Go to previous messageGo to next message
pablolee
Messages: 2836
Registered: May 2007
Location: Scotland
Senior Member
Quote:
This is possible?


Yes
Re: 2 employes in the register table, it is possible? [message #361930 is a reply to message #361915] Fri, 28 November 2008 10:57 Go to previous message
lopes_andre
Messages: 14
Registered: October 2008
Junior Member
Thanks for your help!

Best Regards,
André.
Previous Topic: Query Problem
Next Topic: Problem on Fine Grained Auditing
Goto Forum:
  


Current Time: Sat Dec 10 01:26:18 CST 2016

Total time taken to generate the page: 0.10530 seconds