Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 7 of 7 total
Thread Exporting booleans
Sat, Apr 22 2006 10:08 AMPermanent Link

"Malcolm"
Hi

Just want to make sure I am not missing something.

I need to export rows to a csv file .. but with booleans as
0/1 rather than FALSE/TRUE.

I don't see such a switch in either SQL EXPORT or
TDBISAMTable Export (V4).

Am I stuck with having either to roll my own or
post-process the .csv file? Surprised

Malcolm

--
Sat, Apr 22 2006 11:51 AMPermanent Link

"Robert"

"Malcolm" <malcolm@spam.will.bounce> wrote in message
news:7220B29D-B46B-433F-AE4C-F5D777FA72FF@news.elevatesoft.com...
> Hi
>
> Just want to make sure I am not missing something.
>
> I need to export rows to a csv file .. but with booleans as
> 0/1 rather than FALSE/TRUE.
>

select cast(if(field = true then 1 else 0) as integer) as myboolean from
table

should set the query the way you want to.

Robert

Sat, Apr 22 2006 5:42 PMPermanent Link

"Malcolm"
Robert wrote <<
  
  select cast(if(field = true then 1 else 0) as integer) as
  myboolean from table
  
  should set the query the way you want to.
  
  Robert
>>

Hi Robert

I would certainly take that approach if selecting a few
records and fields .. but for dumping all fields, of which
quite a few are booleans, I was hoping for a less 'wordy'
way.

I may just do the dump, then run a string replace on it.
It's a pity for me that Tim has not included a boolean
format option in the export methods.  Surprised

Malcolm

--
Sat, Apr 22 2006 6:29 PMPermanent Link

"Ralf Mimoun"
Malcolm wrote:
....
> I would certainly take that approach if selecting a few
> records and fields .. but for dumping all fields, of which
> quite a few are booleans, I was hoping for a less 'wordy'
> way.

Scalabiums SMExport will do the job.

Ralf
Sun, Apr 23 2006 8:36 AMPermanent Link

"Malcolm"
Ralf Mimoun wrote <<

  Malcolm wrote:
  ...
     I would certainly take that approach if selecting a
few
     records and fields .. but for dumping all fields, of
     which quite a few are booleans, I was hoping for a
less
     'wordy' way.
  
  Scalabiums SMExport will do the job.
  
  Ralf
>>

Hi Ralf

Ta.  I will look at that. Currently using AnsiReplaceText()
on the output which is OK for small sets.

--
Mon, Apr 24 2006 9:24 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Malcolm,

<< Am I stuck with having either to roll my own or post-process the .csv
file? Surprised >>

I'm afraid so, at least for now.

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Apr 25 2006 4:05 AMPermanent Link

"Malcolm"
Tim Young [Elevate Software] wrote <<
  
  I'm afraid so, at least for now.
>>

Thanks Tim.  

Not holding breath .. but I thought I might have detected a
glimmer of hope.  Surprised

Malcolm

--
Image