Amir,

Functionally you can do the same this in two steps using the export (which
supports the fetch on first N rows) and import utility.

I would have to speculate on why DB2 doesn't allow mass insert with "fetch first
N rows only".  I would guess it has to be because you are building a result set
(the source rows) and then saying give me the first N rows only.  Since you, and
DB2, don't know which rows are being inserted he (DB2) gets upset.  DB2 wants
you and him to be intimately and completely aware of which rows go into yours
and his tables.

Good luck,

Roy

Amir Sadeghi wrote:

> Hi Team,
>
> I would like to perform the following statement to insert some rows into a
> test table. DB2 is giving me a syntax error complaining about 'SQL0104N  An
> unexpected token "fetch" was found following "from"
>
> "insert into test select empl_num from incschem.employee fetch first 10 rows
> only"
>
> Does anyone know why this syntax is not allowed?
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> =====
> To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
> For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod


=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

Reply via email to