David Mitchell wrote:
> I wanted to use Varchar data via ODBC on Windows and Access.  ddfet
> returns the variable length data as a boxed vector, but is too slow to
> be useful with large databases.  ddfch returns Varchar data as Cx255
> matrix, efficient and fast, but not the form the data is stored in.
> 
> Attached is a modified ddfchvc that returns two columns for each Varchar
> column. The first is the Cx255 text matrix.  The second is the Cx1 list
> of lengths for each Varchar row.  This allows the original data to be
> reconstructed while preserving the general result format of ddfch.  The
> performance is comparable with ddfch, since the list of lengths must be
> created in either verb. The reconstruction of the variable length data
> as a vector of enclosed vectors can be done with something like:
> 

I usually trim padding space if needed, but your idea sounds useful and
efficient. A less efficient but simplier approach is just replacing the line
(code not tested)
NB.     z=. z,< n
    if. _3 12 e.~ 6{i_index{ci do.
     z=. z,< (0>.len) <@{.("0 1) n
    else.
     z=. z,< n
    end.


-- 
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to