Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

SQL Developer & MySQL ??

624894Jan 14 2009 — edited Jan 15 2009
I am unable to use the Tools->Database Export utility to do exports for MySQL databases the way I do it for oracle. In the 'Connection' option of the export wizard, only my oracle connections are enlisted.

Though I have a MySQL database server up and running and a connection to my database in it from SQL Developer exists and is active, I dont' understand why only my oracle database connections are enlisted in the 'Connection' option of the export wizard. Any Hints ???

Comments

23650
Yes, here is the complicated code to add a day:
select sysdate + 1 from dual;
There is no need for an ADD_DAYS function because date math is very easy. If you want to add 1 day, you just, well, add 1 to a date. If you want to know the date a week ago, just subtract 7 from the date.

It's just addition or subtraction, and we don't have functions for those operations, right?
496458
No. The answer is not that simple. What will happen if you want to subtract 10 from the 1st of the month.
OrionNet
In Simplicity, I believe

SELECT TO_DATE ('20081201', 'YYYYMMDD') new_date
FROM DUAL;

NEW_DATE
----------------
01-DEC-08
1 row selected.

SELECT TO_DATE ('20081201', 'YYYYMMDD') - 10 new_date
FROM DUAL;

NEW_DATE
-------------
21-NOV-08
1 row selected.

More examples

-- Added 3 months from dec 1, 2008_*
select ADD_MONTHS(trunc(sysdate)-4,3) new_date from dual;

NEW_DATE
---------------
01-MAR-09
1 row selected.

-- Subtracted 10 days from it then_
select ADD_MONTHS(trunc(sysdate)-4,3) - 10 new_date from dual;

NEW_DATE
--------------
19-FEB-09
1 row selected.

Edited by: OrionNet on Dec 5, 2008 9:02 PM

Edited by: OrionNet on Dec 5, 2008 9:10 PM
Peter Gjelstrup
Ok, let's revive a 6 year old....
Aketi Jyuuzou
select 'This thread is '
|| to_char(trunc(sysdate) - date '2002-11-20')
|| 'days old' as "How many older"
 from dual;

How many older
---------------------------
This thread is 2722days old
select date '2002-11-20' + 2722 from dual ;

DATE'200
--------
10-05-04
OrionNet
Here is the function that can be used just as add_months


CREATE OR REPLACE FUNCTION add_days (d date, n number)
RETURN DATE
IS
v_date DATE;
BEGIN
v_date := d + n;

DBMS_OUTPUT.put_line (v_date);
RETURN v_date;
END;


Simple test case

DECLARE
retval DATE;
d DATE;
n NUMBER;
BEGIN
d := SYSDATE;
n := -20;
retval := add_days (d, n);
END;

Output
------------
17-NOV-08
Satyaki_De
Boss, did you notice the posting date of this thread?
Posted: Nov 21, 2002 10:41 AM
So, i think this statement perhaps extracted from one of our new user without noticing the actual posting of the day. ;)

Regards.

Satyaki De.
OrionNet
I noticed that but I replied to this dude


user493455

Posts: 1
Registered: 03/07/06
Re: re:add_days() function ??? like add_months()
Posted: Dec 5, 2008 8:52 PM in response to: Todd Barry Reply
William Robertson
Why not write our own <tt>ADD_NUMBER()</tt> function while we're at it (and perhaps <tt>SUBTRACT_DAYS()</tt> for user493455's benefit).
450441
Perhaps the thread was revived just so we could have a chuckle.
678284
Why not write our own ADD_NUMBER() function
I made add_number :-)
create or replace function add_number(n number,addVal number)
return number is
begin
    return n+addVal;
end;
/

select add_number(100,200) from dual;

ADD_NUMBER(100,200)
-------------------
                300
21205
Why open a really old thread?
Why create a function for that?
SQL> select 100 + 200 from dual
  2  /

   100+200
----------
       300
Boneist
Shh!

This is the "Celebrate the reinvention of the wheel!" thread...

Next up, "How I Rediscovered Fire"...
21205
Boneist wrote:
Shh!

This is the "Celebrate the reinvention of the wheel!" thread...

Next up, "How I Rediscovered Fire"...
dang... must have missed that memo...
Hoek
Next time: "Is there life after coffee?" presented by C.Bean.
678284
Why not write our own ADD_NUMBER() function while we're at it (and perhaps SUBTRACT_DAYS() for user493455's benefit).
create or replace function SUBTRACT_DAYS(n1 date,n2 number)
return date is
begin
    return n1-n2;
end;
/

select SUBTRACT_DAYS(sysdate,5) from dual;
BluShadow
>


Oh wow! Aint you funny. .... erm.... not.
Prazy
Psst... Let the zombies rest in peace...!!
Sven W.
cool thread. Thanks for digging it up!
Had a nice chuckle after rereading Boneists posts...
678284
I agree this is a cool thread.
678284
William Robertson wrote:
Why not write our own <tt>ADD_NUMBER()</tt> function while we're at it (and perhaps <tt>SUBTRACT_DAYS()</tt> for user493455's benefit).
create or replace function SUBTRACT_NUMBER(n1 NUMBER,n2 NUMBER)
return NUMBER is
begin
    return n1-n2;
end;
/

select SUBTRACT_NUMBER(11,10) from dual;
1 - 21
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 12 2009
Added on Jan 14 2009
5 comments
864 views