Returns the type SQL for a constant java.sql.Types.
1 sql.unload
<sql.unload
delimiter='delimiter'
decimal-format='decimal-format'
date-format='date-format'
encoding='encoding'
>
<file /> ?
<sql /> ?
</sql.unload>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Adelimiter | string | Separator character of the fields in the output. If not specified, by default it is the '|'. | |||
Adecimal-format | string | Format of the value of decimal type. | |||
Adate-format | string | Format of the date type value. | |||
Aencoding | string | OS encoding | Indicate the coding of characters of the downloaded data. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Efile | file | File where the data will be written. | |||
Esql | sql.toResultSet | SQL sentence which you want to download. |
Exceptions
requires 1 arguments, received: [...]
An incorrect number of arguments has been specified.
Example
Download the invoices (document, currency desmon) with the name of the currency.
Copy
<xsql-script name='sqlunload_sample1'> <body> <sql.unload> <file name='export.unl' type='absolute' /> <sql.toResultSet> <select> <columns> docser, currency, desmon </columns> <from table='gcomfach'> <join table='ccurrency'> <on>gcomfach.currency = ccurrency.code</on> </join> </from> </select> </sql.toResultSet> </sql.unload> <file.in.open id='in1'><file name='export.unl' /></file.in.open> <println><file.in.readAll id='in1' /></println> </body> </xsql-script>
The result of the execution of the example would be the following:
Copy
FC-000207|EUR|EUROS| FC-000148|EUR|EUROS| FC-000189|EUR|EUROS| FC-000185|EUR|EUROS| FC-000205|EUR|EUROS| FC-000206|EUR|EUROS| FC-000131|EUR|EUROS| FC-000203|EUR|EUROS| FC-000161|EUR|EUROS| FC-000096|EUR|EUROS| FC-000158|EUR|EUROS| FC-000199|USD|DËLAR USA| FC-000200|EUR|EUROS| FC-000004|PTA|PESETAS| FC99-000001|PTA|PESETAS| FC99-000002|PTA|PESETAS| FC99-000003|PTA|PESETAS| FC99-000004|PTA|PESETAS| FC99-000005|PTA|PESETAS| FC99-000006|PTA|PESETAS| FC99-000007|PTA|PESETAS| FC99-000008|PTA|PESETAS| FC-000025|EUR|EUROS| FC-000026|PTA|PESETAS| FC-000032|PTA|PESETAS| FC-000188|EUR|EUROS| FC-000069|PTA|PESETAS| FC-000073|PTA|PESETAS| FC-000094|EUR|EUROS| FC-000090|EUR|EUROS| FC-000095|EUR|EUROS| FC-000086|PTA|PESETAS| FC-000132|EUR|EUROS| FC-000106|EUR|EUROS| FC-000108|EUR|EUROS| FC-000109|EUR|EUROS| FC-000150|EUR|EUROS| FC-000154|EUR|EUROS| FC-000162|EUR|EUROS| FC-000163|EUR|EUROS| FC-000164|EUR|EUROS| FC-000165|EUR|EUROS| FC-000129|EUR|EUROS| FC-000144|EUR|EUROS| FC-000149|EUR|EUROS| FC-000089|EUR|EUROS| FC-000107|EUR|EUROS|