Displaying keyword search results 1 - 10
Created by Dr. Xi on September 06, 2007 03:11:40 Last update: January 31, 2013 12:13:45
The built-in function SYSDATE returns a DATE value containing the current date and time on your system. For example,
UPDATE ACCOUNT SET LAST_MODIFIED = SYSDATE;updates the LAST_MODIFIED column to the current system time.
select to_char(sysdate, 'MM-DD-YYYY HH24:MI:SS') N...prints the current date & time.
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 rlwrapCreate 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 nogeek on November 27, 2011 12:24:27 Last update: November 27, 2011 12:24:27
There is no XSLT 2.0 support in the JDK as of 7.0. According to Stackoverflow , there are three Java packages that support XSLT 2.0: Saxon IBM WebSphere XML Feature Pack Oracle XDK There are no known support for XSLT in browsers. According to Wikipedia : XSLT is developed by the World Wide Web Consortium (W3C). The most recent version is XSLT 2.0, which reached W3C recommendation status on 23 January 2007. As of 2010, however, XSLT 1.0 is still widely used, as there are no products that support XSLT 2.0 running in the browser, nor on some important server environments such as LAMP. Expressions like this:
format-date(xs:date('1999-12-31'), '[D01] [MNn] ...where format-date is a XSLT 2.0 function and date is a XPath 2.0 constructor...
Created by Dr. Xi on March 07, 2011 16:23:40 Last update: March 07, 2011 16:25:05
Oracle operator || doesn't work for MySQL. Looks like I have to use the concat function:
mysql> select 'abc' || '123'; +----------------...
Created by voodoo on November 25, 2010 00:03:53 Last update: November 25, 2010 00:03:53
It seems that the JDBC standard way to create a BLOB is to call Connection.createBlob . However, this does not work for PostgreSQL (as of version 9.0-801 jdbc4):
Exception in thread "main" org.postgresql.util.PSQ...The workaround is to call a PostgreSQL function to create the Blob, then use JDBC to update it:
Connection conn = jdbcTemplate.getDataSource().get...Oracle Note: the Oracle way function to create an empty BLOB is EMPTY_BLOB() .
stmt.execute ("INSERT INTO my_blob_table VALUES ('...
Created by Dr. Xi on September 02, 2008 18:55:18 Last update: January 18, 2010 22:36:24
Remember the times when you googled for solutions to your technical problems? How much time did you spend on wading through the zillions of links to find the ones that are of interest to you? Wouldn't you hope that you can find the answer right away the second time around? How many times were you forced to peruse hundreds of pages of documentation for a very specific need? Did you ever need to experiment with various alternatives because the documentation was vague? Wouldn't you prefer that a shortcut is available when the same thing is needed again? Xinotes is here to record your technical findings so that you won't have to go through the same process again when the problem reappears. Experience has taught us...
Created by Dr. Xi on October 09, 2009 19:27:22 Last update: October 09, 2009 19:30:01
PL/SQL code from Pandazen :
CREATE OR REPLACE FUNCTION GET_INSERT_SCRIPT(V_TAB...Usage: To create the script for generating the INSERT statements:
set head off set pages 0 set trims on set...Run the resulting script to generate the INSERT script:
set pages 0 set trims on set lines 2000 ...PL/SQL code from Oracle Ask Tom
set serveroutput on size 100000 set feedbac...
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 March 24, 2009 23:40:51 Last update: March 24, 2009 23:41:34
The DECODE function is used to decode a key to a value , returning the default value if one is provided. It returns null if there's no match for keys and no default value is provided.
select DECODE(&quarter_id, '1', 'Spring', '2',...
Created by Dr. Xi on March 24, 2009 23:28:19 Last update: March 24, 2009 23:29:35
The COALESCE function returns the first non-null expression in the expression list. It returns null when all expressions evaluate to null . This example is from Oracle documentation :
SELECT product_id, list_price, min_price, COALESCE...Result:
PRODUCT_ID LIST_PRICE MIN_PRICE Sale ...