afs_db_load - AFS - Reference Guides

AFS Filters Description

Product
AFS
Platform
7.11
Category
Reference Guides
Language
English

The Databases Load filter is a generator filter which extracts information from an ODBC compliant database and transforms it to an XML format.

The filter is declared with the afs_db_load type. It is in the antidot-paf package. It is a generator filter.

The Databases Load filter specifications are described in the following table:

Parameter name

Mandatory

Type

Default

Description

dsn

Yes

string

N/A

Data Source Name, the configuration of the connection made with ODBC.

login

No

string

N/A

Login to the database.

password

No

string

N/A

Password associated to the login.

query

Yes

string

N/A

Query to be executed.

output_layer

No

layer

CONTENTS

It is the output layer.

urn_namespace_identifier

No

string

afs

The urn namespace identifier to use in document uri.

Note: AFS use the iODBC connector, you can provide all drivers which are compatible with iODBC. For more information about ODBC and iODBC, see ODBC (http://en.wikipedia.org/wiki/Odbc) and iODBC (http://en.wikipedia.org/wiki/Iodbc).
The filter generates document with uri: "urn:afs:<uuid>" (the "afs" part can be modified with the urn_namespace_identifier parameter). Example: If we suppose a "person" database with column "id", "firstname", "lastname", "age", "birthday" and the query "select * from person", you will generate one document for one row in "person", and the XML will look like:
<?xml version="1.0"?>
<afsdb:row xmlns:afsdb="http://ref.antidot.net/v7/afsdb#">
    <afsdb:column name="id" type="integer">126</afsdb:column>
    <afsdb:column name="firstname" type="varchar">Mark</afsdb:column>
    <afsdb:column name="lastname" type="varchar">Knopfler</afsdb:column>
    <afsdb:column name="age" type="tinyint">62</afsdb:column>
    <afsdb:column name="birthday" type="date">1949-08-12</afsdb:column>
</afsdb:row>
Attention: This filter must be the first filter in a Pipe. This filter will never process input documents.

None