Posts Tagged ‘Oracle’

Oracle SQL Developer 2.1

Posted 14 Oct 2009 — by Arun
Category Oracle

I installed Oracle SQL Developer 2.1 Early Adapter release and it seems to load faster than the current stable version (1.5.x). SQL Developer, for it’s feature set or lack of that, takes more time to load in my system than Toad, but version 2.1 seems to be much better. You can download SQL Developer 2.1 from here.

Some of the new features in 2.1 includes:

  • Oracle SQL Developer Unit Testing provides a unit testing framework that allows you to build a set of sequential steps to create test cases for testing your PL/SQL code. You can build a collection of tests to make up a suite of tests that can be run and rerun to verify changes in your PL/SQL code and to still complete the required functionality.
  • Oracle SQL Developer Data Modeler is a stand alone product that supports logical, relational and conceptual modeling. The tool supports forward and reverse engineering and import and export from various sources. The Data Modeler supports an additional standalone model viewer, which allows users to open models built in the full Data Modeler. SQL Developer 2.1 incorporates the modeler viewer as an extension. integrated into SQL Developer. The Data Modeler Viewer also supports visualizing tables, views and object types on read-only Data Modeler diagrams. The SQL Developer Data Modeler Viewer extension is a free extension to SQL Developer.
  • The SQL Worksheet has been redesigned for SQL Developer 2.1 to support concurrent task processing for long running operations. Updates to the worksheet include the support of multiple data grids off the F9 (Run Statement) command and dockable OWA, DBMSOutput and SQL History windows.
  • For more features, click here.

Technorati Tags: , ,

Going to Vegas for OHUG conference

Posted 12 Jun 2009 — by Arun
Category General

I’ll be going to Las Vegas to attend the OHUG conference from Sunday, June 14th to Thursday, June 18th.  I’ll blog when I get time.

Oracle SQL Developer pain

Posted 03 Jun 2009 — by Arun
Category Oracle

I like Oracle SQL Developer even though it’s slightly bulkier and slower to start than Toad (with less functionality and buggy). I found one annoying problem with SQL Developer. If you are running a query in the SQL Worksheet and the query is taking sometime to return the rows, you can’t open another worksheet until the query is done. If you try to open another worksheet, you’ll get a message saying “Connection currently busy. Try again or Abort”. What’s the purpose of multiple worksheets if you can’t work on more than one simaltaneously? I hope they fix this soon.

sqldevpain

Technorati Tags: , , ,

Oracle SQL Developer – Backspace, CTRL, Delete keys not working

Posted 20 May 2009 — by Arun
Category Oracle

I use SQL Developers for my development work. All of a sudden, the Backspace key, CTRL key, Delete key and other function keys stopped working in the SQL worksheet. I don’t remember doing anything out of ordinary, but those keys stopped working. I then Googled and found a solution. All you have to do is click on Tools menu – select Preferences, click on Accelerators on the left side, click on Load Preset button on the right, select Default (screenshot below), click OK and click OK again to close the preference window. All keys should work fine now.

sqldevpref

Technorati Tags: , , ,

What’s going to happen to MySQL?

Posted 21 Apr 2009 — by Arun
Category News

Now that Oracle has bought Sun Microsystem, what is going to happen to MySQL? Are they going to leave it as it is (as open source and free) to cover the small businesses or are they going to scrap it so they can push Oracle database to small businesses? Are the independent developers still going to contribute to MySQL development? Does anyone know the answer?

Technorati Tags: , , , ,

Oracle SQL to get fiscal year dates

Posted 16 Apr 2009 — by Arun
Category Oracle

I wanted to find out the fiscal year, fiscal year start date and fiscal year end date for a given date. Our fiscal year runs from July 01st to June 30th. We’re on fiscal year 09 now starting from 01st July 2008 to 30th June 2009. It’ll be fiscal year 10 starting from 01st July 2009. One of my program requirement is to get the fiscal year, the start date and the end date. Here is the SQL I came up with (Thanks to eric6930 for the idea).

with FY as (
select decode(  trunc((substr(yearmonth, 5,2)-1)/6),
          1, substr(yearmonth, 1,4)+1,
         substr(yearmonth, 1,4) ) fiscal_year
     from (select to_char(trunc(to_date(‘16-APR-2009′,’DD-MON-YYYY’)),’YYYYMM’) yearmonth
     from dual))
select fiscal_year    
     , to_date((‘01-JUL-’)||(fiscal_year – 1)) fystart_date
     , to_date((‘30-JUN-’)||fiscal_year) fyend_date
     from FY

The SQL “select to_char(trunc(to_date(‘16-APR-2009′,’DD-MON-YYYY’)),’YYYYMM’) yearmonth from dual” converts a given date to year (YYYY) and month (MM) part, so 16-APR-2009 would be 200904.

substr(yearmonth, 5,2) will get the month part. I’m using “-1″ to keep the truncated value under 2, so it could be handled in the decode statement.

Since the fiscal year ends in June, I’m using 6 as the divisor. The trunc statement will return 1 for months from July and above. It’ll return a 0 for months from January to June. When it’s one, the decode statement will return the fiscal year as year + 1 from the date. When it’s zero, the decode statement will return the year as it.

Technorati Tags: , , ,

Ora_Tweet – Tweet from Oracle database using PLSQL

Posted 10 Apr 2009 — by Arun
Category Oracle

Ora_tweet is a PL/SQL Twitter API that can be used to send messages from your Oracle database to your twitter account. It might come handy for DBAs who twitters a lot. This is the first version and all it does right now is allow you to send a status update. Future changes might include more functionality. For more information, refer to Database Geek blog.

Technorati Tags: , , ,

Firefox 3.0 finally certified with Oracle E-Business suite

Posted 02 Mar 2009 — by Arun
Category Oracle, Technology

More than 8 months after Firefox 3.0 was released and Firefox 3.1 getting close to final release, Oracle has certified Firefox 3.0 with Oracle E-Business suite 11i and 12. They have released a new ATG interoperability patch to support Firefox 3.0. They have also released a patch for Java which removes static versioning and switches Firefox to non-static versioning. A long due changes finally arrived.

Source: Oracle E-Business Suite Technology blog.

Technorati Tags: , , ,

Oracle SQL – Converting multiple rows into single row

Posted 23 Feb 2009 — by Arun
Category Oracle, Technology

One of the project I’m working on has a requirement where if an employee has multiple assignments (multiple rows in the assignment table), then the SQL should consolidate his assignments into one row, with each column holding multiple values (for each row) with a delimiter.

For eg: Here is a sample table

SQL> desc test_asg
Assignment_id number(15)
Title varchar2(50)  — Job title
Emp_cat varchar2(2)  — Employment category

Here is the data in the table:

ASSIGNMENT_ID    TITLE         EMP_CAT
100              Comp info     AP
100              Technician    AP
101              Faculty       AP
102              Teaching      CS
102              Grad Assist   CS
102              Secretary     AP
103              Director      AP

The output requirement is

ASSIGNMENT_ID    JOB_TITLE                         EMP_CATEGORY
100              Comp info;Technician              AP;AP
101              Faculty                           AP
102              Teaching;Grad Assist;Secretary    CS;CS;AP
103              Director                          AP

Here is the SQL I wrote to get the output.

select assignment_id, substr(asg_title,2) JOB_TITLE, substr(asg_empcat,2) EMP_CATEGORY
from (
select assignment_id, max(sys_connect_by_path(title,’;')) asg_title, max(sys_connect_by_path(emp_cat,’;')) asg_empcat
from (
select assignment_id, title, emp_cat, row_number() over (partition by assignment_id order by assignment_id) rnum
from test_asg
)
start with rnum = 1
connect by prior rnum = rnum-1 and prior assignment_id = assignment_id
group by assignment_id
order by assignment_id
)
order by assignment_id;

The SYS_CONNECT_BY_PATH function returns the list of titles concatenated together and list of emp_cat connected together for each assignment id. The Start with .. Connect by clause is used to select data having hierarchical relationship.

Technorati Tags: , , , , ,

Offending Oracle’s E-Business Suite Report

Posted 10 Dec 2008 — by Arun
Category General, Oracle

Our HR department ran one of Oracle’s E-Business Suite report which reports on new hires. This is what we found in the log file of the report.

MSG-00001: tmp011:
MSG-00088: Hell with this
MSG-00001: hello
MSG-00088: Hell with this
MSG-00001: hello
MSG-00088: Hell with this
MSG-00001: hello
MSG-00088: Hell with this
MSG-00001: hello

………………

Though it looks funny, it is kind of offending to see such statements in a professional report. The obvious guess is, one of the developer might got frustrated with the program (or the employer) and put those messages in, but Oracle QA team should have removed those messages before releasing the report to enterprises. I’m not sure if Oracle said “Hell with this developer” and kicked him/her out.