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 -> Dynamic SQL

Dynamic SQL

From: <pawanputra_at_hotmail.com>
Date: 1998/01/15
Message-ID: <884723846.1488125956@dejanews.com>#1/1

Hi Friends,
> I have a requirement to generate an interactive report using
> SQL*Plus where the users are reuired to input some values and these are
> used to generate the report. The problem is like this:
>
> There are two tables A & B. Table A has 30 columns - 12 of these
> are NUMBER datatype and 18 are VARCHAR2 datatype. Suppose the user is
> required to input values for 4 columns - colA,colB,colC and colD (in
> actual case user may be required to input values for 15 columns). The
> query looks something like this :
>
> Select a.colA,a.colB,a.colC, a.colD,b.Col_1,b.col_2
> from A a, B b
> where a.colA= b.col_3
> and a.colB = constant

	  and a.colC = b.col_1
          and a.colD = a.colZ
          etc.

The values of colA,colB,colC,colD are input interactively by the user ( like PROMPT & ACCEPT). If the user inputs a wrong datatype for any one of the columns then an error should be raised. Also if the user presses CARRIAGE RETURN for any column ( say colD) then the WHERE clause should be modified to: Select a.colA,a.colB,a.colC, a.colD,b.Col_1,b.col_2

> from A a, B b
> where a.colA= b.col_3
> and a.colB = constant

	  and a.colC = b.col_1
          etc.

I am at wits as to how to proceed. has anyone faced a similar problem? Will appreciate any help.
Thanks in advance.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet
Received on Thu Jan 15 1998 - 00:00:00 CST

Original text of this message

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