Displaying keyword search results 11 - 20
Created by voodoo on November 25, 2010 00:15:37 Last update: November 25, 2010 00:15:37
PostgreSQL JDBC doc says: Specifically deleting a row that contains a Large Object reference does not delete the Large Object. Deleting the Large Object is a separate operation that needs to be performed. . In JDBC this can be done in two steps: Delete the large object (call PostgreSQL function lo_unlink )
long oid = jdbcTemplate.queryForObject("select...Delete the row in the referring table:
jdbcTemplate.update("delete from InventoryItem whe...
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 Fang on August 23, 2010 22:55:58 Last update: August 24, 2010 15:45:04
The tags XML flow control tags are exactly the same as their Core flow control equivalents, except that the test condition with a boolean EL expression is replaced by the select condition with an XPath expression. In the case of the forEach tag, the items attribute is replaced with the select attribute. In a test condition, the XPath expression is evaluated to a boolean value by the rules of the XPath boolean() function, which converts its argument to a boolean as follows: a number is true if and only if it is neither positive or negative zero nor NaN. a node-set is true if and only if it is non-empty. a string is true if and only if its length is non-zero. an object of...
Created by Fang on August 18, 2010 20:07:46 Last update: August 18, 2010 20:11:36
JSTL uses XPath expressions as a concise notation to specify or select parts of an XML document. JSTL provides EL like expressions to access web application data and comes with the core function library of the XPath specification. Accessing Web Application Data XPath Expression Mapping $foo pageContext.findAttribute("foo") $param:foo request.getParameter("foo") $header:foo request.getHeader("foo") $cookie:foo maps to the cookie's value for name foo $initParam:foo application.getInitParameter("foo") $pageScope:foo pageContext.getAttribute("foo", PageContext.PAGE_SCOPE) $requestScope:foo pageContext.getAttribute("foo", PageContext.REQUEST_SCOPE) $sessionScope:foo pageContext.getAttribute("foo", PageContext.SESSION_SCOPE) $applicationScope:foo pageContext.getAttribute("foo", PageContext.APPLICATION_SCOPE) For example, to find the bar element whose x attribute equals the value of the HTTP request parameter named paramName :
/foo/bar[@x=$param:paramName]Java Type to XPath Type Mappings XPath Type Java Type java.lang.Boolean boolean java.lang.Number number java.lang.String string Object exported by <x:parse> node-set Please note that JSTL, as of version 1.2,...
Created by voodoo on August 12, 2010 22:50:41 Last update: August 12, 2010 22:50:41
To see if the current user has execute permission on crypt :
select has_function_privilege('crypt(text, tex...
Created by voodoo on August 12, 2010 22:46:28 Last update: August 12, 2010 22:46:28
To display information about the function crypt :
select * from pg_proc where proname = 'crypt'; ...
Created by James on July 07, 2010 16:24:30 Last update: July 07, 2010 16:24:30
Select the last cell in a row for all rows:
$('td:last', '#sessionsTable tr').each(function() ...Select the 3rd cell in a row for all rows:
$('td:eq(3)', '#sessionsTable tr').each(function()...
Created by Dr. Xi on November 18, 2009 22:53:33 Last update: November 18, 2009 22:56:17
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...