Select
The following examples use different SELECT commands on the Teradata system that are supported by the Oracle target connector.
SELECT CAST(Price AS DECIMAL (8,2))
, mileage
, CAST(make AS VARCHAR(20))
, CAST(model AS VARCHAR(20))
FROM cardata@oraclefs_active WHERE make=’Buick’;
price mileage make model
-------- ------- ------ --------------------
17314.10 8221 Buick Century
17542.04 9135 Buick Enclave
Select with Foreign Table
SELECT * FROM FOREIGN TABLE (SELECT make, model FROM default.cardata where make = 'Buick')@oraclefs_active AS dt;
make model
------ --------------------
Buick Century
Buick Enclave
Select with Export Clause
SELECT * from FOREIGN TABLE(select * from tmpabc )@oraclefs_active EXPORT((select * from oracleTypet) AS tmpabc) as dt;
*** Query completed. One row found. 11 columns returned.
*** Total elapsed time was 15 seconds.
c1 c2
-------------------- ---------------------------------------- -------------
abc aaaaxxxxxx
Select with Returns Clause
SELECT * FROM datatypes1@oraclefs_active RETURNS (varchar1 VARCHAR(5) CHARACTER SET LATIN) WHERE bigint1 > 10000 AND double1 < 10000;