pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedQuery with hexadecimal characters
7+ messages / 5 participants
[nested] [flat]
* Query with hexadecimal characters
@ 2005-01-10 22:10 Luciano <ldelio@yahoo.com>
2005-01-10 23:05 ` Re: Query with hexadecimal characters Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 7+ messages in thread
From: Luciano @ 2005-01-10 22:10 UTC (permalink / raw)
To: pgsql-odbc
Hello!
I am having a problem doing a query with hexadecimal
characters through ODBC. The hexadecimal characters
are inside a character filed. It would be something
like:
SELECT * FROM MYTABLE WHERE COLUMN1 < 'XXXXXX'
but instead of the X's there are x'FF' characters...
The query is accepted, but the result is not
consistent... it returns an empty result set. Does
anyone know if I'm missing something?
Thanks in advance!
Luciano
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query with hexadecimal characters
2005-01-10 22:10 Query with hexadecimal characters Luciano <ldelio@yahoo.com>
@ 2005-01-10 23:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-01-11 02:36 ` Re: Query with hexadecimal characters Luciano <ldelio@yahoo.com>
0 siblings, 1 reply; 7+ messages in thread
From: Tom Lane @ 2005-01-10 23:05 UTC (permalink / raw)
To: Luciano <ldelio@yahoo.com>; +Cc: pgsql-odbc
Luciano <ldelio@yahoo.com> writes:
> I am having a problem doing a query with hexadecimal
> characters through ODBC. The hexadecimal characters
> are inside a character filed. It would be something
> like:
> SELECT * FROM MYTABLE WHERE COLUMN1 < 'XXXXXX'
> but instead of the X's there are x'FF' characters...
> The query is accepted, but the result is not
> consistent... it returns an empty result set. Does
> anyone know if I'm missing something?
I suspect you are spitting byte sequences at the backend that are
illegal in the character set encoding you've selected. Check your
locale and database encoding setup. C/SQL_ASCII is the best bet
if you want to pretend that you can store any random byte sequence
in a character field.
Plan B, which would probably be better in the long run, is to store
that data in a bytea field instead, and send escaped characters
(ie \\377 rather than an actual FF byte).
regards, tom lane
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query with hexadecimal characters
2005-01-10 22:10 Query with hexadecimal characters Luciano <ldelio@yahoo.com>
2005-01-10 23:05 ` Re: Query with hexadecimal characters Tom Lane <tgl@sss.pgh.pa.us>
@ 2005-01-11 02:36 ` Luciano <ldelio@yahoo.com>
0 siblings, 0 replies; 7+ messages in thread
From: Luciano @ 2005-01-11 02:36 UTC (permalink / raw)
To: pgsql-odbc
Eric and Tom: thank you very much for your help, I
will try your suggestions tomorrow at work.
The sql statements are issued from a COBOL program,
which can also issue the same statements to other
databases (MySQL, MS SQLServer), so the first thing Im
going to do is trying to change the encoding setup,
which would be the most homogeneous solution that
wouldn't interfere with the other databases, that
currently handle well those strings with hexadecimal
data.
Thank u very much again!
Luciano.
--- Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Luciano <ldelio@yahoo.com> writes:
> > I am having a problem doing a query with
> hexadecimal
> > characters through ODBC. The hexadecimal
> characters
> > are inside a character filed. It would be
> something
> > like:
>
> > SELECT * FROM MYTABLE WHERE COLUMN1 < 'XXXXXX'
>
> > but instead of the X's there are x'FF'
> characters...
> > The query is accepted, but the result is not
> > consistent... it returns an empty result set. Does
> > anyone know if I'm missing something?
>
> I suspect you are spitting byte sequences at the
> backend that are
> illegal in the character set encoding you've
> selected. Check your
> locale and database encoding setup. C/SQL_ASCII is
> the best bet
> if you want to pretend that you can store any random
> byte sequence
> in a character field.
>
> Plan B, which would probably be better in the long
> run, is to store
> that data in a bytea field instead, and send escaped
> characters
> (ie \\377 rather than an actual FF byte).
>
> regards, tom lane
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query with hexadecimal characters
@ 2005-01-12 15:33 Merlin Moncure <merlin.moncure@rcsonline.com>
2005-01-12 15:53 ` Re: Query with hexadecimal characters James M Doherty PGADMIN <jimmyd@jdoherty.net>
2005-01-13 22:50 ` Re: Query with hexadecimal characters Luciano <ldelio@yahoo.com>
0 siblings, 2 replies; 7+ messages in thread
From: Merlin Moncure @ 2005-01-12 15:33 UTC (permalink / raw)
To: Luciano <ldelio@yahoo.com>; +Cc: pgsql-odbc
> Eric and Tom: thank you very much for your help, I
> will try your suggestions tomorrow at work.
> The sql statements are issued from a COBOL program,
> which can also issue the same statements to other
> databases (MySQL, MS SQLServer), so the first thing Im
> going to do is trying to change the encoding setup,
> which would be the most homogeneous solution that
> wouldn't interfere with the other databases, that
> currently handle well those strings with hexadecimal
> data.
>
> Thank u very much again!
> Luciano.
Just curious: what COBOL vendor/compiler are you using?
Merlin
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query with hexadecimal characters
2005-01-12 15:33 Re: Query with hexadecimal characters Merlin Moncure <merlin.moncure@rcsonline.com>
@ 2005-01-12 15:53 ` James M Doherty PGADMIN <jimmyd@jdoherty.net>
2005-01-12 17:52 ` Re: Query with hexadecimal characters Joshua D. Drake <jd@commandprompt.com>
1 sibling, 1 reply; 7+ messages in thread
From: James M Doherty PGADMIN @ 2005-01-12 15:53 UTC (permalink / raw)
To: Merlin Moncure <merlin.moncure@rcsonline.com>; Luciano <ldelio@yahoo.com>; +Cc: pgsql-odbc
I am not sure you are aware but COBOL will cause
brain damage if used for an extended period of time
Jim
----- Original Message -----
From: "Merlin Moncure" <merlin.moncure@rcsonline.com>
To: "Luciano" <ldelio@yahoo.com>
Cc: <pgsql-odbc@postgresql.org>
Sent: Wednesday, January 12, 2005 9:33 AM
Subject: Re: [ODBC] Query with hexadecimal characters
> Eric and Tom: thank you very much for your help, I
> will try your suggestions tomorrow at work.
> The sql statements are issued from a COBOL program,
> which can also issue the same statements to other
> databases (MySQL, MS SQLServer), so the first thing Im
> going to do is trying to change the encoding setup,
> which would be the most homogeneous solution that
> wouldn't interfere with the other databases, that
> currently handle well those strings with hexadecimal
> data.
>
> Thank u very much again!
> Luciano.
Just curious: what COBOL vendor/compiler are you using?
Merlin
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query with hexadecimal characters
2005-01-12 15:33 Re: Query with hexadecimal characters Merlin Moncure <merlin.moncure@rcsonline.com>
2005-01-12 15:53 ` Re: Query with hexadecimal characters James M Doherty PGADMIN <jimmyd@jdoherty.net>
@ 2005-01-12 17:52 ` Joshua D. Drake <jd@commandprompt.com>
0 siblings, 0 replies; 7+ messages in thread
From: Joshua D. Drake @ 2005-01-12 17:52 UTC (permalink / raw)
To: James M Doherty PGADMIN <jimmyd@jdoherty.net>; +Cc: Merlin Moncure <merlin.moncure@rcsonline.com>; Luciano <ldelio@yahoo.com>; pgsql-odbc
James M Doherty PGADMIN wrote:
> I am not sure you are aware but COBOL will cause
> brain damage if used for an extended period of time
>
Yep that is where all the Y2K stuff came from. People
had been using Cobol for too long to actually program
correctly ;)
Don't even get me started on all the damage Java is doing
to once young, inspired and productive programmers.
Sincerely,
Joshua D. Drake
> Jim
> ----- Original Message ----- From: "Merlin Moncure"
> <merlin.moncure@rcsonline.com>
> To: "Luciano" <ldelio@yahoo.com>
> Cc: <pgsql-odbc@postgresql.org>
> Sent: Wednesday, January 12, 2005 9:33 AM
> Subject: Re: [ODBC] Query with hexadecimal characters
>
>> Eric and Tom: thank you very much for your help, I
>> will try your suggestions tomorrow at work.
>> The sql statements are issued from a COBOL program,
>> which can also issue the same statements to other
>> databases (MySQL, MS SQLServer), so the first thing Im
>> going to do is trying to change the encoding setup,
>> which would be the most homogeneous solution that
>> wouldn't interfere with the other databases, that
>> currently handle well those strings with hexadecimal
>> data.
>>
>> Thank u very much again!
>> Luciano.
>
>
> Just curious: what COBOL vendor/compiler are you using?
>
> Merlin
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
--
Command Prompt, Inc., your source for PostgreSQL replication,
professional support, programming, managed services, shared
and dedicated hosting. Home of the Open Source Projects plPHP,
plPerlNG, pgManage, and pgPHPtoolkit.
Contact us now at: +1-503-667-4564 - http://www.commandprompt.com
Attachments:
jd.vcf (text/x-vcard, 638B) download
begin:vcard
fn:Joshua D. Drake
n:Drake;Joshua D.
org:Command Prompt, Inc.
adr:;;PO Box 215;Cascade Locks;Oregon;97014;USA
email;internet:jd@commandprompt.com
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
note:Command Prompt, Inc. is the largest and oldest US based commercial PostgreSQL support provider. We provide the only commercially viable integrated PostgreSQL replication solution, but also custom programming, and support. We authored the book Practical PostgreSQL, the procedural language plPHP, and adding trigger capability to plPerl.
x-mozilla-html:FALSE
url:http://www.commandprompt.com/
version:2.1
end:vcard
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query with hexadecimal characters
2005-01-12 15:33 Re: Query with hexadecimal characters Merlin Moncure <merlin.moncure@rcsonline.com>
@ 2005-01-13 22:50 ` Luciano <ldelio@yahoo.com>
1 sibling, 0 replies; 7+ messages in thread
From: Luciano @ 2005-01-13 22:50 UTC (permalink / raw)
To: Merlin Moncure <merlin.moncure@rcsonline.com>; +Cc: pgsql-odbc
At the moment we are using RM/Cobol, which is a
Liant's product. Some time ago we also used
Microfocus's Merant Cobol, which is quite much better,
but extremely expensive...
--- Merlin Moncure <merlin.moncure@rcsonline.com>
wrote:
> > Eric and Tom: thank you very much for your help, I
> > will try your suggestions tomorrow at work.
> > The sql statements are issued from a COBOL
> program,
> > which can also issue the same statements to other
> > databases (MySQL, MS SQLServer), so the first
> thing Im
> > going to do is trying to change the encoding
> setup,
> > which would be the most homogeneous solution that
> > wouldn't interfere with the other databases, that
> > currently handle well those strings with
> hexadecimal
> > data.
> >
> > Thank u very much again!
> > Luciano.
>
> Just curious: what COBOL vendor/compiler are you
> using?
>
> Merlin
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to
> majordomo@postgresql.org so that your
> message can get through to the mailing list
> cleanly
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2005-01-13 22:50 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-10 22:10 Query with hexadecimal characters Luciano <ldelio@yahoo.com>
2005-01-10 23:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-01-11 02:36 ` Luciano <ldelio@yahoo.com>
2005-01-12 15:33 Re: Query with hexadecimal characters Merlin Moncure <merlin.moncure@rcsonline.com>
2005-01-12 15:53 ` James M Doherty PGADMIN <jimmyd@jdoherty.net>
2005-01-12 17:52 ` Joshua D. Drake <jd@commandprompt.com>
2005-01-13 22:50 ` Luciano <ldelio@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox