On Fri, 22 Oct 2004 15:27:28 +0800, Rafael 'Dido' Sevilla
<[EMAIL PROTECTED]> wrote:
..
> the OCI header files in order to get the thing to compile, and that left
> me with the nagging feeling that it might not work (it succeeded
> though).  I had to manually create symbolic links to the Instant Client
> shared libraries (libclntsh.so.10 to libclntsh.so for instance), in
> order for the configure script to detect that it was even available.  I
..
> for developers to ease this process.  DBD::Oracle would also be subject
> to the same environment variable, symlink, and header file debacle  that
> I found myself in, I suspect.

Nope, all that DBD::Oracle needs is correct $TWO_TASK or $ORACLE_HOME.
The problem with libclntsh.so can easily be fixed by adding the path
to /etc/ld.so.conf


..
> First thing I noticed is that Oracle doesn't support the LIMIT clause
> for some reason.  This is de rigeur for web-based applications that
> present paginated table views of data, and looking around revealed that
> instead of the simple:

The reason is that LIMIT is not SQL92 standard. There is also a
non-standard way of doing it in Oracle using the rowid internal
variable. Forgot exact mantra right now...

..
> Another thing that tripped me up while doing this conversion was the
> auto incrementing indexes and the NOW() function that MySQL developers
> take for granted.  All of these had to be done on the client side, which
> was particularly painful in the latter case.

For the auto-incrementing fields, you use a sequence.

CREATE SEQUECE didos_sequence START WITH 1000;

For NOW() you use SYSDATE.

e.g.

INSERT INTO didos_blog(index, date, message)
VALUES(didos_sequence.NEXTVAL, SYSDATE, 'a rant from dido');

the advantage of Oracle dates, even though you have to use the
annoying TO_DATE() and TO_CHAR() conversions, is that oracle dates are
native Julian days (floating point). So you can calculate the days
between two dates by simple subtraction. Also, e.g. for julian day X,
12 noon on that day is X.5 and so on (the mantissa is the fractional
day, just multiply by 86400).

IMHO for many applications Oracle beats the pants off mysql,
particularly high concurrency. but it costs an arm, a leg, and both
nuts. And BTW.... all the peculiarities and annoyances of Oracle ==
Guaranteed Job Security.   :P

> 
> The experience of porting a simple LAMP application to Oracle nicely
> illustrates the gap between these two worlds.  There's a long way to go
> before the two meet in the middle. *sigh*
> 
> --
> dido
> "...ang PUMATAY nang dahil sa iyo!"
> --
> Philippine Linux Users' Group (PLUG) Mailing List
> [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
> Official Website: http://plug.linux.org.ph
> Searchable Archives: http://marc.free.net.ph
> .
> To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
> .
> Are you a Linux newbie? To join the newbie list, go to
> http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
>
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie

Reply via email to