cancel
Showing results for 
Search instead for 
Did you mean: 

Observing a difference between DBISQL vs DBISQLG when using OUTPUT TO

Former Member
2,547

Hi All,

I am observing a difference between DBISQL vs DBISQLG when using an OUTPUT TO statement.

I have a simple .SQL script that uses 'OUTPUT TO' on a 'SELECT' statement (Pls see below).

This .SQL script when read/run from a simple .BAT batch file, with DBISQL, produces unreadable/gibberish characters for ASCII & HTML formats. (XML is OK).

When I change only the DBISQL to DBISQLG, the output is produced with correct characters in all three formats - ASCII, HTML, & XML !!

So, I would like to understand why the output from these two programs (DBISQL & DBISQLG) would differ!!??

My data/database has extended/accented characters.

Here are my .SQL & .BAT files:

myExample.SQL File:

SELECT *
FROM myTable
OUTPUT TO C:\\\\myOutput.{Extension}
FORMAT {Format};

myExample.BAT File:

DBISQL -dataSource myExample -nogui -ODBC -q read myExample.SQL [%1] [%2]

I originally read that DBISQLG is just an alias for DBISQL and they should be the same. But on my machine, the file dates on both files are not identical to each other (i.e. they are off by a few seconds).

My Environment: I am having to use ASA 8.0.2.4272 on a Windows Embedded Standard 2009 OS.

My Data: Characters used are from Windows Code Page 1252 as below: à (Char 224), á (Char 225), á (Char 226), etc..

Any insights are welcome. Thank you in advance.

Tejo

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

I believe the issue is that running the batch file is changing your codepage (charset) so when dbisql[g] is executed it believes that you want the output to be in different character sets.

For example, if you copy your text "à (Char 224), á (Char 225), á (Char 226)" and paste it on your command line like this:

> echo à (Char 224), á (Char 225), á (Char 226)

and execute it you will see the output

à (Char 224), á (Char 225), á (Char 226)

so you got what you wanted. But if you create a batch file (say foo.bat) and put the same command into the file:

echo à (Char 224), á (Char 225), á (Char 226)

and then run foo.bat

> foo.bat

then you may get something completely different. When I run foo.bat I get this:

echo  α (Char 224), ß (Char 225), ß (Char 226)
α (Char 224), ß (Char 225), ß (Char 226)

The reason is that the batch file is executed using a different codepage (i.e. character set).

One solution is to explicit state the client charset that you want to use using the -c "...;charset=cp1252;..."

HTH

BTW: You were told correctly, dbisqlg.exe and dbisql.exe are identical in functionality. The only difference is that one is compiled/linked as a windows console application and the other is not.

Former Member
0 Kudos

Thanks Mark for your prompt response.

Will try the pointer about explicitly specifying the CharSet.

You have a fantastic day.

Answers (0)