RE: Getting data to a file, and divide by zero
Posted in 1995
Niel,
As to your first question, use the statment:
UNLOAD TO filename SELECT * FROM your_table;
This will create a pipe delimited file which Oracle should be able to
import. (FYI, isql attempts to fit the results of your select
onto the screen. If it fits in column format, then that's what you
get. Otherwise, it's turned on its side as is your case.)
I don't have a good answer for your divide question. Perhaps you
could select all the rows with a divisor != 0 and union the results
with rows whose divisor = 0?
--Craig (craig@chemistry.utah.edu)
}
} I am working with an AT&T R3 Call Management System, which uses Informix
} as its database. Unfortunately, that means it's supported by AT&T's CMS
} group, who really know nothing about Informix except as it pertains to
} CMS' built-in reporting. Personally, I have more experience with Oracle,
} so please bear with me for a minute.
}
} I am trying to get some raw data out of Informix. I have messed around
} with the isql program, and I have a few questions. With Oracle, when I
} run an SQL query in SQL*Plus, I get data in a columnar format. In isql,
} however, I get it turned on its side, if you know what I mean. How can I
} get a stream of data, without headers or page formatting of any kind, into
} a file for importing into Oracle?
}
} A second question pertains to selecting expressions. Part of my query
} involves dividing two columns, and the divisor may be zero. In Oracle, I
} would use the decode() function to change any zeros in the divisor to ones
} and I know I'd be safe from this problem. Is there an equivalent way to
} do this in Informix?
}