Monday, May 16, 2005

ORACLE: What is the difference between & and &&?

Culled from here.

What is the difference between & and && in a SQL script:

"&" is used to create a temporary substitution variable that will prompt you for a value every time it is referenced. Example:

SQL> SELECT sal FROM emp WHERE ename LIKE '&NAME';
Enter value for name: SCOTT
old 1: SELECT sal FROM emp WHERE ename LIKE '&NAME'
new 1: SELECT sal FROM emp WHERE ename LIKE 'SCOTT'

SAL
----------
3000

SQL> /
Enter value for name: SCOTT
old 1: SELECT sal FROM emp WHERE ename LIKE '&NAME'
new 1: SELECT sal FROM emp WHERE ename LIKE 'SCOTT'

SAL
----------
3000
"&&" is used to create a permanent substitution variable. Once you have entered a value (defined the variable) its value will used every time the variable is referenced. Example:

SQL> SELECT sal FROM emp WHERE ename LIKE '&&NAME';
Enter value for name: SCOTT
old 1: SELECT sal FROM emp WHERE ename LIKE '&&NAME'
new 1: SELECT sal FROM emp WHERE ename LIKE 'SCOTT'

SAL
----------
3000

SQL> /
old 1: SELECT sal FROM emp WHERE ename LIKE '&&NAME'
new 1: SELECT sal FROM emp WHERE ename LIKE 'SCOTT'

SAL
----------
3000

[Listening to: Will Smith - Will 2K]

Fixed typo in subject

Friday, May 13, 2005

What Pre-1985 Video Game Character Am I?

I normally don't post the results of these (although I must admit that I participate in every one) but I just couldn't resist:


What Video Game Character Are You? I am an Asteroid.I am an Asteroid.


I am a drifter. I go where life leads, which makes me usually a very calm and content sort of person. That or thoroughly apathetic. Usually I keep on doing whatever I'm doing, and it takes something special to make me change my mind. What Video Game Character Are You?

I'm not sure which part I like best: being summed up by a classic video game; being summed up by one of my favourite games from back in the day; or being summed up by a rock. In any case: sweeet.

Tuesday, May 10, 2005

ORACLE: Creating tablespaces

Scooped from here:

Normal a.k.a. Permanent a.k.a. Data

create tablespace {TABLESPACE-NAME}
logging
datafile 'C:\path\relative\to\oracle\server.dbf'
size 32m
autoextend on
next 32m maxsize 2048m
extent management local;

Temporary
create temporary tablespace {TABLESPACE-NAME}
tempfile 'C:\path\relative\to\oracle\server.dbf'
size 32m
autoextend on
next 32m
maxsize 2048m
extent management local;


[Listening to: Disturbed - Stupify]

Monday, May 09, 2005

RSS Bandit 1.3 - Recovering disappearing menus and toolbars

I'm using RSS Bandit 1.3.0.29 (although I've seen this problem in earlier versions of 1.3 as well.) Occasionally all the menus and toolbars just disappear on me. The Feed Subscriptions tab, Search Tab and Feed Details Tab are still there but nothing else.

The bigger problem seems to be the fact that I can't find anywhere to right click to bring up the toolbar customization dialog to make them visible again.

Here's what you need to do to get them back:

Navigate to the AppSettings folder for RSS Bandit (C:\Documents and Settings\dmontgomery\Application Data\RssBandit on my machine) and edit the file .settings.xml

Look for a line like this (note that you're looking for "&lt;Toolbar", not "<Toolbar":

   &lt;Toolbar Guid="c95feca6-b21e-4660-ad20-8e8e5b9fe26c" DockLine="15" DockOffset="2" Visible="False" Container="f7942d78-c06c-44f8-943e-b0f68611be66"&gt;

Change Visible="False" to Visible="True"

Start up RSS Bandit again. This should make the "Main Tools" toolbar visible. Now you can right click to enable the rest.

Occasionally I need to change the DockLine setting too, but I can't remember what the "bad" value was.

I figure it's probably something to do with switching between a dual monitor setup to a single monitor or vice versa, but I'm not sure.

[Listening to: Guns N' Roses - Bad Apples]

Thursday, May 05, 2005

Give your DLL a dedicated config file - level 300

Jeffrey Palermo has some sample code on how to give your DLL a dedicated config file. This is just as useful as a sample of how to throw together an app domain.

[Listening to: Down - Stone the Crow]

Tuesday, May 03, 2005

XML Documentation

Alan Dean is posting a series on using XML Documentation:

  • Part 1: The Overview
  • Part 2: The Detail
  • Part 3: Complex Tables.

  • I've always been a fan of XML Documentation, but the coolest bit for me are the undocumented tags (like <event>) and the undocumented switches in a cref attribute in <see>.

    Nice job Alan.

    [Listening to: Jethro Tull - Broadsword]

    Update: Change title to reflect the series, not just the first article. I've gotten lazy with the "BlogThis" button.

    Monday, May 02, 2005

    ORACLE: Using ROWNUM or SORT with UNION

    [Pulled from dbforums]

    If you want to use ROWNUM or SORT across the results of a UNION:

    SELECT *
    FROM (
        SELECT employee_id, last_name, first_name
        FROM   EMPLOYEES
        UNION
        SELECT department_id, 'DEPT', department_name
        FROM   DEPARTMENTS
    )
    WHERE ROWNUM < 100
    ORDER BY last_name;


    * I realize this is a brutaly contrived example, but hey, whaddaya expect?
    ** I have no idea how this performs.

    ORACLE: Tidbits

    I'm starting to read up on Oracle and figure the beast out. Naturally the first thing I do is to subscribe to the I Hate Oracle Club (IHOC). I'm still trying to figure out a way to order the mug or T-Shirt.

    I figure I'll post whatever little tidbits I come across that I found useful. Mostly so I don't have to remember them myself.

    [Listening to: Static-X - Cold]

    Encrypting app.config configuration sections in Whidbey

    Pulled from That Indigo Book: A nice easy way to encrypt an app.config (or web.config) configuration section. It's the little things.

    [Listening to: Lisa Loeb - Dance with the Angels]

    Catching up

    It's long past time I started making my way through the "To Blog" queue. Here goes nothing...