zoom.javabarcode.com | ||
Simple .NET/ASP.NET PDF document editor web control SDKathematical calculations are an important element of writing shell scripts. In the various flavors of UNIX, there are multiple ways to perform just about any task, and mathematical tasks are no exception. Although there are many types of mathematical computations, I ve limited the discussion in this chapter to the basic operations of addition, subtraction, multiplication, and division, plus remainder, exponentiation, and trigonometric functions. The examples make use of the variables a, b, c, and d. One note on division: some programming languages don t perform integer division like you might expect from using your traditional calculator. There are two parts to the quotient of an integer-division problem, the whole (or integer) part and the remainder. Take the example of 5 divided by 3; the whole part of the quotient is 1 and the remainder upon division is 2. In some of this chapter s methods for doing math in the shell, there are two distinct operators for integer division. The slash (/) operator returns the whole part and the percent (%) operator returns the remainder. Keep this in mind when performing your calculations. excel2010 microsoft barcode control 9.0, barcode inventory software excel, activebarcode excel 2010, how to convert to barcode in excel 2010, excel barcode add in freeware, excel barcode add-in 2007, excel 2010 barcode erstellen freeware, how to create barcodes in excel 2010 free, 2d barcode font for excel, barcode font in excel 2007,If you want to create indexes on a staging table, you re better off using the SQL*Loader utility to load data into the table. You can t index an external table! For example, suppose you have an external data file named sales_data that contains detailed information about your firm s sales data for the last year. Your firm wants to perform product and time cost analysis based on this raw data. You create a cost table to do this analysis. Now, the sales_data file contains a lot of detailed information on costs, but your company wants the data to be aggregated, say on the basis of regions. External tables are excellent for this kind of analysis, where you have large amounts of raw data available, but you need only certain transformed parts of this data. Traditionally, data warehousing DBAs had to create staging tables to first transform data, before loading it into the data warehouse. Using just the SQL*Loader, you would need to load the raw data into your database first, and then apply the necessary transformations to it. Using an external table, you can perform the loading and transform operations in one step! Now, let s look at how to create and populate external tables. The external table description is also called the external table layer, and it is basically a description of the columns in your external table. This external table layer, along with the access driver, maps the data in the external file to the external table definition. Listing 13-3 shows how to create an external table. Listing 13-3. Creating an External Table SQL> CREATE TABLE sales_ext( 2 product_id NUMBER(6), 3 sale_date DATE, 4 store_id NUMBER(8), 5 quantity_sold NUMBER(8), 6 unit_cost NUMBER(10,2), 7 unit_price NUMBER(10,2)) 8 ORGANIZATION EXTERNAL ( 9 TYPE ORACLE LOADER 10 DEFAULT DIRECTORY ext_data_dir 11 ACCESS PARAMETERS 12 (RECORDS DELIMITED BY NEWLINE 13 BADFILE log_file_dir:'sales.bad_xt' 14 LOGFILE log_file_dir:'sales.log_xt' 15 FIELDS TERMINATED BY "|" LDRTRIM 16 MISSING FIELD VALUES ARE NULL) 17 LOCATION ('sales.data')) 18* REJECT LIMIT UNLIMITED; Table created. SQL> Let s analyze this statement in detail, in order to understand the various components of an external table. The statement CREATE TABLE sales_ext (. . .) describes the external table structure, with the ORGANIZATION EXTERNAL clause that follows it indicating that this isn t going to be a regular Oracle table, but an external table. The CREATE statement for an external table is very similar to that of a regular table, except that in addition to the column definitions, you must provide the mapping for the columns to the data fields in the external data file. In addition, the external table creation statement must provide the operating system location of the external data file.
|