SQL Question
Posted in 1999
Topics: Migration, Import/Export & Data Conversion
Howdy Folks, I have few unloads that are done reguarly, 1 of these unloads is used to upload the data into an access database. The Access database requires quotes (") around text fields, currently this is being done manually using find and replace through vi - this can be automated at the Unix level using sed, but ideally, I would like the Informix unload process to do this. I seem to think that there is a way of doing this - has anyone any ideas ? Thanks in Advance. Suze.
Susan Elliott (ISG) wrote:
> Howdy Folks,
>
> I have few unloads that are done reguarly, 1 of these
> unloads is used to upload the data into an access database.
> The Access database requires quotes (") around text fields,
> currently this is being done manually using find and replace through vi -
> this can be automated at the Unix level using sed, but ideally, I would like
> the Informix unload process to do this. I seem to think that there is a way
> of doing this - has anyone any ideas ?
How about coding it into your unload query?
UNLOAD TO file.unlSELECT """" || charcol || """", intcol, datecol, """" || varcharcol || """"
FROM tablename
June
--
june_t@hotmail.com
Grounded in Palo Alto, living on KitKat bars
In article <77e46c$53f$1@news.xmission.com>, "Susan Elliott (ISG)" <SusanE@fclcis.co.nz> wrote: > > > Howdy Folks, > > I have few unloads that are done reguarly, 1 of these > unloads is used to upload the data into an access database. > The Access database requires quotes (") around text fields, > currently this is being done manually using find and replace through vi - > this can be automated at the Unix level using sed, but ideally, I would like > the Informix unload process to do this. I seem to think that there is a way > of doing this - has anyone any ideas ? > > Thanks in Advance. > > Suze. > > Hallo Susan, first do not call (ms)access a database. It is not necessary to quote the text fields in access, look in 'Import Text Wizard' -> 'Settings Import Specification': there you can set 'Text Qualifier' to '{none}'. In SQL you can concatenate strings with || , it means you write your select within unload: select '"' || textField1 || '"' from yourTable Regards Christoph -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own