Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Char to Numeric Conversion 1

Status
Not open for further replies.

ufobaby

MIS
Sep 25, 2001
238
US
Hi all,

i have a queries which use data from diff tables and diff data types ex-

select a , b ,c (these are numbers)
from table
union all
select a+0,b+0,c+0 (used to convert to numbers)
from table1

but in informix 9.21 this gives an error or just does not work. any ideas are appreciated

[cheers]
Niraj [noevil]
 
Hi:

Generally, Informix does a conversion if it can. That said how about selecting your character data into a temp table defined as integer:

I don't like this, but given:

table table1
(
a integer,
b integer,
c integer
);

and table table2
(
a char(1),
b char(1),
c char(1)
);

Create temp table3 and insert into that before doing your select union. This works
on Online 7.31UC2 under Solaris 7. I don't have access to 9x.

Regards,

Ed

-- Test script starts here:

create temp table table3
(
a char(1),
b char(1),
c char(1)
);

insert into table3
select a, b, c from table1;

select a, b, c
from table3
union
select a, b, c
from table2;

drop table3;
 
Thanks a ton.... olded,

have tried this but there's still some problem. am using this in an ACE Report, the temp table creates a problem if 2 + user run the same report at the same time, so was wondering if there's any other workaround for this.

Also i need to know how can we "Set isolation to dirty read" in an Ace report.

Any ideas / web sites to refer... on the same would be of great help.

[cheers]
Niraj [noevil]
 
Niraj:

This is why years ago I abandomed ACE reports; Too limiting. I don't think there's a way of setting isolation levels in an ACE report. I checked this out in Ron Flannery's Informix Handbook, and I didn't see a control block where SET ISOLATION ... could be executed.

As far as web sites are concerned:

informix.com: IBM's Informix web site. Most all of the Informix documentation is available online

iiug.org: The International Informix User's group. All things Informix. They have an excellent repository of free software - SQL scripts, 4GL programs, shell scripts, etc.

Regards,

Ed
 
Hello,

In Infomix Release 4.11 for Perform and in version 4.12 for ACE, environment variables were established to allow for the setting of isolation levels.

The environment variable for ACE is SACEISOL , and the environment variable for Perform is SPERISOL. According to Informix 4.13 release notes, valid values for these variables are:
dirty read
committed read
cursor stability
repeatable read
In Bourne Shell or Korn Shell, use:
SPERISOL="dirty read"
export SPERISOL
In C Shell, use:
setenv SACEISOL "dirty read"
The isolation level can be specified in upper- or lowercase (or mixed case), but only a single space is allowed between the words, and there must be no leading or trailing spaces.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top