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: Help with dynamic insert

Re: Help with dynamic insert

From: Howard J. Rogers <howardjr2000_at_yahoo.com.au>
Date: Wed, 5 Feb 2003 06:16:11 +1100
Message-ID: <nbU%9.40475$jM5.102996@newsfeeds.bigpond.com>


Wouldn't it be easier as he creates the table to do it with a CTAS where rownum <2. That way he gets one row of data. Follow that up with an update of all fields, and you have your 8888's?

Just a thought.

Regards
HJR "Ryan Gaffuri" <rgaffuri_at_cox.net> wrote in message news:1efdad5b.0302031226.63fa6a41_at_posting.google.com...
> Trying to help someone do this. Its not for the application. He is
> trying to fix some crystal reports and wants a utility.
>
> Basically he is going to create a table or a view at runtime. The view
> will be based on an existing table but will have no data. He then
> wants to populate all the fields in that view with 8's. However, he
> wants the 8's to be as long as the field length. Columns will either
> be Number or Varchar.
>
> For example, you have a field length of 10. Add 88888888 and so on.
>
>
> Im having trouble with coming up with a simple insert statement.
>
> I can build v_fields from a loop and add commas, but cycling through
> USER_TAB_COLUMNS
>
> EXECUTE IMMEDIATE 'INSERT INTO TABLE '||
> '('||v_fields||')'||
> 'VALUES'( <now what do I here to make it dynamic?>)'
Received on Tue Feb 04 2003 - 13:16:11 CST

Original text of this message

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