Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dev:sql:functions:retrieve_file [2011/01/25 23:57]
els created
dev:sql:functions:retrieve_file [2016/06/28 22:38] (current)
Line 1: Line 1:
 +~~NOTOC~~
 {{page>:​top_add&​nofooter&​noeditbtn}} {{page>:​top_add&​nofooter&​noeditbtn}}
 ====== Development:​ Omnidex SQL ====== ====== Development:​ Omnidex SQL ======
Line 19: Line 20:
 === datatype === === datatype ===
  
-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. +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 27: Line 28:
 The length to be used for retrieving the file’s content. ​ Lengths may also be specified in the datatype parameter using the standard Omnidex syntax. ​ If no length is provided in either place, the length defaults to 64KB. The length to be used for retrieving the file’s content. ​ Lengths may also be specified in the datatype parameter using the standard Omnidex syntax. ​ If no length is provided in either place, the length defaults to 64KB.
  
-=== options === The options to be applied to retrieving this file.  ​+=== options ===
  
-== EXTRACT_TEXT ==+The options to be applied to retrieving this file.  ​
  
-Once HTML and XML are supported, this option will extract the text from the file, rather than returning the exact contents of the file. +== STOPWORDS ==
- +
-== AUTO_EXTENSION == +
- +
-If the passed filename does not exist, and if the passed filename does not contain an extension, and if a single file exists with this name plus an extension, the open that file.  This option allows filenames to be included without an extension as long as only one file is possible. +
- +
-== STOPWORDS ​==+
  
 Use the STOPWORDS list identified by this option. Use the STOPWORDS list identified by this option.
Line 45: 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>​ 
 +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>​ 
 +select ​       $retrieve_file(FILENAME,​ 'c string(4KB)'​) 
 +  from        LIBRARY; 
 +</​code>​ 
 + 
 {{page>:​bottom_add&​nofooter&​noeditbtn}} {{page>:​bottom_add&​nofooter&​noeditbtn}}
 
Back to top
dev/sql/functions/retrieve_file.1295999837.txt.gz · Last modified: 2016/06/28 22:38 (external edit)