This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:sql:functions:retrieve_file [2011/01/26 03:07] els |
dev:sql:functions:retrieve_file [2011/01/26 03:52] els |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ~~NOTOC~~ | ||
{{page>:top_add&nofooter&noeditbtn}} | {{page>:top_add&nofooter&noeditbtn}} | ||
====== Development: Omnidex SQL ====== | ====== Development: Omnidex SQL ====== | ||
Line 39: | Line 40: | ||
Parse the keywords from the text and discard all whitespace and punctuation. | Parse the keywords from the text and discard all whitespace and punctuation. | ||
- | ==== Example ==== | + | ==== Examples ==== |
- | === Example 1 === | + | === Example 1: Retrieving from a named file === |
+ | |||
+ | 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> | ||
+ | select $retrieve_file('star.sql', 'c string(4KB)') | ||
+ | from $OMNIDEX; | ||
+ | </code> | ||
+ | |||
+ | === Example 1: Retrieving from a named file === | ||
+ | |||
+ | 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> | ||
+ | select $retrieve_file(FILENAME, 'c string(4KB)') | ||
+ | from LIBRARY; | ||
+ | </code> | ||
+ | |||
{{page>:bottom_add&nofooter&noeditbtn}} | {{page>:bottom_add&nofooter&noeditbtn}} |