Re: Converting a number to Text
- From: Marco Greco <marco@xxxxxxxxxxxx>
- Date: Mon, 30 Jul 2007 17:29:53 +0100
chaboch wrote:
Hi,
I'm having a tough time with my SQL statement when I try to join two
table. One table has a field named doc_no and is numeric while the
other table has a field named record_key and is text. When i write
"doc_no = record_key" and run the report, I get an error message about
data types not being equal.
How can I force the doc_no to be casted as text so I can join the
tables?
Please Help. Thank You,
Chaim Bochner
You are stuffed! text is a dumb blob type and there isn't much you can do with
it. Not even cast it.
If you can make record_key a (say) lvarchar, or even a char (I am guessing
your text is not very long, if all you expect to do with it is to compare it
with integers), then you can join the two tables with no other requirement.
A word of warning: comparing different data types (and in particular, casting
every single row to an integer) may be a rather inefficient business
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
.
- References:
- Converting a number to Text
- From: chaboch
- Converting a number to Text
- Prev by Date: Converting a number to Text
- Next by Date: Re: Converting a number to Text
- Previous by thread: Converting a number to Text
- Next by thread: Re: Converting a number to Text
- Index(es):
Relevant Pages
|
|