260
F
ield
N
ame
F
ield Info
N
ote
A
tt
r
10
[
Ty
pe=
V
a
rWC
ha
r
, S
iz
e=20,
R
equ
ir
ed=
N
o]
Sou
r
ce
A
tt
ri
bute 10 d
i
mens
i
on
A
tt
r
11
[
Ty
pe=
V
a
rWC
ha
r
, S
iz
e=20,
R
equ
ir
ed=
N
o]
Sou
r
ce
A
tt
ri
bute 11 d
i
mens
i
on
A
tt
r
12
[
Ty
pe=
V
a
rWC
ha
r
, S
iz
e=20,
R
equ
ir
ed=
N
o]
Sou
r
ce
A
tt
ri
bute 12 d
i
mens
i
on
A
tt
r
13
[
Ty
pe=
V
a
rWC
ha
r
, S
iz
e=20,
R
equ
ir
ed=
N
o]
Sou
r
ce
A
tt
ri
bute 13 d
i
mens
i
on
A
tt
r
14
[
Ty
pe=
V
a
rWC
ha
r
, S
iz
e=20,
R
equ
ir
ed=
N
o]
Sou
r
ce
A
tt
ri
bute 14 d
i
mens
i
on
Ar
ch
iv
e
ID
[
Ty
pe=
Bi
g
i
nt, S
iz
e=8,
R
equ
ir
ed=
N
o]
If
the
r
e
i
s an a
r
ch
iv
e to be assoc
i
ated then ente
r
the
a
r
ch
iv
e
ID
#
fr
om the data d
ir
ecto
ry
.
A
ssigning Import Integration Script to Import
F
ormats
After the Import Integration script has been created and saved in the script editor, you must add
the script to the Import format just as you would with a regular Import script by clicking the
Add Expression… link and browsing for the script file.
Import Integration Script
Ex
ample
The script that follows is an example of an import integration script that opens a SQL server
source database (sample Northwind database) and writes the data directly into FDM. Notice
that a value of True is assigned to the function if the import was successful. Assign a value of
False to the function if any errors are raised in the script.
-------------------------------------------------------------------
Function SQLIntegration(strLoc, lngCatKey, dblPerKey, strWorkTableName)
‘------------------------------------------------------------------
‘ FDM Integration Import Script:
‘Created By: Admin
‘Date Created: 04/19/2004 2:18:39 PM
‘Purpose: This import integration script connects to the sample
‘ Northwind SQL Server database and imports sample
‘ source data from the Orders table into FDM.
‘-----------------------------------------------------------------
Dim cnSS ‘ADO connection object
Dim strSQL ‘SQL string
Dim rs ‘Source system recordset
Dim rsAppend ‘ FDM recordset
‘Initialize ADO objects
Set cnSS = CreateObject(“ADODB.Connection”)
Set rs = CreateObject(“ADODB.Recordset”)
‘Open FDM work table recordset for appending
Set rsAppend = DW.DataAccess.farsTableAppend(strWorkTableName)
‘Connect to Northwind SQL Server database (our data source)
Dim strConn
strConn=”Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;”
strConn=strConn & “Initial Catalog=Northwind;Data Source=LocalHost;”
cnss.open strConn
188
Scr
i
pt
i
ng