SqlDbx Forum

SqlDbx

You are not logged in.

#1 2011-09-23 17:24:16

stephann
Member

Export as .csv with no delimiters truncates columns

I'm a new user of SqlDbx Personal version 3.50.  I'm extracting data from a Sybase ASE 12.5 database, using a SQL view and SELECT statement.

The columns in the view are either varchar or char datatype.  When I created the view I instructed it to pad the columns with spaces, like this:

SELECT
    left(i.ibarcode+space(25),25) as                        --left 25 chars of a field pad w/25 spaces
'ibarcode_field_01',
    convert(char(10),dateadd(dd,i.last_cko_date,'1 jan 1970'),102) as
'cko_date_field_03'

... etc.

The problem comes when I attempt to create a file with no delimiters (in SqlDbx, Tools > Options > Import/Export, I have removed the ',' from Field Delimiter and have None selected for Literal and Date quote).

In the query tool that came with Sybase (SQL Advantage), the results would appear like this (using pipes to indicate where the delimiters would be, and periods to indicate where the spaces should be, for the purposes of illustration):
|33690000013127...........|2011.05.1614:26|

Using SqlDbx, the results appear like this (again using pipes to indicate where the break in columns would be):
|33690000013127|2011.05.1614:26|

I dislike SQL Advantage, and we're moving to Oracle soon, so I wanted something that could query both databases.  I found SqlDbx and I was instantly in love.  But I'm concerned that it appears to be stripping trailing spaces out of my results.

Offline

#2 2011-09-23 19:13:39

sqldbxhelp
Administrator

Re: Export as .csv with no delimiters truncates columns

This is a bug which was introduced in one of the previous versions. We will address it in a next release.
Please note that behavior is still will be different for CHAR and VARCHAR columns. CHAR columns always right trimmed and VARCHAR never right trimmed.
So for you query to work correctly you will need to do something like this
SELECT cast (left (i.ibarcode+space(25),25) as VARCHAR(25))

Offline

#3 2011-10-05 17:52:56

stephann
Member

Re: Export as .csv with no delimiters truncates columns

Thanks for the info and advice!

Offline

Board footer

Powered by FluxBB