Results 1 to 8 of 8

Thread: Append from

  1. #1
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893

    Append from

    Hi all,
    I'm tryng to use the "Append from" to append a CSV inside a Lianja Table, but do not work..
    It create all the row, but empty.
    what can be the problem?

    I've try with DBF table from VFP and from CSV, but is the same.

    This is
    Code:
    punto;DATA;AREA;MACROGRUPPO;STATO;PRIORITA';PUNTI APERTI
    1;16/06/2014;COGE;ECONTO;C;;SPOSTATO IN ATTIVITA' DA FARESistemazione TAXWITHHOLDTRANS per i quei fornitori Under35 (no tax area)
    2;16/06/2014;PROV;PROV;IN CORSO;;Controllo provvigioni 2014 in merito a mandati, calcoli, flag articoli, sistemazione Caliri
    3;16/06/2014;COGE;ALTRO;C;;Chiusure bilancio (conto transitorio effetti, ecc.)
    4;16/06/2014;COGE;ALTRO;;;Registro tirature (analisi fatta con Quitadamo e Francesca)
    5;16/06/2014;COGE;ALTRO;;;Mappatura casistiche clienti per la gestione dei registri tirature
    6;16/06/2014;VARI;ALTRO;;;Regole di caricamento dati ana clienti e fornitori (CF, ecc.)
    7;16/06/2014;COGE;ECONTO;TEST;;Giorni rischio su assegni (memorizzarsi in campo nuovo quelli vecchi)  NON RISOLVE PROBLEMA DI GG RISCHIO ASSEGNI
    8;16/06/2014;PROV;PROV;TEST;;scrittura provvigioni su viocommissiontransdetail e raggruppamento per agente/fattura/dimensioni su viocommissiontrans
    9;16/06/2014;PROV;PROV;C;;Rivedere il numeratore della VIOCOMMISSIONTRANS.COMMTRANSID (da 6 a 7 crt) a inizio anno inizializzarlo con AA9999999
    10;16/06/2014;COGE;ALTRO;C;1;Problema della registrazione 2012 cancellata da Ivanna C0052485
    11;16/06/2014;COGE;ALTRO;C;1;Problema della registrazione differenza cambio di 0,03 al 31/12/2012 su rilevazione differenze cambio registrate da carla C0046265
    12;16/06/2014;COGE;PROV;;;Gestione del credito: studio delle estrazioni dati per gli agenti (richieste Serri)
    13;16/06/2014;COGE;ALTRO;;;Report andamento finanziario dott. Baraldi
    14;16/06/2014;COGE;ECONTO;;;Vincoli di registrazioni cambiali e successiva associazione alle fatture
    15;16/06/2014;COGE;ALTRO;;1;Gestione dei crediti 2500 euro
    And this is the table structure.
    Code:
    Structure for table     : requirement.dbf
    Alias                   : requirement
    Number of records       : 430
    Date of creation        : 12/10/2014
    Date of last update     : 12/10/2014
    DES3 Encrypted          : No
    CursorAdaptor           : No
    Field  Field Name    Type       Width   Dec   Description
        1  ID            Numeric       10         ID                       
        2  DATE          Date           8         Data inserimento         
        3  AREA          Character     10         Area                     
        4  GRUPPO        Character     10         Gruppo                   
        5  STATO         Character     10         Stato                    
        6  PRIORITA      Character     10         Priorità                 
        7  DESCRIZIONE   Character     50         Descrizione              
        8  NOTE          Memo           8         Note                     
        9  PREVENTIVO    Numeric        5     2   Preventivo               
       10  CONSUNTIVO    Numeric        5     2   Consuntivo               
       11  PUNTO         Integer        5         Punto                    
    ** Total **                       127
    thanks
    Fabio

  2. #2
    Senior Member
    Join Date
    Jul 2013
    Location
    Ontario, Canada
    Posts
    658
    Hi Fabio,

    Since it's a csv file, can the append handle semicolons ( ; ) instead of commas ( , ) as the delimiter?
    If there is a problem with the delimiter, the commas in the text may also cause problems.

    Cory

  3. #3
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,135
    I think there is an option to specify delimiter:

    APPEND FROM <filename> | (<expC1>)[ENCRYPTION <expC2>][FOR <condition>][WHILE <condition>]
    [[TYPE] SDF | FIXED | DELIMITED | DELIMITED WITH BLANK | DELIMITED WITH <delimiter> | CSV]

    ...delimited with ";"

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    7,161
    Blog Entries
    22
    Hi Phabio,

    CSV == "Comma Separated Values"

    http://en.wikipedia.org/wiki/Comma-separated_values

    Using ;; is not a valid CSV file format.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    I changed strategy ..
    I imported the table with VFP, then I imported into DB Lianja.

    Now I've 2 table:
    dafare2

    Structure for table : dafare2.dbf
    Alias : dafare2
    Number of records : 105
    Date of creation : 01/01/1970
    Date of last update : 12/11/2014
    DES3 Encrypted : No
    CursorAdaptor : No
    Field Field Name Type Width Dec Description
    1 COLUMN1 Numeric 5 COLUMN1
    2 COLUMN2 Character 200 COLUMN2
    3 COLUMN3 Character 200 COLUMN3
    4 COLUMN4 Date 8 COLUMN4
    5 COLUMN5 Character 20 COLUMN5
    6 COLUMN6 Character 20 COLUMN6
    7 COLUMN7 Character 20 COLUMN7
    8 COLUMN8 Character 20 COLUMN8
    ** Total ** 490


    and FRD

    Structure for table : frd.dbf
    Alias : frd
    Number of records : 1
    Date of creation : 12/11/2014
    Date of last update : 12/11/2014
    DES3 Encrypted : No
    CursorAdaptor : No
    Field Field Name Type Width Dec Description
    1 ID Integer 10 ID
    2 TITOLO Character 200 Titolo
    3 ANALISI Memo 8 Analisi
    4 DATA Date 8 Data
    5 AREAID Character 20 Area
    6 GRUPPOID Character 20 Gruppo
    7 STATOID Character 20 Stato
    8 PRIORITAID Character 20 Priorità
    ** Total ** 297

    then I've created a simple script:
    Code:
    Proc import_dafare
    
    select dafare2
    scan	
    	select frd	
    	append blank
    	replace id with dafare2.column1
    	replace titolo with dafare2.column2
    	replace analisi with dafare2.column3
    	replace data with dafare2.column4
    	replace area with dafare2.column5
    	replace gruppo with dafare2.column6
    	replace stato with dafare2.column7			
    	replace priorita with dafare2.column8
    		
    endscan
    but I got this error:
    gio 11. dic 19:48:20 2014
    **** Lianja error ****
    frd
    ^
    Field variable was expected
    Called from procedure - import_dafare at line 6

    Why? Is a simple "select frd"...

    thanks
    Fabio

  6. #6
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    both table are previous opened..

  7. #7
    Hi Fabio,

    It looks like the column names in the prg don't match the column names in the table.

  8. #8
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,893
    Hi Dave, you're right!
    this line contains a wrong field.. I've missed the "ID"
    replace data with dafare2.column4
    replace area with dafare2.column5
    replace gruppo with dafare2.column6
    replace stato with dafare2.column7
    replace priorita with dafare2.column8

    Yesterday I worked too long ..

    But the error is misleading ..

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Journey into the Cloud
Join us