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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Parameters in query

Re: Parameters in query

From: Italo Bozzi <ibozzi_at_cochrane.cl>
Date: Thu, 15 Apr 1999 17:15:22 -0400
Message-ID: <CEsR2.31$j47.460@maule>


Arild,

To solve your problem, first you need to create a flat file *.SQL (f.e.: ASKDPT.SQL), and write inside the SQL code. After that, from your SQL*Plus you can execute the SQL file with the '@' (i.e.: @ASKDPT). Down you can find an example code.

PROMPT
PROMPT Please enter a valid department
PROMPT For example: 10, 20, 30, 40
ACCEPT NEWDEPT NUMBER PROMPT 'DEPT:> '
SELECT DNAME FROM DEPT
WHERE DEPTNO = &NEWDEPT Best regards and good luck!

Italo Bozzi
Oracle DBA
ibozzi_at_cochrane.cl
ibozzi_at_yahoo.com

Arild Kvalbein escribió en mensaje ...
>Hi,
>
>I know this must be a newbie question, but I'm only using Oracle (UNIX) for
>a school project...
>How do I create a parameterized query/view in Oracle?
>In MS Access I would f.ex write SELECT * FrOM Table WHERE Name=[Your
>Name:];, which would open ea requester asking "Your Name:" when the query
is
>run.
>Is there any way to do this in Oracle?
>
>
>---
>Arild Kvalbein
><arkvalbe_at_online.no>
><arild_at_c-map.no>
>
>
>
Received on Thu Apr 15 1999 - 16:15:22 CDT

Original text of this message

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