How to go about in doing this?

How to go about in doing this?

Post by Michelle Lond » Fri, 02 Apr 1999 04:00:00

Hi.  I'm relatively new to SQL scripting.  I've looked at various
reference books, but they are not very helpful.  Thus, any
assistance/suggestions will be greatly appreciated!  

I have a tab-delimited flat file that I need to BCP into a table
called FINAL.  I cannot do a straight BCP of the flat file into the
FINAL table because the data file contains more fields than the FINAL
table.  Also, the data in the flat file needs to be processed.  

For example, adding field2 and field3 of the data file = field2 of the
FINAL table.  

Another example:  If field5 in FINAL table = 0, then populate field6
of FINAL table with field7 of data file.  Otherwise, populate field6
of FINAL table with field8 of data file.

What would the coding look like in the above examples?

I believe I will have to create a temp table that will store all the
fields in the data file.  The temp table will have to have the same
number of fields in the flat file.  Then, I would do the data
processing from this temp table.  Would the results of the data
processing have to go into another temp table?  Or could I do
something else?  I guess this is the part where I'm struggling with.

Once again, any assistance/suggestions will be greatly appreciated!  

Michelle London


1. Gone and done it.

Well, in my quest to figure out the 1105 Errors I was getting, and doing
some experimenting, I have set the tempdb to single user mode.

I can no longer gain access to the sql server to set single user mode

Is there any procedure call that I can do via iSQL to make the database
go out of single user?  Or am I am whacked here as I think I am.

Any help on this one would be greatly appreciated. :)

-Bob Myers
UNIX and NT systems administrator
The Networks, Inc

2. Macintosh ODBC driver

3. Going rate for a DBA with Applications Experience - doing contract work

4. Help 1GB transaction log

5. Help with doing recursion in oracle: how to have sql go thru list of values

6. Upgrade from 9.21 32 bit to 9.30 64bit on HPUX11

7. Going, going, gone

8. Export Query...Please Help!!

9. ADO thinks DBMS is done, but DBMS ain't done

10. Trigger doing UNLOAD to file OR calling Store Procedure doing the UNLOAD to file

11. Caché from InterSystems - doing wh at other MV vendors should be doing

12. Auto Paging when SQL Server Goes Down or Goes Up

13. What went wrong with ODBC when I went to MSVC++ v6