Hi Nicolas,

>  That works, thanks to your help. But, when I try to load 
> datas with a empty file I get the following message:
> Error during execution
> -->-25362
> No data to load in datafile 
> /users/ifmxdata/qw_regie.exp/y01__00100.unl.
> Is there a way to tell loadercli no to report an error when 
> data stream is empty, just keep on ?

using the commandline interface *loadercli* of SAP DB Loader you can't
handle exceptions other than in the standard way. 
use the python,perl,java interfaces *loader* of SAP DB Loader to write your own 
exception handler. in python you could do something like this:

from   sapdb import loader

try :
     session = loader.Loader('<yournode>','<yourdb>')
except loader.CommunicationError, err :
     print 'loader communication failed:', err

def_yourcmd()
    try :
          session.cmd ("%s" % <yourcmd> )
    except loader.LoaderError, err:
        if err.errorCode == -25362 :
           pass
        else:
           print 'command failed: ', err         


-- 
Hans-Georg Bumes
SAP DB, SAP Labs Berlin
http://www.sapdb.org/




 
> > -----Message d'origine-----
> > De : [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] la part de Bumes,
> > Hans-Georg
> > Envoy� : mardi 15 juillet 2003 17:11
> > � : [EMAIL PROTECTED]
> > Cc : 'Nicolas JOUANIN'
> > Objet : RE: Loading datas without column specification
> >
> >
> > Hi Nicolas,
> >
> > >   - Is it possible to load datas without specifying columns ?
> > >     which should be possible knowing the delimiter and the
> > table structure.
> >
> > no, you have to declare an explicit mapping from record-fields in
> > the file to
> > row-columns in the table
> >
> > >   - what is the the correct instruction to load such a file ?
> >
> > you can use the dataextract for dataload or dataextract for
> > fastload statement
> > to generate most part of the loadstatement.
> > the ( sligthly modified ) result for your tabledefinition is.
> >
> > //
> > SET COMPRESSED       '/|//'
> > //
> > FASTLOAD WITH 80% USAGE TABLE "BRA"
> > "BRA_ID" 1 CHAR
> > "CPY_ID" 2 CHAR
> > "CUR_ID" 3 CHAR
> > "LNG_ID" 4 CHAR
> > "THR_ID" 5 CHAR
> > "XDV_ID" 6 CHAR DEFAULT NULL
> > "BRA_SCREEN" 7 CHAR
> > "BRA_MAIN" 8 CHAR
> > "BRA_TAX_TRADEIN" 9 CHAR
> > "BRA_EECEXP" 10 CHAR DEFAULT NULL
> > "BRA_EECIMP" 11 CHAR DEFAULT NULL
> > "XCL_ID" 12 CHAR DEFAULT NULL
> > "BRA_ID_SETTING" 13 CHAR
> > "BRA_ID_DEFAULT" 14 CHAR
> > "BRA_ID_PRICING" 15 CHAR
> > "BRA_ID_WAP" 16 CHAR
> > "BRA_MEASURE" 17 CHAR
> > "TAD_ID" 18 CHAR DEFAULT NULL
> > "BRA_ACCT" 19 CHAR DEFAULT NULL
> > "BRA_ID_AR" 20 CHAR DEFAULT NULL
> > INSTREAM  FILE  'bra.dat'
> >  COMPRESSED ASCII
> > DECIMAL '//./'
> > DATE INTERNAL
> > TIME INTERNAL
> > TIMESTAMP INTERNAL
> > NULL ''
> > BOOLEAN 'TRUE/FALSE'
> > //
> >
> > --
> > Hans-Georg Bumes
> > SAP DB, SAP Labs Berlin
> > http://www.sapdb.org/
> >
> >
> > > -----Original Message-----
> > > From: Nicolas JOUANIN [mailto:[EMAIL PROTECTED]
> > > Sent: Dienstag, 15. Juli 2003 14:14
> > > To: sapdb
> > > Subject: Loading datas without column specification
> > >
> > >
> > > Hi,
> > >
> > >    still tying to migrate ..... here's the next trick.
> > >
> > > Let's say a table:
> > > create table bra
> > >   (
> > >     bra_id char(4) not null ,
> > >     cpy_id char(4) not null ,
> > >     cur_id char(3) not null ,
> > >     lng_id char(3) not null ,
> > >     thr_id integer not null ,
> > >     xdv_id decimal(4,0),
> > >     bra_screen char(15) not null ,
> > >     bra_main decimal(1,0)
> > >         default 0 not null ,
> > >     bra_tax_tradein decimal(1,0)
> > >         default 1 not null ,
> > >     bra_eecexp decimal(1,0)
> > >         default 0,
> > >     bra_eecimp decimal(1,0)
> > >         default 0,
> > >     xcl_id char(6),
> > >     bra_id_setting char(4) not null ,
> > >     bra_id_default char(4) not null ,
> > >     bra_id_pricing char(4) not null ,
> > >     bra_id_wap char(4) not null ,
> > >     bra_measure decimal(1,0)
> > >         default 0 not null ,
> > >     tad_id integer,
> > >     bra_acct char(4),
> > >     bra_id_ar char(4)
> > > )
> > >
> > > and a data file (bra__00401.unl):
> > > 01|0001|EUR|1|6||TP 
> LR|1.0|0.0|1.0|1.0|FRANCE|01|01|01|01|1.0|6||01|
> > > 02|0001|EUR|1|8||TP Paris|0.0|0.0|||FRANCE|01|01|01|01|1.0|8||01|
> > > 03|0001|EUR|1|9||TP Lyon|0.0|0.0|||FRANCE|01|01|01|01|1.0|9||01|
> > > AG01|0002|EUR|1|969||AG
> > > LR|1.0|0.0||||AG01|AG01|AG01|AG01|1.0|971||AG01|
> > > AG02|0002|EUR|1|970||AG
> > > Lyon|0.0|0.0||||AG01|AG01|AG01|AG01|1.0|972||AG01|
> > > LC01|0005|EUR|1|975||LC
> > > LR|1.0|0.0||||LC01|LC01|LC01|LC01|1.0|977||LC01|
> > > LC02|0005|EUR|1|976||LC
> > > Toulouse|0.0|0.0||||LC01|LC01|LC01|LC01|1.0|978||LC01|
> > > LC03|0005|EUR|1|977||LC
> > > Marseille|0.0|0.0||||LC01|LC01|LC01|LC01|1.0|979||LC01|
> > > NG01|0004|EUR|1|978||NG
> > > Paris|1.0|0.0||||NG01|NG01|NG01|NG01|1.0|980||NG01|
> > > PL01|0003|EUR|1|979||PL
> > > Nantes|1.0|0.0||||PL01|PL01|PL01|PL01|1.0|981||PL01|
> > > UK01|2001|EUR|0|989||UK
> > > Birmingham|1.0|0.0||||UK01|UK01|UK01|UK01|1.0|999||UK01|
> > > IM01|IMUK|EUR|0|997||IM
> > > Brussels|1.0|0.0|||FRANCE|IM01|IM01|IM01|IM01|1.0|1009||IM01|
> > > UK02|2001|EUR|0|1006||London|0.0|0.0||||UK01|UK01|UK01|UK02|1.
> > > 0|1019||UK01|
> > > UK03|2001|GBP|0|1007||Liverpool|0.0|0.0|||FRANCE|UK01|UK01|UK0
> > > 1|UK03|1.0|102
> > > 0||UK01|
> > >
> > > I found easy to use loadercli to create the table AND fill
> > > the data at the
> > > same time, so I put the following instruction AFTER the table
> > > creation:
> > >
> > > FASTLOAD
> > > TABLE bra
> > > INFILE '/users/ifmxdata/qw_regie.exp/bra__00401.unl'
> > > DELIMITER '|'
> > > NULL ''
> > >
> > > Error during execution
> > > -->-25319
> > > Missing data for specified column CPY_ID.
> > >
> > > My questions are:
> > >   - Must I precise columns in the fastload commande like:
> > >           FASTLOAD TABLE bra
> > >                   bra_id 1
> > >                   cpy_id 2
> > >                   ....
> > >   - Is it possible to load datas without specifying columns ?
> > > which should be possible knowing the delimiter and the 
> table structure.
> > >   - what is the the correct instruction to load such a file ?
> > >
> > >
> > _______________________________________________
> > sapdb.general mailing list
> > [EMAIL PROTECTED]
> > http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to