Oracle9i OLAP Services Developer's Guide to the OLAP DML
Release 1 (9.0.1)

Part Number A86720-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Reading Data from Files, 7 of 9


Processing Input Data

Modifying values read from a file

Assignment statements created with the = command have a wide application in the data-reading commands. With the = command you can process any value read from a file in a variety of ways. Instead of just assigning the values as read to a variable or relation, you can modify those values to make them more suitable to your application.

The expression you use can be as simple or complex as you need. You can even perform conditional processing on the values read, based on other data already stored in your analytic workspace or previously read from the file.

For an example of using FILEREAD commands using an assignment statement in a field description, see "Reading and Maintaining Dimension Values".

Example: Modifying values read from a file

The following command reads sales data and assigns it to the variable SALES, replacing whatever value is already stored in that variable.

fileread funit w 8 district w 8 product w 10 sales

Using an expression, however, you can add the new data to the value currently stored in the variable.

fileread funit w 8 district w 8 product sales -
  = sales + w 10 value

The data just read from the file is represented in the expression by the keyword VALUE.

Example: Reading different fields for different types of records

Suppose you have two different types of records in a file, you can read different fields for each type of record.

fileread funit w 1 rectype w 8 district w 8 -
   append product -
   prodname = -
     if rectype eq 'A' then col 25 w 16 value -
     else col 42 w 16 value

Specifying a conversion type for data

In general, you do not need to specify a data type when you read input values into an OLAP DML variable. By default, input values are converted to the data type of the target variable.

However, when the target variable has a data type of DATE, you can use either the default conversion type of DATE or an alternative conversion type of RAW DATE as described earlier in this chapter.

You might also want to specify a conversion type when you use an expression to process input values before storing them in a target variable.

Related information

For more information, see the following table.

IF you want documentation about . . .  THEN see . . . 

the FILEREAD command, 

the topic for the command in the OLAP DML Reference 

assignment statement, 

"Assigning Values to Data Objects".

the topic for the = command in the OLAP DML Reference 


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback