This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
dev:sql:functions:retrieve_file [2011/01/26 03:52] els |
dev:sql:functions:retrieve_file [2016/06/28 22:38] (current) |
||
---|---|---|---|
Line 20: | Line 20: | ||
=== datatype === | === datatype === | ||
- | The datatype to be used for retrieving the file’s content. Typically a CLOB or C STRING is used to retrieve ASCII data such as text. | + | The datatype to be used for retrieving the file’s content. Typically a CLOB or STRING is used to retrieve ASCII data such as text. |
Datatypes are specified in textual form, and may be used with or without lengths. If no lengths are specified, then they must be included in the length parameter. If no datatype is specified, then CLOB is presumed. | Datatypes are specified in textual form, and may be used with or without lengths. If no lengths are specified, then they must be included in the length parameter. If no datatype is specified, then CLOB is presumed. | ||
Line 45: | Line 45: | ||
This example retrieves the contents of a single, named file. Note that this example retrieves from the table $OMNIDEX. $OMNIDEX is a virtual table that is always available that contains a single virtual row. It is available for purposes such as these. | This example retrieves the contents of a single, named file. Note that this example retrieves from the table $OMNIDEX. $OMNIDEX is a virtual table that is always available that contains a single virtual row. It is available for purposes such as these. | ||
- | <code sql> | + | <code> |
select $retrieve_file('star.sql', 'c string(4KB)') | select $retrieve_file('star.sql', 'c string(4KB)') | ||
from $OMNIDEX; | from $OMNIDEX; | ||
Line 54: | Line 54: | ||
This example relies on the LIBRARY table containing a FILENAME column. This FILENAME column contains a different filename for each row. This statement will retrieve the contents of each file as each row is retrieved. | This example relies on the LIBRARY table containing a FILENAME column. This FILENAME column contains a different filename for each row. This statement will retrieve the contents of each file as each row is retrieved. | ||
- | <code sql> | + | <code> |
select $retrieve_file(FILENAME, 'c string(4KB)') | select $retrieve_file(FILENAME, 'c string(4KB)') | ||
from LIBRARY; | from LIBRARY; |