Subject Re: setting column delimiters for iSql
Author Marvin
--- In firebird-support@yahoogroups.com, "Adam" <s3057043@...> wrote:
>
> --- In firebird-support@yahoogroups.com, "Marvin" <gallagher_98@>
> wrote:
> >
> > Hi guys,
> >
> > I'm trying to write an extraction shell script that will be crontabbed
> > in a unix box. At certain days, it will extract out some data and save
> > them as a file via firebird's iSql.
> > Here's my problem.
> > Because the files extracted will be input for another program, i'l
> > need to format the search results in such that the columns are
> > seperated by a delimiter.
> >
> > Ex:
> >
> > Currently, querying in iSql will give sth like
> >
> > USERNAME USERID
> > ============================== ==========
> > UAT 02 uat02
> > UAT 03 uat03
> >
> > Say i choose to use a # as my column delimeter, Is there a way i can
> > set iSql to return it as the following instead?
> >
> > #UAT 02#uat02#
> > #UAT 03#uat03#
>
> Not that I am aware, but you could possibly use SET LIST ON;
> This would return
>
> USERNAME UAT 02
> USERID uat02
>
> USERNAME UAT 03
> USERID uat03
>
> etc.
>
> I imagine that would be reasonably easy to parse (data is at character
> 34 onwards). Alternatively it is a reasonably trivial thing for you to
> write your own console application to do what you require.
>
> Adam

Yes i could indeed write a console app to do the job. But just though
i'd look ard for a shell solution since they are easier to maintain.
Thanks for the idea though. Din know iSql could return in lists.

-Marve-