Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Oracle vs. Sybase troubles
I've run into a number of problems trying to write SQL code that is
insensitive to Oracle (8i) or Sybase (System 11) peculiarities. (I
realize that in itself may be my problem). Any comments, suggestions,
or input will be greatly appreciated...
First is the issue over stored procedures. Is there a way to return
rows of data from an Oracle stored procedure? (I've read a number of
correspondences supporting the yes and the no answer, and so yet remain
somewhat confused.) If so, are there any mechanical differences
between the datasets... ie will one look different than the other to my
application program that calls the stored procedure?
Second are the dates and date differences. Is there a way
to "SELECT.." the difference between two dates and return a value of an
arbitrary unit such that the same "SELECT.." query will work against
Sybase and Oracle? (I know how to 'select datediff(units,date1,date2)'
in Sybase and how to 'select date1-date2*units_multiplier' in ORACLE,
and am guessing this is the only way to go about it)
Lastly in my wordy cry for help is the UNION. Why does a union in
Sybase preserve the size and type of its respective columns, but Oracle
promotes 4byte (integers) to 8byte (doubles) and sizes varchar2()'s to
accomodate the largest member of the union? Most importantly to me, is
there a way to preserve 4byte (integers) in unions in Oracle?
I know this is a long one, but any help on any of these issues will
go a long way. Thanks in advance.
Mike
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Mar 21 2000 - 00:00:00 CST