PL MySQL does it exist

0 votes
Powerful imperative language PL/SQL is available in Oracle. Is MySQL capable of something comparable?
Sep 10, 2022 in Database by Kithuzzz
• 38,000 points
1,468 views

1 answer to this question.

0 votes

Despite the fact that MySQL and PL/SQL share some similarities, you cannot use PL/SQL in MySQL. The same is true of T-SQL, which MS SQL Server uses. MySQL has plenty of documentation on it its website.

You'll see that T-SQL and PL-SQL are both Turing-complete and likely offer a little bit more capability. But there are numerous ways to accomplish comparable tasks with MySQL.

Here is the content from the Yahoo Answers post:

MySQL is a multithreaded, multi-user SQL database management system (DBMS)1 which has, according to MySQL AB, more than 10 million installations.

Libraries for accessing MySQL databases are available in all major programming languages with language-specific APIs. In addition, an ODBC interface called MyODBC allows additional programming languages that support the ODBC interface to communicate with a MySQL database, such as ASP or Coldfusion. The MySQL server and official libraries are mostly implemented in ANSI C.

MySQL is popular for web applications and acts as the database component of the LAMP, MAMP, and WAMP platforms (Linux/Mac/Windows-Apache-MySQL-PHP/Perl... and for open-source bug tracking tools like Bugzilla. Its popularity as a web application is closely tied to the popularity of PHP, which is often combined with MySQL. PHP and MySQL are essential components for running the popular WordPress blogging platform.

The following features are implemented by MySQL but not by some other RDBMSes:

  • Multiple storage engines, allowing you to choose the one which is most effective for each table in the application (in MySQL 5.0, storage engines must be compiled in; in MySQL 5.1, storage engines can be dynamically loaded at run time): o Native storage engines (MyISAM, Falcon, Merge, Memory (heap), Federated, Archive, CSV, Blackhole, Cluster) -Partner-developed storage engines (InnoDB, solidDB, NitroEDB, BrightHouse) -Community-developed storage engines
  • Custom storage engines
  • Commit grouping, gathering multiple transactions from multiple connections together to increase the number of commits per second.

Note:: MySQL is written in C and C++. The SQL parser uses yacc and home-brewed lexer. A document describing some of the internal structures of the code and the coding guidelines is available from the MySQL web site.

SQL


SQL commonly expanded as Structured Query Language, is a computer language designed for the retrieval and management of data in relational database management systems, database schema creation and modification, and database object access control management.

The SQL language is sub-divided into several language elements, including:

  • Statements which may have a persistent effect on schemas and data, or which may control transactions, program flow, connections, sessions, or diagnostics.
  • Queries which retrieve data based on specific criteria.
  • Expressions which can produce either scalar values or tables consisting of columns and rows of data.
  • Predicates which specify conditions that can be evaluated to SQL three-valued logic (3VL) Boolean truth values and are commonly used to limit the effects of statements and queries, or to change program flow.
  • Clauses which are (in some cases optional) constituent components of statements and queries

it works under..concept of query data manipulation data defination transaction control

The SQL:2003 standard makes minor modifications to all parts of SQL:1999, and officially introduces a few new features such as:1

  • XML-related features
  • window functions
  • the sequence generator, which allows standardized sequences
  • two new column types: auto-generated values and identity-columns
  • the new MERGE statement
  • extensions to the CREATE TABLE statement, to allow "CREATE TABLE AS" and "CREATE TABLE LIKE"
  • removal of the poorly-implemented "BIT" and "BIT VARYING" data types

PL/SQL


PL/SQL is Oracle Corporation's proprietary server-based procedural extension to the SQL database language. (Some other SQL database management systems offer languages similar to PL/SQL.) Its syntax strongly resembles that of Ada.

PL/SQL supports variables, conditions, arrays, and exceptions. Implementations from version 8 of the Oracle RDBMS onwards have included features associated with object-orientation.

The underlying SQL functions as a declarative language. Standard SQL—unlike some functional programming languages—does not require implementations to convert tail calls to jumps. SQL does not readily provide "first row" and "rest of table" accessors, and it cannot easily perform some constructs such as loops. PL/SQL, however, as a Turing-complete procedural language which fills in these gaps, allows Oracle database developers to interface with the underlying relational database in an imperative manner. SQL statements can make explicit in-line calls to PL/SQL functions, or can cause PL/SQL triggers to fire upon pre-defined Data Manipulation Language (DML) events.

PL/SQL stored procedures (functions, procedures, packages, and triggers) which perform DML get compiled into an Oracle database: to this extent their SQL code can undergo syntax-checking. Programmers working in an Oracle database environment can construct PL/SQL blocks of such functionality to serve as procedures, functions; or they can write in-line segments of PL/SQL within SQL*Plus scripts.

While programmers can readily incorporate SQL DML statements into PL/SQL (as cursor definitions, for example, or using the SELECT ... INTO syntax), Data Definition Language (DDL) statements such as CREATE TABLE/DROP INDEX etc require the use of "Dynamic SQL". Earlier versions of Oracle required the use of a complex built-in DBMS_SQL package for Dynamic SQL where the system needed to explicitly parse and execute an SQL statement. Later versions have included an EXECUTE IMMEDIATE syntax called "Native Dynamic SQL" which considerably simplifies matters. Any use of DDL in Oracle will result in an implicit commit. Programmers can also use Dynamic SQL to execute DML where they do not know the exact content of the statement in advance.

PL/SQL offers several pre-defined packages for specific purposes. Such PL/SQL packages include:

  • DBMS_OUTPUT - for output operations to non-database destinations
  • DBMS_JOB - for running specific procedures/functions at a particular time (i.e. scheduling)
  • DBMS_XPLAN - for formatting "Explain Plan" output
  • DBMS_SESSION - provides access to SQL ALTER SESSION and SET ROLE statements, and other session information.
  • DBMS_METADATA - for extracting meta data from the data dictionary (such as DDL statements)
  • UTL_FILE - for reading and writing files on disk
  • UTL_HTTP - for making requests to web servers from the database
  • UTL_SMTP - for sending mail from the database (via an SMTP server)

Oracle Corporation customarily adds more packages and/or extends package functionality with each successive release of the Oracle DBMS.

I hope this helps you.

answered Sep 11, 2022 by narikkadan
• 63,600 points

Related Questions In Database

0 votes
1 answer

My values in my codes aren't inserted into mySQL. I input 5 but it will show 0. Any ideas?

Hello, You can refer my corresponding sample web ...READ MORE

answered Jul 13, 2020 in Database by Niroj
• 82,840 points
972 views
0 votes
0 answers

Check if table exists and if it doesn't exist, create it in SQL Server 2008

I'm using SQL Server 2008 to create ...READ MORE

Sep 2, 2022 in Database by Kithuzzz
• 38,000 points
840 views
0 votes
0 answers

SQL Error: ORA-00942 table or view does not exist

I'm using SQL Developer, and after creating ...READ MORE

Sep 4, 2022 in Database by Kithuzzz
• 38,000 points
1,059 views
0 votes
1 answer

Types of tables in MySQL

MyISAM is the default table that is ...READ MORE

answered Aug 21, 2018 in Database by CodingByHeart77
• 3,750 points
1,616 views
0 votes
1 answer

Want a command to be executed in Salt only if a directory is empty

You should consider using this inside your ...READ MORE

answered Jun 12, 2018 in DevOps Tools by Damon Salvatore
• 5,980 points
1,841 views
0 votes
1 answer

Creating A New MySQL User In Amazon RDS Environment

AWS RDS security groups documentation (a common ...READ MORE

answered Jul 18, 2018 in AWS by Priyaj
• 58,020 points
2,061 views
0 votes
1 answer

Using conditional to execute a command in salt

You can use unless inside your state ...READ MORE

answered Jul 23, 2018 in Other DevOps Questions by DareDev
• 6,890 points
2,082 views
0 votes
1 answer

What does the "@" symbol do in SQL?

The @CustID denotes a parameter for which ...READ MORE

answered Sep 10, 2022 in Database by narikkadan
• 63,600 points
1,292 views
0 votes
1 answer

How can I confirm a database is Oracle & what version it is using SQL?

Run this SQL: select * from v$version; Output: BANNER ---------------------------------------------------------------- Oracle Database ...READ MORE

answered Sep 12, 2022 in Database by narikkadan
• 63,600 points
718 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP