Team Fly | ![]() ![]() |
102238 CT 15000 101798 CT 15000 101515 CT 15000 103007 UT 15000 24830 UT 15000 8 rows selected.
Up to now, we have illustrated a number of fairly simplistic DML statements. We've selected some records from different tables using criteria, we've updated existing rows, and we've even inserted and deleted some records.
Oracle provides us with many functions that allow us to analyze and aggregate the data, returning results that differ greatly from the result sets we've seen so far. A function manipulates the contents of a column in a SQL statement. We can find what the largest credit limit is in the CUSTOMERS table, we can round numbers or pad results with characters. In fact, when we ran a count of customers that were in the province of 'Delhi' before and after deleting these records, we took a sneak peek ahead at functions.
This section will introduce you to three different types of functions: string (or character), numeric, and aggregate.
String functions, also known as character functions, can be categorized in two types: those that return character values and those that return numeric values.
Table 2-3 represents the most common functions you will perform with the character data type. It is only a partial list. The examples that follow all use the ''dual" table. The "dual" table is an internal Oracle table and is useful in SQL and PL/SQL to perform functions that return a single row. It can be used to return the current system date and time, to perform arithmetic functions or to obtain a generated sequential number (more on this later in the chapter).
Team Fly | ![]() ![]() |