Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL in ksh script question

Re: SQL in ksh script question

From: Mark Styles <lambicm_at_yahoo.com>
Date: Mon, 12 Oct 1998 14:11:15 GMT
Message-ID: <36220da6.21973426@news.intra.bt.com>


Mon, 12 Oct 1998 09:50:51 -0400, yogurt_at_stratos.net (yogurt) rambled:

>When I try to execute the following SQL from within a ksh script,
>the "$" (dollar sign) in v$sqlarea causes a problem, because
>the korn shell interprets it as a variable and the SQL fails:
>
> select substr(sql_text,1,30) sql , count(*)
> from v$sqlarea;
>
>Your help is appreciated.

Escape it with a backslash:

select substr(sql_text,1,30) sql , count(*) from v\$sqlarea;

You also need a group by.

Mark Styles
Spam my account, lose your account. Clear enough? Religious tolerance is an oxymoron. Received on Mon Oct 12 1998 - 09:11:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US