underline.javabarcode.com | ||
.NET/Java PDF, Tiff, Barcode SDK LibraryThe clause DEFAULT DIRECTORY indicates the default location for all files that external tables need to read from or write to You can t place the external data files in a random operating system directory for obvious security reasons For an external table creation statement to succeed, you must first create a directory object, and then grant rights to specific users on this directory object The LOCATION parameter toward the end of the external table creation statement shown in Listing 13-3 indicates where the data files for the external table creation are located The LOCATION parameter could indicate both a directory object and a filename The format of the LOCATION parameter is directory: file, where directory is a directory object you ve created in the database, not an actual directory path on your system. free barcode generator add-in for excel, how to create a barcode in excel 2007, excel barcode generator add in free, barcode for excel 2016, barcode add-in for excel, free barcode generator add-in for excel, barcode formula excel 2010, barcode generator excel 2016, excel barcode add in for windows, excel 2010 barcode erstellen freeware,$ ls -l total 113172 -rw-rw-r-- 1 rbpeters rbpeters 1057862 Jun 7 18:21 37l5152.log -rw-rw-r-- 1 rbpeters rbpeters 449184 Jun 7 18:21 770tref.log -rw-rw-r-- 1 rbpeters rbpeters 1104249096 Jun 7 21:22 really_big.log If you omit the directory part of the specification, then it s assumed that the data file(s) is located in the directory specified by the DEFAULT DIRECTORY clause You can also use the directory: file notation to specify the data files directly under the ACCESS PARAMETERS clause, if you wish SQL*Loader uses the directory object(s) to indicate where the data files are located, as well as to store its output files, such as the bad and discard files A user must have read privileges on the directory object containing the data files and write privilege on the directory object containing the output files If you wish to place both the data files and the output files in the same directory object, you may grant both read and write privileges on that directory object to the user Here s one such example: SQL> CREATE DIRECTORY ext_data_dir AS '/u01/oradata/ext_data'; Directory created. SQL> GRANT READ, WRITE ON DIRECTORY ext_data_dir TO samalapati; Grant succeeded SQL> Once you create the directory object ext_data_dir and grant the proper rights, you can then use this as the default directory for placing all the external data files as well as output files The LOCATION parameter in the external table creation statement shown in Listing 13-3 simply names the external data file, which will be located in the default directory specified by ext_data_dir For demonstration purposes, let s create a new table named costs, into which you ll eventually load the aggregate data (the totals of the unit_cost and unit_price columns) from the external data file (external table): SQL> CREATE TABLE costs 2 (sale_date DATE, 3 product_id NUMBER(6), 4 unit_cost NUMBER (10,2), 5 unit_price NUMBER(10,2)); Table created. Now you re ready to insert the necessary aggregate data from the external table (external file, actually) sales_ext into the new costs table This process of first reading data from an external table and then loading it into a normal database table is called loading data Listing 13-4 shows how to insert data into a normal table from an external table The Oracle table is named costs, and sales_ext is the external table.. Managed callers that do not understand the const signature modifier can still call an fWrapper function, defined as follows: void fWrapper(int% i1, const int% i2); When the native argument is a pointer to an array, tracking reference arguments are not sufficient To discuss this case, let s assume that the native SampleCipher class has a constructor that expects arguments to pass the encryption key: namespace NativeLib { class SampleCipher : public CryptoAlgorithm { public: SampleCipher(const unsigned char* pKey, int nKeySizeInBytes); /* .. implementation can be ignored so far .. */ }; }. Listing 13-4. Loading Data into a Normal Table from an External Table SQL> INSERT INTO costs (sale_date, product_id, unit_cost, unit_price) SELECT sale_date, product_id, sum(unit_cost), sum(unit_price) FROM sales_ext GROUP BY time_id, prod_id; SQL> Note that you can insert only some of the columns in the external table if you choose, and you can transform the data before it s even loaded into your tables. This is the key difference between using external tables and SQL*Loader to load data into Oracle tables. The SQL*Loader tool permits you to perform data transformation, but its capabilities in that area are extremely limited, as you saw earlier in this chapter. You can use just about any arbitrary SQL transformations when creating an external table.
|