$0.02 98 cents short

2May/120

Quick Tip: Oracle REGEXP_REPLACE

I've always thought of regular expressions as party tricks used at a Magna Cum Laude party at MIT. I still do. Regular expressions are a mystery wrapped in enigma and set in a field shrouded in a thick mental fog. Unfortunately, I occasionally need to venture into that party in the foggy field to retrieve a domain name from a URL for example.

Select All Code:
1
SELECT REGEXP_REPLACE('https://mail.somedomain.com/flippyWidgets','.+:\/\/([^/]+).*', '\1') FROM dual

You can also do this in JavaScript...

Select All Code:
1
2
var url = "https://mail.somedomain.com/flippyWidgets/index.html?unread=954";
alert(url.match(/:\/\/(.[^/]+)/)[1]);

 

Filed under: JavaScript, Oracle No Comments
9Feb/122

Quick Tip: Getting EXP to Shut Up

Today I found out that what I thought was standard output from Oracle's export utility, exp, is actually error output. In trying to get exp to run quietly in the background while I continue to use the shell, I tried running "exp silent=y &" and I still got all the wonderful exporting this table and exporting that object. On a +160GB database, that takes a while and is a bit annoying. So, I tried running "exp > output.txt &" to pipe the output to a file. No luck.
Finally, I learned that "command > file" in Linux writes standard output to file and is really just a short cut for "command 1> file." So, I used "exp 2> output.txt &" and nothing. Beautiful nothing. No pages and pages of scrolling output. I'm not sure why all that informational output can't be turned off in the command line or why it's sent out in the error output stream. Enjoy.

Filed under: Linux, Oracle 2 Comments
23Aug/111

Using a DBLink in Oracle to Connect to an IBM DB2 Database

I've been working with Oracle since version 8.0 and have wanted to be able to select * from some.table@db2 within Oracle since version 8.0. The technology has existed but it was never easy enough for me. There were heterogeneous services which sounds pleasant but I never could get it to work. So, I've worked through 8i, 9i, 10g and finally 11g. In 11g I've finally made the connection. Literally.

Filed under: Oracle Continue reading
19Aug/110

Droid ROM and Launcher

I have found my (new) favorite Droid ROM and launcher combination: metiCkMod and ADW Launcher.

Filed under: Other Continue reading
26Jul/110

I’m not all data and no play…

I also tinker in logo design mostly as just a hobby. Here's a few of my designs. Also, if you need a logo or a WordPress theme or some other design work done, I highly recommend 99designs.com. If you're a graphic designer looking to establish a reputation and a few extra bucks, I definitely recommend 99designs.com.

Need a Logo Design? Go to 99designs

Filed under: Personal No Comments

Switch to our mobile site