Re: Str Function
Posted in 1998
Jose Miguel Giraldez wrote:
>
> What if I need to do something like:
> select * from tableA where numeric_column[1,2]="15"> without using a cursor.
Try:
SELECT col1, col2, col3....., numeric_column||"" char_column
FROM tableA
WHERE ....
INTO TEMP tableT
;
SELECT *
FROM tableT
WHERE char_column[1,2] = "15"
But the results will depend on your data. You could be looking at tens,
hundreds, thousands, etc...
I hope you know that the data you are looking for is in those two
character positions. It sounds almost like a database design problem to
me.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
|Mark D. Stock - Informix SA http://www.informix.com |//////// /|
|mailto:mdstock@informix.com http://www.informix.com/idn |///// / //|
|http://www.iiug.org +-----------------------------------+//// / ///|
| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
+----------------------+-----------------------------------+-----------+