Posts

Showing posts from July, 2010

Team Coding Installation for Oracle PL/SQL

Image
If you write a lot of PL/SQL code, you must have thought of it at least once. It is probably when your teammate accidentally overwrote the same package that you saved seconds ago. Yes, I am talking about Team Coding.

If you are using SQL Navigator or TOAD for Oracle, you are just couple of clicks away to refine your PL/SQL development experience. In this article, I will outline the steps to install Team Coding to your Oracle Database to use with SQL Navigator. If you are using TOAD for Oracle, then I recommend you reading this article instead.
Now that you are still with me...

First things first, I haven't tried these installation steps on all possible versions of Oracle or SQL Navigator, but I believe they would work for most of them. In the office, we are using Oracle DB versions 10.2.0.1.0 and 10.2.0.4 and SQL Navigator version 5.1.

Here are the steps you need to follow: Using SQL Navigator, connect to Oracle DB as SYS user or a user that has SYSTEM privilegesFrom the menubar, …

JavaScript DecimalFormat

We needed to implement a number formatter in JavaScript for Formspider, our Web 2.0 framework for PL/SQL developers. The applications developed with the framework can run on both Java and JavaScript from the same code base. Since we used the DecimalFormat on Java side, we needed the same functionality for the Javascript environment as well. The Javascipt code below implements Java's DecimalFormat in JavaScript.
It is implemented to fulfill our basic needs such as prefix, suffix, comma separation, min/max digits and percentage(%) values.

Here is the source code:DecimalFormat.js

Examples:
var df = new DecimalFormat("$#,#00.00#");
df.format(1); //$01.00
df.format(12345.6789); //$12,345.679
df.formatBack("$1,234.00"); //1234

For detailed information you can visit Java DecimalFormat description page.
Öskan Şavlı

Creating Oracle to SQL Server Database Link Programmatically(32-Bit Win)

This article describes how to create a heterogeneos connection between Oracle to SQLServer programmatically using Java.
Please read the Article Creating Oracle to SQL Server Database Link to create this connection manually.

You can download the source code for this tutorial from here

Step 1: Create Windows Script (vbs) File to Create Data Source (ODBC)

Create a file of type .vbs (for Example odbcScript.vbs) with the code below.

This script expects six input parameters that are represent by WScript.Arguments.Item(i) in the script. Below is the list of six parameters you need to supply.

DataSourceName: The Name of the Datasource Connection (ODBC) you want create.

DatabaseName: Name of the SQL Server Database

LastUser: SQL Server User Name

Password: Password of the SQL Server User

Server: Name of the Server Computer that runs the SQL Server

sComputer = Name of the Host machine where you run this code

The Script:

Option Explicit

'Constants

Const HKEY_CLASSES_ROOT = &H80000000

Const HKEY_CURRENT_…

Creating Oracle to SQLServer Database Link (32-Bit Win)

Image
Oracle Heterogeneous Services let you create a database link from Oracle to SQL Server. This method may be preferred over using a JDBC connection because it is significantly faster. Below is the list of steps you need to follow to establish a link from Oracle Database to an SQL Server so that you can query it from your Oracle Database.

Step 1: Creating Data Source (ODBC)

Open Start Menu and select Programs/Administrative Tools/DataSources/Data Sources(ODBC). Go to System DSN tab. Click the Add button to create a new Data Source



Select SQL Server from the driver list and click Finish.



The Create a New Data Source to SQL Server Dialog will show up.

Enter a name for the new Datasource (ibexLink in our example).

Optionally enter a description for your Datasource.

Select the server which you want to connect to from the list. The list displays all the computers in your network that have SQL Server installed.

Click Next.



Select radio button With Sql Server authentication using a login ID and passw…

Applet initialization problem

DOM manipulations in a web application may cause the applets in the application to reinitialize. Sometimes this can be annoying because the reinitialization causes the applet to lose its state.I ran into this problem recently in a project when we incorporated a JavaFX widget into our DHTML/JavaScript application. I have not been able to find much information about this issue on the web and ended up doing a lot of JavaScript debugging. So in the hope of saving others some valuable time, here are the three scenarios we observed which causes the reinitialization problem:

Changing the display style of an applet or a parent of the applet to any value other than "none" causes the applet to reinitialize in Firefox and Chrome. This change does not cause any problems in IE. Cross browser support was essential to us so I ended up changing the visibility or width&height attributes of the applet to hide it instead of setting its style.
Reinserting an applet or a parent of the applet t…