Recent Notes

Displaying keyword search results 1 - 5
Created by James on April 24, 2012 14:01:39    Last update: April 24, 2012 14:01:39
This is the Mathias Bynens placeholder plugin with several bug fixes of my own. /*! http://mths.be/placeholder v2.0.7 by @mathias ...
Created by Dr. Xi on February 06, 2012 12:14:11    Last update: February 07, 2012 15:39:35
Oracle sqlplus command line tools does not support command line editing out-of-the-box. But on Linux there's a handy utility that enables command line editing with any command line tool: rlwrap - readline wrapper. Install rlwrap: $ sudo apt-get install rlwrap Create a keywords file .sql.dict (optional, but convenient): false null true access add as asc begin by chec... It would be nice to add the tables names also. Create an alias for sqlplus (put it in .bashrc ): alias sqlplus='rlwrap -f $HOME/.sql.dict sqlplus'
Created by Dr. Xi on August 15, 2009 19:10:52    Last update: August 15, 2009 19:17:30
I have a PL/SQL package which uses DBMS_AQADM to create a queue. Oracle gave " PLS-00201 identifier 'DBMS_AQADM' must be declared " error when I tried to create the package. This happened even after I gave the user AQ_ADMINISTRATOR_ROLE , which has EXECUTE privilege on DBMS_AQADM, as can be confirmed with this query: select * from role_tab_privs where role= 'AQ_ADMIN... I have to grant EXECUTE right to the user directly to make it work. It turned out that roles are disabled in any named PL/SQL block ! The following comes from Oracle9i Database Concepts doc: PL/SQL Blocks and Roles The use of roles in a PL/SQL block depends on whether it is an anonymous block or a named block (stored procedure, function, or trigger), and...
Created by Dr. Xi on September 13, 2008 20:52:47    Last update: September 15, 2008 23:04:35
The text source of the stored objects (including stored procedures) are made available in Oracle by three views: USER_SOURCE describes the text source of the stored objects owned by the current user. This view does not display the OWNER column. ALL_SOURCE describes the text source of the stored objects accessible to the current user. DBA_SOURCE describes the text source of all stored objects in the database. These are the columns: Column Name Description OWNER Owner of the object NAME Name of the object TYPE Type of object: FUNCTION, JAVA SOURCE, PACKAGE, PACKAGE BODY, PROCEDURE, TRIGGER, TYPE, TYPE BODY LINE Line number of this line of source TEXT Text source of the stored object If you want to search for a certain keyword in the source,...
Created by Dr. Xi on August 11, 2007 23:19:26    Last update: August 12, 2007 01:39:33
For SQL Server 2000 and above, there are three functions: SELECT @@IDENTITY When a record is inserted into a table with a identity column, the function @@IDENTITY returns the last identity value that was inserted in the database on the same open connection. If a trigger adds a record into another table, which happens to have an identity column, @@IDENTITY will now return this value instead. SELECT IDENT_CURRENT('tablename') This will give you the most recent identity value for the given table regardless of who inserted it. SELECT SCOPE_IDENTITY() SCOPE_IDENTITY shows the most recently inserted IDENTITY in the current scope (which ignores any triggers that might fire). For SQL Server version prior to 2000, it is customary to use a stored procedure: CREATE PROCEDURE myProc @param1 INT AS......