6 useful Oracle commands

Written on 26 March 2011, 12:43pm

Tagged with: , ,

This is more of a reference post to store some useful Oracle features. Or a cheat sheet if you wish 🙂

1. How to find the maximum column size in a table


select
       max(vsize(mycol))
from
       mytable;

2. How to paginate in Oracle using rownum

Method 1:


select * from 
( 
       select rownum r, a.* from 
       (
             YOUR_QUERY
       ) a 
       where rownum < = 10
) 
where r >= 1;

Method 2: (more…)

ColdFusion: custom tags location

Written on 21 March 2011, 03:17pm

Tagged with:

Just bookmarking this:

1. In the same directory as the calling page – while this is easy for demonstration purposes, it’s not very practical, as it means that the custom tag is only available within that directory.
2. In a directory (or subdirectory of a directory) specified in ColdFusion Administrator under Extensions -> Custom Tag Paths.
3. In the cfusion/CustomTags directory or one of its subdirectories.

– CF tutorial

This post highlights the difference between the ColdFusion Administrator Mappings section and the virtual directories.
The ColdFusion 8 and 9 Admin documentation pretty much explains everything (see highlighted note):

ColdFusion mappings let the cfinclude and cfmodule tags access pages that are outside the Web root. If you specify a path that starts with the mapping’s logical path in these tags, ColdFusion looks for the page using the mapping’s directory path.
ColdFusion also uses mappings to find ColdFusion components (CFCs). The cfinvoke and cfobject tags and CreateObject function look for CFCs in the mapped directories.
Note: These mappings are independent of web server virtual directories. If you would like to create a virtual directory to access a given directory through a URL, please consult your web server documentation.

So, the mappings defined in the CF Admin (CFAdmin > Server Settings > Mappings) are defined so that ColdFusion is able to access pages outside of your web root. That’s because ColdFusion will not ‘see’ the virtual directories defined in your web server configuration.
Either if you use the JRun server, Apache or other flavors, the ColdFusion will not know anything about their configuration.

Let’s take an actual example: (more…)