Re: pl/sql help please..should be easy

From: Loyal Barber <lbarber_at_nospam.flash.net>
Date: Wed, 07 Apr 1999 17:57:17 GMT
Message-ID: <370B9C7C.9CE27571_at_nospam.flash.net>


Bill Long wrote:

> posted to:
> comp.databases.oracle.tools
> comp.databases.oracle.mics
>
> could somebody please help me? i'm stuck on a problem and i'm not sure
> if i'm doing it wrong or you just cant do it in pl/sql.
>
> assume i have the variables
> where_mod varchar2(1024);
> valuea varchar2(10);
> later on in my procedure i have something to the effect of
>
> valuea = '26';
> where_mod := 'column3 = ' || valuea;
>
> now if i have an insert statement something to the affect of
>
> insert into tablea
> select
> column1,
> column2,
> column3
> from tableb
> where
> column1 = value
> and column2 = value
>
> how do i modify the where clause to get my where_mod to be part of it?
>
> i have tried
> insert into tablea
> select
> column1,
> column2,
> column3
> from tableb
> where
> column1 = value
> and column2 = value
> and || where_mod
>
> and
> insert into tablea
> select
> column1,
> column2,
> column3
> from tableb
> where
> column1 = value
> and column2 = value
> || where_mod;
> after i did where_mod := 'and ' || where_mod;
>
> i cant get it to work. any ideas? can it even be done? or is there
> another way to do it?
>
> any help would be MOST appreciated.
> bill
> --
> www.bellanet.com - very nice web hosting services
> - web application services
>
> www.giftsgalore.com : www.longboys.net
> telnet://undying.longboys.net:4000 http://undying.longboys.net

You failed to mention the tool you are using. For example, in Oracle Reports you can do something very similar to what you are saying. SQL*Plus handles it in a different way and Forms handles it in still another way. Pro*C uses a form of dynamic SQL. In other words, there is not just one answer, so what is the tool you are using?

Loyal Barber
BLT Soft Incorporated

--
The difference between Windows 95 and 98?
3!
Received on Wed Apr 07 1999 - 19:57:17 CEST

Original text of this message