The SQL transformation processes
SQL queries midstream in a pipeline. You can insert, delete, update, and
retrieve rows from a database. You can pass the database connection information
to the SQL transformation as input data at run time. The transformation
processes external SQL scripts or SQL queries that you create in an SQL editor.
The SQL transformation processes the query and returns rows and database
errors.
Mode
Script mode : The SQL
transformation runs ANSI SQL scripts that are externally located. You pass a
script name to the transformation with each input row. The SQL transformation
outputs one row for each input row.
Query mode : The SQL
transformation executes a query that you define in a query editor. You can pass
strings or parameters to the query to define dynamic queries or change the
selection parameters. You can output multiple rows when the query has a SELECT
statement.
Main Properties
Passive or active transformation : The SQL
transformation is an active transformation by default. You can configure it as
a passive transformation when you create the transformation.
Database type: The type of database the SQL
transformation connects to.
Connection type. Pass database
connection information to the SQL transformation or use a connection object.
There is lot of theoretical
document about this transformation about this on internet and help files I will
try to show how we can use it in different practical scenarios
- Remove duplicate records
- Dynamic Query in SQL Transformation
- Capture Database errors using SQL Transformation
- SQL Transformation with Non-Equi Join
- Dynamic DB Connections using SQL Transformation
- One to Many Records SQLTx
- NonEql Join MultMatch Lkup
- Dynamic Split Data
Remove duplicate records
We can remove duplicate records
by using SQL Transformation by using below method.
First use aggregator
transformation to count of duplicate rows then use same variable in SQL
transformation using parameter substituting
Use below in SQL transformation
after creating sql transformation in query mode
delete test_dup where
PRODUCT_ID=~PRODUCT_ID~ and SUBPRODUCT_ID=~SUBPRODUCT_ID~ and rownum
<~count_dup~
TEST_DUP is table and we want to
find duplicate data on basis of product id and sub product id.
We have used string substitution
feature of SQL transformation here i.e. use of
~
Dynamic Query in SQL
Transformation :
In most of datawarehouse
projects we encountered error ORA-02149
Specified partition does not exist as
sometime we don’t have partition created for new data or data comes with
unexpected value which does not have corresponding partition.
Though it can be
overcome by using interval partitioning feature of oracle but that creates
partition name with name like SYS*
We can use SQL
Transformation to achieve this.
Suppose we have
sales table created with list partitioning
create table sales (
product_id number,
trans_amt number,
sales_dt date,
state_code varchar2(2)
)
partition by list (state_code)
(
partition ct values ('CT'),
partition ca values ('CA')
);
Suppose we get
every day data in sales file which get loaded into sales table but if data
comes with other value than CT or CA for state code then load will fail with
error error ORA-02149
Specified partition does not exist
We can create a SQL
Transformation to achieve this
It can be achieve in below steps
Source is
sales file and create a look up on all_tab_partitions view
Call this
unconnected lookups from expression using below syntax
Chk_partition_exist
= :lkp.LKP_ALL_TAB_PARTITIONS('SALES',state_code)
create a filter
transformation with iif(isnull(Chk_partition_exist),TRUE,FALSE) so that data
for which partition does not exist will
pass
Create SQL
transformation like below
If input data comes with new values of state
code then it will automatically create partitions so that we will never see
error ORA-02149 Specified partition does not exist again.
We will
continue to cover more practical usages of SQL transformation in next article.
Informatica Data Quality Online Training
ReplyDeleteInformatica Online Training
Informatica MDM Online Training
. If you are seeking training and support you can reach me on 91-9000444287.
Introduction and Defining Data Model
Introduction to Informatica MDM Hub
Master Data
Master Data Management
A Reliable Foundation of Master Reference Data
Components of MDM Hub
Application Server Tier
Database Server Tier
Batch Data Process Flow
Trust Framework
Consolidation Flag
http://www.21cssindia.com/courses/informatica-mdm-online-training-99.html
en son çıkan perde modelleri
ReplyDeleteSms Onay
mobil ödeme bozdurma
nft nasıl alınır
ANKARA EVDEN EVE NAKLÄ°YAT
TRAFÄ°K SÄ°GORTASI
DEDEKTOR
web sitesi kurma
ASK KÄ°TAPLARÄ°
kartal arçelik klima servisi
ReplyDeleteümraniye arçelik klima servisi
pendik bosch klima servisi
pendik arçelik klima servisi
tuzla mitsubishi klima servisi
çekmeköy bosch klima servisi
ataÅŸehir bosch klima servisi
çekmeköy arçelik klima servisi
ataşehir arçelik klima servisi
Good content. You write beautiful things.
ReplyDeletemrbahis
mrbahis
vbet
sportsbet
taksi
sportsbet
hacklink
korsan taksi
hacklink
sultangazi
ReplyDeleteordu
mardin
bodrum
sincan
0JBZDH
görüntülü show
ReplyDeleteücretlishow
QG6
tekirdaÄŸ evden eve nakliyat
ReplyDeletekocaeli evden eve nakliyat
yozgat evden eve nakliyat
osmaniye evden eve nakliyat
amasya evden eve nakliyat
MPX
düzce evden eve nakliyat
ReplyDeletedenizli evden eve nakliyat
kırşehir evden eve nakliyat
çorum evden eve nakliyat
afyon evden eve nakliyat
QF1
urfa evden eve nakliyat
ReplyDeletemalatya evden eve nakliyat
burdur evden eve nakliyat
kırıkkale evden eve nakliyat
kars evden eve nakliyat
W87SAA
2876E
ReplyDeleteErgo Coin Hangi Borsada
Konya Lojistik
Loop Network Coin Hangi Borsada
Apenft Coin Hangi Borsada
Clysterum Coin Hangi Borsada
Çerkezköy Bulaşık Makinesi Tamircisi
Afyon Parça Eşya Taşıma
Elazığ Evden Eve Nakliyat
Poloniex Güvenilir mi
A1775
ReplyDeleteÇerkezköy Cam Balkon
Konya Parça Eşya Taşıma
Ağrı Evden Eve Nakliyat
Silivri Cam Balkon
Ünye Parke Ustası
Bolu Evden Eve Nakliyat
Muğla Parça Eşya Taşıma
Osmaniye Parça Eşya Taşıma
Rize Şehir İçi Nakliyat
58319
ReplyDeleteBinance Neden Tercih Edilir
Binance Hesap Açma
Binance'de Kaldıraç Var mı
Kripto Para Kazma Siteleri
Coin Nasıl Çıkarılır
Yeni Çıkacak Coin Nasıl Alınır
https://resimlimag.net/
Coin Çıkarma
Binance MadenciliÄŸi Nedir
9EE39
ReplyDeletebinance referans kodu
binance referans kodu
referans kimliÄŸi nedir
resimli magnet
binance referans kodu
6ABE7
ReplyDeletebinance referans kodu
referans kimliÄŸi nedir
resimli magnet
binance referans kodu
resimli magnet
resimli magnet
binance referans kodu
binance referans kodu
referans kimliÄŸi nedir
89BDF
ReplyDeletebingöl bedava görüntülü sohbet sitesi
balıkesir mobil sohbet
nevşehir görüntülü sohbet uygulama
nevşehir görüntülü sohbet
rize rastgele sohbet siteleri
adıyaman rastgele sohbet
artvin görüntülü sohbet ücretsiz
kayseri sohbet sitesi
manisa bedava sohbet uygulamaları
C7E27
ReplyDeletekars canlı sohbet siteleri
maraş en iyi ücretsiz sohbet siteleri
muğla rastgele sohbet uygulaması
gümüşhane ücretsiz sohbet sitesi
kırşehir canlı sohbet et
malatya görüntülü sohbet kızlarla
bingöl ücretsiz görüntülü sohbet uygulamaları
kilis görüntülü sohbet uygulama
antalya en iyi rastgele görüntülü sohbet
055D6
ReplyDeletegüneş paneli
jeneratör fiyatları
qtum coin yorum
sanal sunucu
mobil uygulama
google reklam verme
ankr coin yorum
yapay zeka siteleri
loka coin yorum
75AFC
ReplyDeletefuar standı
güneş paneli
Google Reklam Verme
Dedicated Server
Wordpress SEO
Opencart SEO
Google Yorum
jeneratör fiyatları
Sunucu
2F426
ReplyDeleteFacebook Hesap Satın Al
Facebook BeÄŸeni
Kurumsal Hosting
dedicated server
istanbul iç mimar
seo nedir
güneş paneli fiyatları
jeneratör fiyatları
SEO EÄŸitimi
0A482
ReplyDeleteSantos Coin Yorum
BTC Yorum
Ape Coin Yorum
Adx Coin Yorum
Sys Coin Yorum
Ankr Coin Yorum
Link Coin Yorum
Waxp Coin Yorum
Axs Coin Yorum
1CDC3
ReplyDeleteWaxp Coin Yorum
Clv Coin Yorum
Bitcoin Son Dakika
Btrst Coin Yorum
Prom Coin Yorum
Req Coin Yorum
Bitcoin Forum
Oxt Coin Yorum
BTC Yorum
7D033
ReplyDeleteFil Coin Yorum
BTC Yorum
Arb Coin Yorum
Rndr Coin Yorum
BTC Son Dakika
Lazio Coin Yorum
Hbar Coin Yorum
Nmr Coin Yorum
Rlc Coin Yorum
glassagram
ReplyDeleteallsmo
instagram gizli hesap görme
revelio
bestwhozi
8VO