Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Using Embedded SQL, 6 of 15
Before writing the code to fetch data into an analytic workspace, you should write down SELECT statements that you think will retrieve the data you want to fetch. When possible, use an interactive interface such as SQL*Plus or SQL Worksheet to test these SQL statements and make sure that they produce the results you expect. Afterward, you can modify these SELECT statements for use in your OLAP DML programs.
Tip: Use ORDER BY clauses where necessary so that the data for multidimensional variables is fetched with the slowest-varying dimension values first. Use GROUPBY clauses to perform simple aggregation of the data to the level at which it becomes useful for data analysis.
You cannot issue a SELECT statement in the OLAP DML. Instead, you must define a cursor using embedded SQL in an OLAP DML program. In the context of a query, a cursor can be thought of as simply a row marker in a table of data resulting from a query. Instead of receiving the results of a query all at once, your program receives the results row by row using the cursor.
You must declare and open a cursor from within a single OLAP DML program. Then you can fetch the data and close the cursor either in the same program or a different program.
Several special SQL statements are used to define and use cursors.
The following commands are associated with cursors. Each of them is discussed in detail in a separate topic.
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|