Hi Peter,
No Split function...but it's a nice idea.
You can use a table procedure to break the column into its components....
create procedure tp_split_on_comma(
string varchar(256) not null not default
)
result row my_row(element char(256) not null not default)
as declare
n integer not null not default;
len integer not null not default;
code_element varchar(256) not null not default;
begin
while (1 > 0)
do
n=position(',' in :string);
if (:n = 0) then
return row (:string);
endloop;
endif;
code_element=substring(string from 1 for :n - 1);
return row (:code_element);
len = length(:string);
string = right(string, len - n);
endwhile;
end;
select element from tp_split_on_comma('asdf, 12,foxtrot, alpha, romeo');
Executing . . .
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|element |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|asdf |
| 12 |
|foxtrot |
| alpha |
| romeo |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
You can munge that procedure easily enough to accept an index number to get specific about which one you want.
Marty
_______________________________________________
Info-Ingres mailing list
Info-...@kettleriverconsulting.com
http://ext-cando.kettleriverconsulting.com/mailman/listinfo/info-ingres