Re: loading data from spread *** to oracle database

From: onedaywhen (onedaywhen_at_fmail.co.uk)
Date: 02/11/04


Date: 11 Feb 2004 01:36:53 -0800

The preferred convention is to specify in the SELECT clause the
columns you require, rather than use SELECT * . There are all kinds of
good reasons for this (e.g. with no names to go on the DBMS must
consult a data dictionary and thereby increase execution time, adding
a further column with a constraint to the table will break your app,
you are taking it on faith the columns will appear in the correct
order but what if you port to a new version or another DBMS, etc)
which you probably don't think apply to your app, but I thought I
should point this out.

--
ravinookala <<ravinookala.11fys4@excelforum-nospam.com>> wrote in message news:<ravinookala.11fys4@excelforum-nospam.com>...
> Hi
> 
> Thank you very much for your help.
> 
> It is not necessary to select the field names in the record set.
> If it is so, my programme will become hardcoded.
> I have done it dynamic as under and working fine.
> 
> intFieldsCount = RS.Fields.Count
> v_rowcount = Range("A1").CurrentRegion.Rows.Count - 1
> With RS
> For i = 0 To v_rowcount - 1
> RS.AddNew
> For j = 0 To intFieldsCount - 1
> If IsEmpty(ActiveCell.Offset(0, j)) = True Then
> .Fields(j).Value = Null
> Else
> .Fields(j).Value = Trim(ActiveCell.Offset(0, j))
> End If
> On Error Resume Next
> Next j
> RS.Update
> ActiveCell.Offset(1, 0).Select
> Next i
> End With
> 
> Ravi Nookala
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/