![]() ![]() PL/SQL tables or index-by tables are now known as associative arrays. The ability to index by the data itself rather than the index value facilitates easier and faster identification of data for manipulation such as deletion or update. Individual collection elements could then be referenced using the index value.īecause it was not always easy to identify an element by its subscript, PL/SQL tables evolved to include indexing by alphanumeric strings. ![]() In a PL/SQL table, collections were indexed using an integer. Whether they are stored in the application or in the database.Įarlier versions of PL/SQL used what were known first as PL/SQL tables and later index-by tables.Whether they are dense or sparse (i.e.Whether they are bounded or unbounded (i.e. ![]() Choosing the right collection (or collections) for your application requires understanding the differences between collection types and how each works. PL/SQL uses three types of collections: associative arrays, nested tables, and varrays. PL/SQL includes methods for manipulating individual elements or the collection in bulk. Collections come with their own set of methods for operating on the individual elements. Collections can also reduce the total code needed for an application, further increasing efficiency.Įach element in a collection has a unique identifier called a subscript. Reduced calls equals higher speed and efficiency. Most programming languages in general provide support for collections.Ĭollections reduce the number of database calls due to caching (cached by the collections themselves) of regularly accessed static data. Simplifying SQL access with collectionsĬollections are essentially indexed groups of data that have the same type-for instance arrays or lists (arrays, for instance, are collections of index-based elements). If you are strong in object-oriented programming, you should have no issues using both.Įach language has its fans and its detractors, and you should carefully consider both the needs of your particular application and your own programming skills when selecting whether to use PL/SQL, Java, both or another language. If you are familiar with simple relational database programming, PL/SQL is a good choice for you. Those programmers who feel comfortable with both PL/SQL and Java can and should find ways to optimize overall application performance by distributing tasks where they are most-well suited and most efficiently performed. Java may also pre-load large data sets, reducing overall application performance.Ĭan you use PL/SQL and Java together? Absolutely. What are some of the potential issues with Java use for database-intensive applications? For one, the imposition of object-oriented structure on the database can lead to unnecessary database connections, which consumes resources and reduces speed. Because PL/SQL is tightly integrated with SQL and the underlying database, properly constructed PL/SQL code can limit the number of database calls needed, thereby speeding up data access. But when it comes to pure database functionality, Java code can result in reduced application speed and performance. If your focus is on non-database-oriented functionality, Java is your choice. Java is an object-oriented language that has both client side and server side functionality. PL/SQL is purely server side, and focuses on interacting with the relational database. Why use PL/SQL rather than another language like Java?Īlthough there are many benefits to using other programs such as Java, each has its own specialties. But you can streamline this interface using data type collections, making PL/SQL applications faster and more efficient. Because they switch between procedural code and SQL queries, PL/SQL applications can be inefficient. PL/SQL applications combine procedural logic and SQL statements to retrieve and process data from an SQL database. For simplicity in this article, though, we will refer to PL/SQL throughout. Although the term itself is specific to the Oracle programming language, the general concept of extending SQL queries with procedural logic applies to many programming languages (e.g. PL/SQL (Procedural Language extensions to the Structured Query Language) is an easy to use programming language that simplifies the creation of powerful SQL queries. To overcome SQL limitations, many companies introduced programming languages for building applications that interface with SQL databases-for example PL/SQL from Oracle. While SQL is a robust language, it has some limitations. Although there are a number of languages for manipulating relational databases, SQL remains a standard. Almost every application or piece of software today interacts with a database of some sort, with relational databases in particular. ![]()
0 Comments
Leave a Reply. |