Hello !
The fact is that I've met with several problems when I decided, that
MySQL won't satisfy the needs of my company anymore. I thought Oracle would
meet all the needs. Operating system used - Linux RedHat 6.2, kernel
2.2.16. The problem occured when I decided to rewrite my code from MySQL to
Oracle.
1. I still can't get any working results with making a single select from
several tables of one database. My MySQL statement looks like this:
select straight_join sql_small_result high_priority distinctrow \
passwd.passwd, \
ifnull(ifnull(useritems.simult,realmitems.simult),groupitems.simult) as simult,
.........
from passwd \
left join useritems on useritems.username="%U" \
left join groupitems on groupitems.gid=passwd.gid, \
realmitems \
where passwd.username="%U" \
and passwd.dialaccess \
and realmitems.realm = if(strcmp("%n",substring_index("%n","@",
-1)),substring_index("%n","@", -1), "")
After many attempts to convert this code it all leads to SQL*Plus syntax error.
How it can be done with Oracle SQL ?
2. In MySQL I used the if(x,x,x) condition, included as an argument of a
select request, just like this:
select straight_join sql_small_result high_priority distinctrow \
...............
if(passwd.gid!=10000,ifnull(ifnull(useritems.sessiontimeout,realmitems.sessiontimeout),
groupitems.sessiontimeout),passwd.timebank) as sessiontimeout,
...............
This doesn't work with Oracle. How can the syntax may be rewritten to make
Oracle understand it ?
3. How can I make Oracle understand UNIX timestamps (used by most NASs in
Reply packets), convert them to readable dates (like from_unixtime in MySQL),
and make operations with it ?
4. Among date functions I've found the only function ADD_MONTHS for making
operations with dates. How can Oracle, for example, add and
subtract seconds,minutes,days and so on ? Are there any additional modules and
where can they be found ?
5. Finally, I coundn't find analogs for MySQL commands like:
locate,strcmp,substring_index, because I use special realms, like @, for
authenticating users. Are there any in Oracle SQL ?
6. What are the analogs of the options:
delayed - for INSERT,
traight_join sql_small_result high_priority distinctrow - for SELECT ?
I'm very sorry for asking so many questions, but this necessary information is
very important and, besides, I coundn't find anything concerning these
questions in many Mb PDFs of Oracle documentation.
I'll appreciate any help.
I'll be waiting for your answer impatiently.
Thanks.
--
With regards,
Alexey A. Shavaldin [EMAIL PROTECTED]
--------------------
System Administrator
of Kraft-S, JSC
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.