Results 1 to 7 of 7

Thread: Append automem with vt

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

    Append automem with vt

    Hi all, I've a virtual table pointing to mssql table.
    I need to insert a new record on the remote table.
    Can I use append automem?
    Thank
    Fabio

  2. #2
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,105
    Hi Fabio,

    I susspected the answer is not, but when created a virtual table, local, and tried

    Code:
    store automem
    append automem
    it worked.
    I don't know if remote will do. Try APPEND BLANK first.
    Last edited by josipradnik; 2019-08-31 at 14:07.

  3. #3
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,884
    Hi Josip, thanks.
    But I've more "not null" fields..
    Now I've some error on this fields.

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,962
    As you don't properly describe what error is reported and don't try it but rather ask others to try for you it's difficult to know what it is you are wanting to achieve. However, you can also use the sql insert command with the memvar keyword.

    https://www.lianja.com/doc/index.php/SQL_INSERT
    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
    Lianja MVP
    Join Date
    Dec 2012
    Location
    Croatia, Zagreb
    Posts
    1,105
    Hi Fabio,

    If you have "not null" fields, then it is understandable.
    I suppose you tried APPEND BLANK with remote VT to get these errors.
    APPEND BLANK was just an idea to check if such non-SQL concept works in remote VT like in local VT.

    For APPEND AUTOMEM (if it works in remote) you need to assign some new values for unique key fields
    and provide not null values for such fields

    Code:
    store automem
    m.account_no = strzero(seqno(),5)
    append automem
    https://www.lianja.com/doc/index.php/APPEND_AUTOMEM
    Last edited by josipradnik; 2019-09-01 at 02:57.

  6. #6
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,962
    As has been discussed on various occasions if your remote table has autoinc columns or other auto generated columns you need to exclude those columns from the virtual table definition using the updatefieldlist property.

    https://www.lianja.com/doc/index.php...ble_Properties
    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

  7. #7
    Senior Member
    Join Date
    Feb 2012
    Location
    Rome - Italy
    Posts
    1,884
    Hi all,
    now I've solved with a direct insert into MSSQL via sqlexec and work.
    In the next days I try again with append automem and insert SQL.
    thanks
    Fabio

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