I want at this point call the member procedure AddVisita of one row where the object is a medico_ty in dipendente_tab
(gettin the row like this (think) select treat(value(d) as medico_ty) d
from dipendente_tab d
where d.cf=constant )
for fill a row of visita_tab and the nested table in paziente_tab(FaVisita) and dipendente_tab where dipendente is of medico_ty (FaVisita).
Like this d.AddVisita(par1,par2,par3,par4), is possible? how to make it?
This is the code(no syntax error): -
1)CREATE type Visita_ty
-
-
2)CREATE TYPE COLL_REF_VISITA_TY AS TABLE OF REF VISITA_TY
-
-
-
3)CREATE TYPE Dipendente_ty AS OBJECT
-
(
-
Nome VARCHAR2(20),
-
Cognome VARCHAR2(20),
-
Cf VARCHAR2(20),
-
DataN Date
-
-
) NOT FINAL
-
-
-
-
4)CREATE TYPE Amministrativo_ty UNDER Dipendente_ty
-
(
-
Livello NUMBER,
-
Mansione VARCHAR(20)
-
)FINAL
-
-
-
-
5)CREATE TYPE Medico_ty UNDER Dipendente_ty
-
(
-
Specialita VARCHAR(20),
-
FaVisita Coll_Ref_Visita_ty,
-
Reparto VARCHAR(20),
-
MEMBER PROCEDURE AddVisita (CF VARCHAR2,Data DATE,Tipo VARCHAR2,Ticket Number)
-
)FINAL
-
-
6)CREATE TYPE Paziente_ty AS OBJECT
-
(
-
CF VARCHAR2(16),
-
NOME VARCHAR2(20),
-
COGNOME VARCHAR2(20),
-
FaVisita Coll_Ref_Visita_ty
-
)
-
-
7)CREATE type Visita_ty AS OBJECT (
-
Tipo VARCHAR(20),
-
Data DATE,
-
Ticket number,
-
Paziente REF Paziente_ty,
-
Medico REF Medico_ty
-
)
-
8)CREATE TYPE BODY Medico_ty is
-
MEMBER PROCEDURE AddVisita(CF VARCHAR,Data DATE, Tipo VARCHAR,Ticket
-
number) is
-
DECLARE
-
Visita Visita_ty;
-
RefPaziente REF Paziente_ty;
-
BEGIN
-
SELECT REF(P) INTO REFPAZIENTE
-
FROM Paziente_TAB P
-
WHERE P.CF=CF
-
VISITA :=Visita_ty(Data,Tipo,Ticket,RefPaziente,REF(SELF))
-
INSERT INTO Visita_TAB values Visita
-
INSERT INTO TABLE (SELF.FaVisita) VALUES REF(Visita)
-
INSERT INTO TABLE (SELECT P.FaVisita
-
FROM PAZIENTE_TAB P
-
WHERE P.CF=CF ) VALUES REF(VISITA)
-
END
-
-
9)CREATE TABLE Paziente_TAB OF Paziente_ty
-
(CF PRIMARY KEY)
-
NESTED TABLE FaVisita
-
STORE AS PazienteFaVisita_TAB
-
-
10)CREATE TABLE Dipendente_TAB OF Dipendente_ty
-
(CF PRIMARY KEY)
-
NESTED TABLE TREAT(OBJECT_VALUE AS medico_ty).FaVisita STORE AS visite_tab
-
-
11)CREATE TABLE Visita_TAB OF Visita_ty
-
(Paziente SCOPE IS Paziente_TAB,
-
Medico SCOPE IS Dipendente_TAB)
-
-
// some insert
-
-
INSERT INTO PAZIENTE_TAB (nome,cognome,cf,favisita)
-
VALUES('rosario','brescia','ros80lit04edk19f',Coll_Ref_Visita_ty())
-
-
INSERT INTO PAZIENTE_TAB (nome,cognome,cf,favisita)
-
VALUES('antonio','rosato','ant80lit04edk19f',Coll_Ref_Visita_ty())
-
-
INSERT INTO dipendente_tab values(medico_ty( 'rosario','manfredoina','rosak2442jk3','10-feb-1960','psicologia',
-
coll_ref_visita_ty(),'psi1'))
-
-
INSERT INTO dipendente_tab values(medico_ty( 'manuele','doria','fafasd32442jk3','10-gen-1970','chirurgia',coll_ref_visita_ty(),'chi1'))
-
2 2332
Are you getting any runtime errors?
No runtime error, i run all the code and create normally table and type, and if i tried to insert manually it works ( i tried some query and go well) but insted of us all this (not clear) code below i wanna to use the AddVisita procedure for insert in the various nested table/visita_tab : -
INSERT INTO visita_tab values('chirurgia','25-feb-2010',30,
-
(select ref(p)
-
from paziente_tab p
-
where p.cf='ros80lit04edk19f'),
-
(select treat(ref(d) as ref medico_ty)
-
from dipendente_tab d
-
where d.cf='fafasd32442jk3'))
-
-
-
INSERT INTO TABLE
-
(SELECT TREAT(value(D) AS Medico_ty).FaVisita
-
FROM Dipendente_tab d
-
where d.cf='fafasd32442jk3'
-
)
-
SELECT ref(v)
-
FROM visita_tab v
-
WHERE v.medico=(select ref(m)
-
from dipendente_tab m
-
where m.cf='fafasd32442jk3')
-
-
-
-
INSERT INTO TABLE(
-
SELECT FaVisita
-
FROM Paziente_tab P
-
WHERE p.cf='ros80lit04edk19f'
-
)
-
SELECT ref(v)
-
FROM visita_tab v
-
WHERE v.paziente=(SELECT ref(paz)
-
FROM paziente_tab paz
-
WHERE paz.cf='ros80lit04edk19f')
-
-
-
Thx for the fast answer :).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: george young |
last post by:
I had developed the habit of using the neat python form:
if someinstance:
someinstance.memb()
because it seems cleaner than "if someinstance is not None".
{please no flames about "is not None"...
|
by: Nashat Wanly |
last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and
Visual C# .NET
View products that this article applies to.
This article was previously published under Q310070
For a Microsoft...
|
by: Eric A. Johnson |
last post by:
Hi All,
I have a class, ConsoleWindow, that is a member of another class,
ConsoleLib, like so:
class ConsoleLib
{
public:
class ConsoleWindow
{
public:
|
by: Nels Olsen |
last post by:
Our company is rewriting our product in .NET. The old product is in PowerBuilder, which is heavy on Hungarian notation. We are approaching the time where we have to finalize naming conventions for...
|
by: Mark Sisson |
last post by:
Hi all.
SITUATION
================
1. I have a base class with a member variable that's an object
2. I have several classes that inherit from the base class.
3. There are several methods in...
|
by: seyiisq |
last post by:
how do i implement a superclass and subclass relatioship of the type
partial disjoint when creating the tables
--
seyiisq...
|
by: Catch_22 |
last post by:
Hi,
I have a large SQL Server 2000 database with 3 core tables.
Table A : 10 million + records
Table B : 2 million + records
Table C : 6 million + records
One of the batch tasks that I...
|
by: Ruben |
last post by:
Hi!
I am looking for a way to get the name of a class-member as string, as
example:
class A
{
public string a;
}
|
by: blangela |
last post by:
If I pass a base class object by reference (likely does not make a
difference here that it is passed by reference) as a parameter to a
derived class member function, the member function is not...
|
by: billmaclean1 |
last post by:
I need to write a stored procedure that selects from a table and
returns the result set. I don't always know the TableSchema that I
need to use when qualifying the table at run-time
Example:...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |