Hi guys,
can you take a simple question ???
Oracle is an object-oriented language ???
Thanks,
Laninha: D
Oracle is an object-oriented language ...
-
- Moderador
- Posts: 2016
- Joined: Wed, 12 Jan 2005 3:25 pm
- Location: Araraquara - SP
Abraço,
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP
Laninha, good afternoon.
In the little I know, at least in earlier versions, I know it's an object-relational bank.
But, there is the topic for personal help us.
In the little I know, at least in earlier versions, I know it's an object-relational bank.
But, there is the topic for personal help us.
-
- Rank: Estagiário Júnior
- Posts: 1
- Joined: Mon, 25 Aug 2008 2:34 pm
- Location: sobral-ce
Bacharel em Ciências da Computação
Especialista em Engenharia de Software
Especialista em Engenharia de Software
In fact Oracle is a SGBD (database management system) created and maintained by Oracle Corporation, Oracle supports relational, object-relational and XML database. PL \ SQL is an extension of the standard SQL language for the Oracle SGBD and it is not object-oriented but a procedural language that extends (gives more) SQL. In reality it is the most robust SGBD in the market, so you will find numerous other features. I hope I made it clear
I disagree with what you talked about the PL / SQL not to be object-oriented, it may not be fully oriented to objects, but it is really possible to program object-oriented in PL / SQL using mainly Types ... See example
and a "child" ...
as they can see, it is possible to overwrite methods, and implement Inheritance, and more, as you can see in the code below, you can use polymorphism as well.
Does anyone still disagree that the PL / SQL is object oriented? : D Hehehe
[]
Jhonatan Pink
Oracle Developer
CREATE OR REPLACE TYPE PESSOA AS OBJECT (
NOME VARCHAR2(80),
IDADE NUMBER,
MEMBER FUNCTION GET_IDADE RETURN NUMBER,
MEMBER FUNCTION GET_NOME RETURN VARCHAR2,
MEMBER PROCEDURE SET_IDADE(IDADE IN NUMBER),
MEMBER PROCEDURE SET_NOME(NOME IN VARCHAR2),
MEMBER FUNCTION GET_TYPE RETURN VARCHAR2,
CONSTRUCTOR FUNCTION PESSOA(NOME IN VARCHAR2,IDADE IN NUMBER)RETURN SELF AS RESULT
)NOT FINAL
/
CREATE OR REPLACE TYPE BODY PESSOA IS
CONSTRUCTOR FUNCTION PESSOA(NOME IN VARCHAR2,IDADE IN NUMBER)
RETURN SELF AS RESULT IS
BEGIN
SELF.SET_IDADE(IDADE);
SELF.SET_NOME(NOME);
RETURN;
END;
MEMBER FUNCTION GET_IDADE RETURN NUMBER IS
BEGIN
RETURN SELF.IDADE;
END;
MEMBER FUNCTION GET_NOME RETURN VARCHAR2 IS
BEGIN
RETURN SELF.NOME;
END;
MEMBER PROCEDURE SET_IDADE(IDADE IN NUMBER) IS
BEGIN
SELF.IDADE := IDADE;
END;
MEMBER PROCEDURE SET_NOME(NOME IN VARCHAR2) IS
BEGIN
SELF.NOME := NOME;
END;
MEMBER FUNCTION GET_TYPE RETURN VARCHAR2 IS
BEGIN
RETURN 'PESSOA';
END;
END;
and a "child" ...
CREATE OR REPLACE TYPE PESSOA_SUB UNDER PESSOA(
NR_CPF NUMBER,
MEMBER FUNCTION GET_CPF RETURN NUMBER,
MEMBER PROCEDURE SET_CPF(NR_CPF IN NUMBER),
OVERRIDING MEMBER FUNCTION GET_NOME RETURN VARCHAR2,
OVERRIDING MEMBER FUNCTION GET_TYPE RETURN VARCHAR2,
CONSTRUCTOR FUNCTION PESSOA_SUB(NOME IN VARCHAR2,IDADE IN NUMBER,NR_CPF IN NUMBER)RETURN SELF AS RESULT
)
/
CREATE OR REPLACE TYPE BODY PESSOA_SUB IS
CONSTRUCTOR FUNCTION PESSOA_SUB(NOME IN VARCHAR2,IDADE IN NUMBER,NR_CPF IN NUMBER)
RETURN SELF AS RESULT IS
BEGIN
SELF.SET_IDADE(IDADE);
SELF.SET_NOME(NOME);
SELF.SET_CPF(NR_CPF);
RETURN;
END;
MEMBER PROCEDURE SET_CPF(NR_CPF IN NUMBER) IS
BEGIN
SELF.NR_CPF := NR_CPF;
END;
MEMBER FUNCTION GET_CPF RETURN NUMBER IS
BEGIN
RETURN SELF.NR_CPF;
END;
OVERRIDING MEMBER FUNCTION GET_NOME RETURN VARCHAR2 IS
BEGIN
RETURN 'pessoa sub '||SELF.NOME;
END;
OVERRIDING MEMBER FUNCTION GET_TYPE RETURN VARCHAR2 IS
BEGIN
RETURN 'PESSOA SUB';
END;
END;
DECLARE
obj PESSOA;
sub PESSOA_SUB;
poli PESSOA;
BEGIN
obj:= new PESSOA('Jhonatan',19);
dbms_output.put_line('Nome: '||obj.get_nome()||' idade: '||obj.get_idade());
dbms_output.put_line(obj.get_type());
obj.set_nome('Alan');
obj.set_idade(26);
dbms_output.put_line('Nome: '||obj.get_nome()||' idade: '||obj.get_idade());
dbms_output.put_line(obj.get_type());
sub:= new PESSOA_SUB('Érika',28,1234567809);
dbms_output.put_line('Nome: '||sub.get_nome()||' idade: '||sub.get_idade()||' cpf: '||sub.get_cpf());
dbms_output.put_line(sub.get_type());
poli := sub;
dbms_output.put_line('Nome: '||poli.get_nome()||' idade: '||poli.get_idade());
dbms_output.put_line(poli.get_type());
END;
[]
Jhonatan Pink
Oracle Developer
- dr_gori
- Moderador
- Posts: 5024
- Joined: Mon, 03 May 2004 3:08 pm
- Location: Portland, OR USA
- Contact:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Cool your example!
is as PHP, has everything to program object oriented, but still optional. (Who wants to do everything procedural, can ...)
is as PHP, has everything to program object oriented, but still optional. (Who wants to do everything procedural, can ...)
-
- Rank: Programador Júnior
- Posts: 18
- Joined: Tue, 04 Nov 2008 1:56 pm
- Location: SP - são Paulo
Well I have to agree that PL / SQL was not born to be object oriented, but it is such a powerful language that can implement OO without the slightest problem.
In fact everything is possible in PL / SQL
In fact everything is possible in PL / SQL
-
- Rank: Analista Sênior
- Posts: 153
- Joined: Tue, 27 May 2008 1:31 pm
- Location: Rio de Janeiro - RJ
Implementing OO concepts does not mean that PL / SQL is OO.
Java does not have all the concepts of Oo. If I'm not mistaken only the Smalltalk is totally Oo.
Just because you can implement some concepts of OO does not mean that it is a language OO.
Java does not have all the concepts of Oo. If I'm not mistaken only the Smalltalk is totally Oo.
Just because you can implement some concepts of OO does not mean that it is a language OO.
In fact ... Java is object-oriented, as well as PL / SQL, C ++, Objective C, Pascal Objective, and so many others.
The difference between them and SmallTalk is:
Smalltalk is a pure Oo language
- The ones I mentioned are hybrid languages.
[] 's
The difference between them and SmallTalk is:
Smalltalk is a pure Oo language
- The ones I mentioned are hybrid languages.
[] 's
-
- Rank: Analista Sênior
- Posts: 153
- Joined: Tue, 27 May 2008 1:31 pm
- Location: Rio de Janeiro - RJ
Cited You:
"It may not be completely oriented to objects, but it is really possible to program object-oriented in PL / SQL using mainly Types ... see example".
To be able to program OO does not mean that it is OO. I agree that only SmallTalk is pure.
If we are analyzed from the hybrid language point of view, all languages ??will be OO.
Java is OO because it can provide all the attributes that an OO language has. I can not speak of others. I know Delphi can do the same, being that most procedural program, as well as PL / SQL.
From my point of view, I do not put PL / SQL as OO, even if you can implement some concepts.
[] S
Alex Silva
"It may not be completely oriented to objects, but it is really possible to program object-oriented in PL / SQL using mainly Types ... see example".
To be able to program OO does not mean that it is OO. I agree that only SmallTalk is pure.
If we are analyzed from the hybrid language point of view, all languages ??will be OO.
Java is OO because it can provide all the attributes that an OO language has. I can not speak of others. I know Delphi can do the same, being that most procedural program, as well as PL / SQL.
From my point of view, I do not put PL / SQL as OO, even if you can implement some concepts.
[] S
Alex Silva
The 4 pillars of object-oriented programming
A language is characterized as object-oriented when it attends these four topics that I will present.
· Abstraction
· Encapsulation
· Inheritance
· Polymorphism
I am sure that PL / SQL implements these 4 pillars of OO!
Continued with my opinion, you agree, or not.
The text above, was withdrawn from: http://www.devmedia.com.br/articles/vie ... ?comp=9264
A language is characterized as object-oriented when it attends these four topics that I will present.
· Abstraction
· Encapsulation
· Inheritance
· Polymorphism
I am sure that PL / SQL implements these 4 pillars of OO!
Continued with my opinion, you agree, or not.
The text above, was withdrawn from: http://www.devmedia.com.br/articles/vie ... ?comp=9264
- dr_gori
- Moderador
- Posts: 5024
- Joined: Mon, 03 May 2004 3:08 pm
- Location: Portland, OR USA
- Contact:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
I had a teacher who was a defender of the Smalltalk because it was the only 100% object-oriented language. (well thing of academics that has nothing else to do besides following some crazy philosophy )
in real, I think one should use what the languages ??have the best. if to Make a certain thing is best if you use oo, beleza, uses ... if it's something simple, I do not see proqueural problem.
is the same thing that was spoken much "GOTO" is The devil! Whoever uses goto is ridiculous ... and honestly, sometimes avoiding a gout is much more complicated than simply use it ...
in real, I think one should use what the languages ??have the best. if to Make a certain thing is best if you use oo, beleza, uses ... if it's something simple, I do not see proqueural problem.
is the same thing that was spoken much "GOTO" is The devil! Whoever uses goto is ridiculous ... and honestly, sometimes avoiding a gout is much more complicated than simply use it ...
-
- Rank: Analista Sênior
- Posts: 153
- Joined: Tue, 27 May 2008 1:31 pm
- Location: Rio de Janeiro - RJ
OK,
Then Oracle should change the name of the PL / SQL (acronym for the English expression procedural Language / Structured Query Language).
I will implement you in my packages.
Thanks for the information made available.
[] S
Alex Silva
Then Oracle should change the name of the PL / SQL (acronym for the English expression procedural Language / Structured Query Language).
I will implement you in my packages.
Thanks for the information made available.
[] S
Alex Silva
- dr_gori
- Moderador
- Posts: 5024
- Joined: Mon, 03 May 2004 3:08 pm
- Location: Portland, OR USA
- Contact:
Thomas F. G
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
Você já respondeu a dúvida de alguém hoje?
https://glufke.net/oracle/search.php?search_id=unanswered
In real, PL / SQL has existed since the 80's. At that time he had nothing related to OO in PLSQL. It was added from Oracle 8. But the name plsql continued the same. (already thought if they change to oolsql? hehehe)
-
- Rank: Programador Sênior
- Posts: 51
- Joined: Wed, 12 Mar 2008 2:11 am
- Location: São Bernardo - SP
Ricardo Moreno
DBA Oracle Pleno
“Só sei que nada sei, e o fato de saber isso, me coloca em vantagem sobre aqueles que acham que sabem alguma coisa.”
(Sócrates 470 a.C – 399 a.C)
DBA Oracle Pleno
“Só sei que nada sei, e o fato de saber isso, me coloca em vantagem sobre aqueles que acham que sabem alguma coisa.”
(Sócrates 470 a.C – 399 a.C)
Yes, the PL / SQL is OO
ABS
ABS
-
- Information
-
Who is online
Users browsing this forum: No registered users and 12 guests