Database IT Blogs

Articles, tips and tricks for databases
Tags >> programming
Patrick Barel

In a previous blog I talked about turning triggers on and off using semaphores. I created a semaphore for every table I needed along with its programs to set and unset the semaphore and to get its current state. This was a rather cumbersome process, because for every new trigger I needed to add these programs to the package. Both the spec and the body need to be recompiled which renders all dependant code to become invalid. This week I came across a similar problem with a new project. I figured I could use roughly the same solution but I needed to find a better way to implement it.

Read the rest of this article at http://bar-solutions.com/weblog/?p=321


Patrick Barel

Currently I am working on an application that runs one or more listener threads using scheduled tasks (DBMS_SCHEDULER). When I want to compile a piece of code that is effectively locked by one of these processes my IDE locks up, until I shut down the tasks. The first couple of times I was wondering what was happening and why my code wouldn’t compile. In a later stage I found out that the scheduled tasks was the problem.


Peter Tesone DreamCoder for Oracle  includes many changes, such as the way objects are described with the SQL and PL/SQL editor.  

The new DreamCoder for Oracle includes a new way to describe objects or alias when using the SQL and PL/SQL editor, just combine CTRL + CLICK on the object. The advantage of this new option is that the object opens in edition mode, therefore the programming process is quicker. If you are opening a method package, when opened the cursor will be pointing to the method.

Patrick Barel I am comparing tables in two different schemas. Since I am doing the same thing over and over again I created a small script which might be useful to you too.

Patrick Barel All data types in the Oracle database implement the null value. Null is a very special value which means ‘Unknown’. That means that the value is really unknown. Null is not equal to null, because both are not known. Therefore you cannot compare them to each other.

Patrick Barel I came across the need to define the first day of next month based on the current systemdate. I can do this using the following code:

add_months(to_date(’01'||to_char(sysdate,’MMYYYY’),’DDMMYYYY’),1)

But the I remembered that there was a post on the oracledeveloper.nl forum with similar date functions.

Patrick Barel
If you don’t know where to start your with your program, recursion might be an option. I am working on some (perhaps useless) package code to convert an integer into a boolean representation. When I am converting the integer, I don’t know where to start my conversion. If the integer is relatively small and I start with a high bit (too big) then the overhead is relatively big.

Patrick Barel In my previous post I have been writing about how you can mimic properties in a PL/SQL package. One of the ideas I wrote about was a boolean property that internally is an integer value. How can this be useful. If, for instance, you want to turn logging on and of during the program, wouldn’t it be nice not to have to worry about it’s previous state when turning it on (for instance when calling sub-programs).

Patrick Barel
Oracle has decided to add Conditional Compilation to Oracle 10g Release 2. As Bryn Llewellyn states in his white paper Conditional Compilation in Oracle Database 10g Release 2. Unusually, but for very compelling reasons, the feature has been made available in patchsets of releases of Oracle Database earlier than the one that introduced the feature. It is available in Oracle 10g Release 1 (10.1.0.4.0) and if you have the right support contract, it can even be turned on Oracle 9i (9.2.0.6).

Patrick Barel
If you have a program with parameters that have default values and you want the user to be able to change the default values of the parameters, without you having to change the value in the code, then put that data in a table.

« StartPrev12NextEnd »

Advertisement

Featured Links:
DreamCoder for MySQL Enterprise
Powerful MySQL GUI Client tool designed to automate and simplify database development process.
DreamCoder for Oracle DBA
Top IDE for Developers & DBAs. Browse database objects, run SQL and SQL scripts, and edit and debug PL/SQL code.
DreamCoder for PostgreSQL Enterprise
Powerful PostgreSQL admin tool. PLpg/SQL IDE for developers and DBAs.

Tags