SET

You can use the SET command to set the value of a variable equal to an expression.

Syntax:

SET @variablename = expression

Like:

SET @var1 = 5+5 
SET @var1 = 5+(20*3)
SET @var2 = @var1+50

An important feature of variables is that they can be used inside the SQL of IMPORT statements. When the import statement uses an TARGITDB type datasource, a single Declare and Set can be made at the beginning of the .imp file, otherwise a variable to be used in a query from an external source must be declared and set within the IMPORT brackets.

Example:

DATASOURCE Source1 = ODBC 'odbc_connection_X' 
IMPORT orders = source1.orders
/* Say we want to create another order table with a specific subset of items only... */
IMPORT orders_some_only = ME.
{
DECLARE @cSupp1 AS STRING
SET @cSupp1 = “Smiths Sweets Inc.”
SELECT * FROM ORDERS AS o1 WHERE o1.Supplier = @cSupp AND o1.Office = @param1
/* Notice we did not have to declare @param1 since it is a system function, in this case created when we called the ‘mysample2.imp’ import script */
}


From the Supported Cultures page, you can find the Culture Value you wish to use.

Syntax:

SET CULTURE 'value'

Example:

SET CULTURE 'en-US' 
IMPORT datetable= me.{select SAFECAST ('09/01/2010' as DATETIME ) as thedate}

 

Supported Cultures

The CultureInfo class specifies a unique name for each culture, based on RFC 4646 (Windows Vista and
later). The name is a combination of an ISO 639 two-letter lowercase culture code associated with a
language and an ISO 3166 two-letter uppercase subculture code associated with a country or region.

Country

Two Letter Country Code

Three Letter Country Code

Language

Two Letter Lang Code

Three Letter Lang Code

CultureInfo Code

Afghanistan

AF

AFG

Pashto

ps

pus

ps-AF

Afghanistan

AF

AFG

Dari

prs

prs

prs-AF

Albania

AL

ALB

Albanian

sq

sqi

sq-AL

Algeria

DZ

DZA

Arabic

ar

ara

ar-DZ

Argentina

AR

ARG

Spanish

es

spa

es-AR

Armenia

AM

ARM

Armenian

hy

hye

hy-AM

Australia

AU

AUS

English

en

eng

en-AU

Austria

AT

AUT

German

de

deu

de-AT

Bahrain

BH

BHR

Arabic

ar

ara

ar-BH

Bangladesh

BD

BGD

Bengali

bn

bng

bn-BD

Basque

ES

ESP

Basque

eu

eus

eu-ES

Belarus

BY

BLR

Belarusian

be

bel

be-BY

Belgium

BE

BEL

French

fr

fra

fr-BE

Belgium

BE

BEL

Dutch

nl

nld

nl-BE

Belize

BZ

BLZ

English

en

eng

en-BZ

Bolivarian Republic of Venezuela

VE

VEN

Spanish

es

spa

es-VE

Bolivia

BO

BOL

Quechua

quz

qub

quz-BO

Bolivia

BO

BOL

Spanish

es

spa

es-BO

Brazil

BR

BRA

Portuguese

pt

por

pt-BR

Brunei Darussalam

BN

BRN

Malay

ms

msa

ms-BN

Bulgaria

BG

BGR

Bulgarian

bg

bul

bg-BG

Cambodia

KH

KHM

Khmer

km

khm

km-KH

Canada

CA

CAN

French

fr

fra

fr-CA

Canada

CA

CAN

English

en

eng

en-CA

Caribbean

29

29

English

en

eng

en-029

Catalan

ES

ESP

Catalan

ca

cat

ca-ES

Chile

CL

CHL

Mapudungun

arn

arn

arn-CL

Chile

CL

CHL

Spanish

es

spa

es-CL

Colombia

CO

COL

Spanish

es

spa

es-CO

Costa Rica

CR

CRI

Spanish

es

spa

es-CR

Croatia

HR

HRV

Croatian

hr

hrv

hr-HR

Cyrillic, Azerbaijan

AZ

AZE

Azeri

az

aze

az-Cyrl-AZ

Cyrillic, Bosnia and Herzegovina

BA

BIH

Serbian

sr

srn

sr-Cyrl-BA

Cyrillic, Bosnia and Herzegovina

BA

BIH

Bosnian

bs

bsc

bs-Cyrl-BA

Cyrillic, Mongolia

MN

MNG

Mongolian

mn

mon

mn-MN

Cyrillic, Montenegro

ME

MNE

Serbian

sr

srp

sr-Cyrl-ME

Cyrillic, Serbia

RS

SRB

Serbian

sr

srp

sr-Cyrl-RS

Cyrillic, Serbia and Montenegro

CS

SCG

Serbian

sr

srp

sr-Cyrl-CS

Cyrillic, Tajikistan

TJ

TAJ

Tajik

tg

tgk

tg-Cyrl-TJ

Cyrillic, Uzbekistan

UZ

UZB

Uzbek

uz

uzb

uz-Cyrl-UZ

Czech Republic

CZ

CZE

Czech

cs

ces

cs-CZ

Denmark

DK

DNK

Danish

da

dan

da-DK

Dominican Republic

DO

DOM

Spanish

es

spa

es-DO

Ecuador

EC

ECU

Quechua

quz

que

quz-EC

Ecuador

EC

ECU

Spanish

es

spa

es-EC

Egypt

EG

EGY

Arabic

ar

ara

ar-EG

El Salvador

SV

SLV

Spanish

es

spa

es-SV

Estonia

EE

EST

Estonian

et

est

et-EE

Ethiopia

ET

ETH

Amharic

am

amh

am-ET

Faroe Islands

FO

FRO

Faroese

fo

fao

fo-FO

Finland

FI

FIN

Finnish

fi

fin

fi-FI

Finland

FI

FIN

Swedish

sv

swe

sv-FI

Finland

FI

FIN

Sami, Northern

se

smg

se-FI

Finland

FI

FIN

Sami, Skolt

sms

sms

sms-FI

Finland

FI

FIN

Sami, Inari

smn

smn

smn-FI

Fmr. Yugoslav Rep.of Macedonia

MK

MKD

Macedonian

mk

mkd

mk-MK

France

FR

FRA

French

fr

fra

fr-FR

France

FR

FRA

Breton

br

bre

br-FR

France

FR

FRA

Occitan

oc

oci

oc-FR

France

FR

FRA

Corsican

co

cos

co-FR

France

FR

FRA

Alsatian

gsw

gsw

gsw-FR

Galician

ES

ESP

Galician

gl

glg

gl-ES

Georgia

GE

GEO

Georgian

ka

kat

ka-GE

Germany

DE

DEU

German

de

deu

de-DE

Germany

DE

DEU

Upper Sorbian

hsb

hsb

hsb-DE

Germany

DE

DEU

Lower Sorbian

dsb

dsb

dsb-DE

Greece

GR

GRC

Greek

el

ell

el-GR

Greenland

GL

GRL

Greenlandic

kl

kal

kl-GL

Guatemala

GT

GTM

K'iche

qut

qut

qut-GT

Guatemala

GT

GTM

Spanish

es

spa

es-GT

Honduras

HN

HND

Spanish

es

spa

es-HN

Hungary

HU

HUN

Hungarian

hu

hun

hu-HU

Iceland

IS

ISL

Icelandic

is

isl

is-IS

India

IN

IND

Hindi

hi

hin

hi-IN

India

IN

IND

Bengali

bn

bng

bn-IN

India

IN

IND

Punjabi

pa

pan

pa-IN

India

IN

IND

Gujarati

gu

guj

gu-IN

India

IN

IND

Oriya

or

ori

or-IN

India

IN

IND

Tamil

ta

tam

ta-IN

India

IN

IND

Telugu

te

tel

te-IN

India

IN

IND

Kannada

kn

kan

kn-IN

India

IN

IND

Malayalam

ml

mym

ml-IN

India

IN

IND

Assamese

as

asm

as-IN

India

IN

IND

Marathi

mr

mar

mr-IN

India

IN

IND

Sanskrit

sa

san

sa-IN

India

IN

IND

Konkani

kok

kok

kok-IN

India

IN

IND

English

en

eng

en-IN

Indonesia

ID

IDN

Indonesian

id

ind

id-ID

Iran

IR

IRN

Persian

fa

fas

fa-IR

Iraq

IQ

IRQ

Arabic

ar

ara

ar-IQ

Ireland

IE

IRL

Irish

ga

gle

ga-IE

Ireland

IE

IRL

English

en

eng

en-IE

Islamic Republic of Pakistan

PK

PAK

Urdu

ur

urd

ur-PK

Israel

IL

ISR

Hebrew

he

heb

he-IL

Italy

IT

ITA

Italian

it

ita

it-IT

Jamaica

JM

JAM

English

en

eng

en-JM

Japan

JP

JPN

Japanese

ja

jpn

ja-JP

Jordan

JO

JOR

Arabic

ar

ara

ar-JO

Kazakhstan

KZ

KAZ

Kazakh

kk

kaz

kk-KZ

Kenya

KE

KEN

Kiswahili

sw

swa

sw-KE

Korea

KR

KOR

Korean

ko

kor

ko-KR

Kuwait

KW

KWT

Arabic

ar

ara

ar-KW

Kyrgyzstan

KG

KGZ

Kyrgyz

ky

kir

ky-KG

Lao P.D.R.

LA

LAO

Lao

lo

lao

lo-LA

Latin, Algeria

DZ

DZA

Tamazight

tzm

tzm

tzm-Latn-DZ

Latin, Azerbaijan

AZ

AZE

Azeri

az

aze

az-Latn-AZ

Latin, Bosnia and Herzegovina

BA

BIH

Croatian

hr

hrb

hr-BA

Latin, Bosnia and Herzegovina

BA

BIH

Bosnian

bs

bsb

bs-Latn-BA

Latin, Bosnia and Herzegovina

BA

BIH

Serbian

sr

srs

sr-Latn-BA

Latin, Canada

CA

CAN

Inuktitut

iu

iku

iu-Latn-CA

Latin, Montenegro

ME

MNE

Serbian

sr

srp

sr-Latn-ME

Latin, Nigeria

NG

NGA

Hausa

ha

hau

ha-Latn-NG

Latin, Serbia

RS

SRB

Serbian

sr

srp

sr-Latn-RS

Latin, Serbia and Montenegro

CS

SCG

Serbian

sr

srp

sr-Latn-CS

Latin, Uzbekistan

UZ

UZB

Uzbek

uz

uzb

uz-Latn-UZ

Latvia

LV

LVA

Latvian

lv

lav

lv-LV

Lebanon

LB

LBN

Arabic

ar

ara

ar-LB

Libya

LY

LBY

Arabic

ar

ara

ar-LY

Liechtenstein

LI

LIE

German

de

deu

de-LI

Lithuania

LT

LTU

Lithuanian

lt

lit

lt-LT

Luxembourg

LU

LUX

Luxembourgish

lb

ltz

lb-LU

Luxembourg

LU

LUX

German

de

deu

de-LU

Luxembourg

LU

LUX

French

fr

fra

fr-LU

Malaysia

MY

MYS

Malay

ms

msa

ms-MY

Malaysia

MY

MYS

English

en

eng

en-MY

Maldives

MV

MDV

Divehi

dv

div

dv-MV

Malta

MT

MLT

Maltese

mt

mlt

mt-MT

Mexico

MX

MEX

Spanish

es

spa

es-MX

Mohawk

CA

CAN

Mohawk

moh

moh

moh-CA

Monaco

MC

MCO

French

fr

fra

fr-MC

Morocco

MA

MAR

Arabic

ar

ara

ar-MA

Nepal

NP

NPL

Nepali

ne

nep

ne-NP

Netherlands

NL

NLD

Dutch

nl

nld

nl-NL

Netherlands

NL

NLD

Frisian

fy

fry

fy-NL

New Zealand

NZ

NZL

Maori

mi

mri

mi-NZ

New Zealand

NZ

NZL

English

en

eng

en-NZ

Nicaragua

NI

NIC

Spanish

es

spa

es-NI

Nigeria

NG

NGA

Yoruba

yo

yor

yo-NG

Nigeria

NG

NGA

Igbo

ig

ibo

ig-NG

Norway

NO

NOR

Norwegian, Bokmål

nb

nob

nb-NO

Norway

NO

NOR

Sami, Northern

se

sme

se-NO

Norway

NO

NOR

Norwegian, Nynorsk

nn

nno

nn-NO

Norway

NO

NOR

Sami, Lule

smj

smj

smj-NO

Norway

NO

NOR

Sami, Southern

sma

sma

sma-NO

Oman

OM

OMN

Arabic

ar

ara

ar-OM

Panama

PA

PAN

Spanish

es

spa

es-PA

Paraguay

PY

PRY

Spanish

es

spa

es-PY

Peru

PE

PER

Quechua

quz

qup

quz-PE

Peru

PE

PER

Spanish

es

spa

es-PE

Philippines

PH

PHL

Filipino

fil

fil

fil-PH

Poland

PL

POL

Polish

pl

pol

pl-PL

Portugal

PT

PRT

Portuguese

pt

por

pt-PT

PRC

CN

CHN

Tibetan

bo

bod

bo-CN

PRC

CN

CHN

Yi

ii

iii

ii-CN

PRC

CN

CHN

Uyghur

ug

uig

ug-CN

Puerto Rico

PR

PRI

Spanish

es

spa

es-PR

Qatar

QA

QAT

Arabic

ar

ara

ar-QA

Republic of the Philippines

PH

PHL

English

en

eng

en-PH

Romania

RO

ROU

Romanian

ro

ron

ro-RO

Russia

RU

RUS

Russian

ru

rus

ru-RU

Russia

RU

RUS

Tatar

tt

tat

tt-RU

Russia

RU

RUS

Bashkir

ba

bak

ba-RU

Russia

RU

RUS

Yakut

sah

sah

sah-RU

Rwanda

RW

RWA

Kinyarwanda

rw

kin

rw-RW

Saudi Arabia

SA

SAU

Arabic

ar

ara

ar-SA

Senegal

SN

SEN

Wolof

wo

wol

wo-SN

Simplified, PRC

CN

CHN

Chinese

zh

zho

zh-CN

Simplified, Singapore

SG

SGP

Chinese

zh

zho

zh-SG

Singapore

SG

SGP

English

en

eng

en-SG

Slovakia

SK

SVK

Slovak

sk

slk

sk-SK

Slovenia

SI

SVN

Slovenian

sl

slv

sl-SI

South Africa

ZA

ZAF

Setswana

tn

tsn

tn-ZA

South Africa

ZA

ZAF

isiXhosa

xh

xho

xh-ZA

South Africa

ZA

ZAF

isiZulu

zu

zul

zu-ZA

South Africa

ZA

ZAF

Afrikaans

af

afr

af-ZA

South Africa

ZA

ZAF

Sesotho sa Leboa

nso

nso

nso-ZA

South Africa

ZA

ZAF

English

en

eng

en-ZA

Spain, International Sort

ES

ESP

Spanish

es

spa

es-ES

Sri Lanka

LK

LKA

Sinhala

si

sin

si-LK

Sweden

SE

SWE

Swedish

sv

swe

sv-SE

Sweden

SE

SWE

Sami, Northern

se

smf

se-SE

Sweden

SE

SWE

Sami, Lule

smj

smk

smj-SE

Sweden

SE

SWE

Sami, Southern

sma

smb

sma-SE

Switzerland

CH

CHE

Romansh

rm

roh

rm-CH

Switzerland

CH

CHE

German

de

deu

de-CH

Switzerland

CH

CHE

Italian

it

ita

it-CH

Switzerland

CH

CHE

French

fr

fra

fr-CH

Syllabics, Canada

CA

CAN

Inuktitut

iu

iku

iu-Cans-CA

Syria

SY

SYR

Syriac

syr

syr

syr-SY

Syria

SY

SYR

Arabic

ar

ara

ar-SY

Thailand

TH

THA

Thai

th

tha

th-TH

Traditional Mongolian, PRC

CN

CHN

Mongolian

mn

mon

mn-Mong-CN

Traditional, Hong Kong S.A.R.

HK

HKG

Chinese

zh

zho

zh-HK

Traditional, Macao S.A.R.

MO

MAC

Chinese

zh

zho

zh-MO

Traditional, Taiwan

TW

TWN

Chinese

zh

zho

zh-TW

Trinidad and Tobago

TT

TTO

English

en

eng

en-TT

Tunisia

TN

TUN

Arabic

ar

ara

ar-TN

Turkey

TR

TUR

Turkish

tr

tur

tr-TR

Turkmenistan

TM

TKM

Turkmen

tk

tuk

tk-TM

U.A.E.

AE

ARE

Arabic

ar

ara

ar-AE

Ukraine

UA

UKR

Ukrainian

uk

ukr

uk-UA

United Kingdom

GB

GBR

Welsh

cy

cym

cy-GB

United Kingdom

GB

GBR

Scottish Gaelic

gd

gla

gd-GB

United Kingdom

GB

GBR

English

en

eng

en-GB

United States

US

USA

English

en

eng

en-US

United States

US

USA

Spanish

es

spa

es-US

Uruguay

UY

URY

Spanish

es

spa

es-UY

Vietnam

VN

VNM

Vietnamese

vi

vie

vi-VN

Yemen

YE

YEM

Arabic

ar

ara

ar-YE

Zimbabwe

ZW

ZWE

English

en

eng

en-ZW

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.