msgbartop
News, views, tips and tricks on Oracle and other fun stuff
msgbarbottom

Read XML from an HTTP POST

First, let’s see how you can post XML over HTTP to another page. This is very simple in ColdFusion:

<cfhttp url="url_to_post_to" method="post">
   <cfhttpparam 
        type="XML" 
        name="XmlDoc" 
        value="#your_xml#">
</cfhttp>

Now, suppose you are posting the XML to a ColdFusion page. How would you read the XML from the HTTP POST body? Again, this is very simple in ColdFusion:

<cfset docContent = GetHTTPRequestData().content>
<cfset myDOM = XmlParse(docContent)>

and now you can manipulate the XML DOM, stored in myDOM, in any way you like.

<cfhttp> documentation
GetHTTPRequestData documentation
ColdFusion XML documentation

Comments Off | Filed in ColdFusion, Tips | Tags: ,


Oracle Regular Expressions

If you want to improve your ability to search and manipulate character data, regular expressions, a notation for describing textual patterns, is for you. And if you have Oracle Database 10g, you’re in luck, as the regular expressions feature was introduced starting with that release. Here are a couple of links that will help you understand and use regular expressions in your Oracle code (courtesy of Robert Vollman):

  1. Article at oracle.com
  2. Reference at psoug.org
1 Comment | Filed in Oracle | Tags: ,


Strong Encryption in ColdFusion MX 7

The encrypt and decrypt functions have been enhanced in CFMX7 to accept optional arguments that are not in the ColdFusion MX 7 documentation.

The arguments to the encrypt and decrypt functions are changed as follows:

Encrypt(string, key, [algorithm ,encoding ,IVorSalt ,iterations])

Decrypt(string, key, [algorithm ,encoding ,IVorSalt ,iterations])

Read the complete ColdFusion technote here.

Comments Off | Filed in ColdFusion | Tags: ,


COUNT(*) vs COUNT(1)

Which one to use? COUNT(*) or COUNT(1)? Tom Kyte’s answer.

1 Comment | Filed in Oracle, Tips | Tags:


User-Defined Aggregate Functions

I had a requirement to write a query that should return a concatenation of column values from different rows and grouped by another column. Well, that would be easy if Oracle provided an aggregate function similar to SUM or COUNT for example, but instead of summing or counting, it would concatenate. Alas! There is no such pre-defined function in Oracle. But, don’t despair. Oracle has something called user-defined aggregate functions, meaning that you can define your own aggregate function, or even change the behavior of a pre-defined one such as MAX, MIN, SUM.

User-defined aggregate functions are used in SQL DML statements just like Oracle’s own built-in aggregates. Once such functions are registered with the server, Oracle simply invokes the aggregation routines that you supplied instead of the native ones.

User-defined aggregates can be used with scalar data too. For example, it may be worthwhile to implement special aggregate functions for working with complex statistical data associated with financial or scientific applications.

User-defined aggregates are a feature of the Extensibility Framework. You implement them using ODCIAggregate interface routines.

For more information see chapter 11: User-Defined Aggregate Functions in Oracle9i Data Cartridge Developer’s Guide.

3 Comments | Filed in Oracle | Tags: , ,


Flash CFFORM Gotcha

I had a problem with a flash CFFORM. It would not show up in Internet Explorer. However, Firefox had no problem displaying it. The flash form was part of an application using the Mach-II framework (which I’m converting now to Model-Glue). I had a general layout template in which I included the body of the main page. My layout template was like this (simplified here for demonstration purposes): Continue reading…

2 Comments | Filed in ColdFusion, Tips | Tags: , ,


Happy July 4th


My wife Jasmine, my son George and I went to the water front in downtown Portland, Oregon to see the fireworks display. It was awesome and we had lots of fun.

Comments Off | Filed in Personal


Oracle Metalink Hacking

Read (PDF) how easy it is to find sensitive information like unknown security bugs, … with Oracle Metalink.

Comments Off | Filed in Oracle | Tags: , ,


Tom Kyte’s Oracle magazine articles archive

For great Oracle tips and tricks, read Tom Kyte’s Oracle magazine articles archive.

Update: Here is another link to Oracle Magazine Ask Tom Columns. I found it here.

Comments Off | Filed in Oracle | Tags: ,


Quick Reference Cards

Quick Reference Cards is a web page containing a collection of PDF documents that you can reference when working on many technologies like Oracle, Java, SQL, XML, and many other categories.

Comments Off | Filed in Technology | Tags: