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

asked 15 Nov '16, 15:03

Tejo's gravatar image

Tejo
015
accept rate: 0%

edited 15 Nov '16, 15:06


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.

permanent link

answered 15 Nov '16, 15:59

Mark%20Culp's gravatar image

Mark Culp
23.0k9130270
accept rate: 40%

edited 15 Nov '16, 16:01

Thanks Mark for your prompt response.

Will try the pointer about explicitly specifying the CharSet.

You have a fantastic day.

(16 Nov '16, 12:16) Tejo
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×78
×25
×19
×10
×4

question asked: 15 Nov '16, 15:03

question was seen: 222 times

last updated: 16 Nov '16, 12:16