SaveCSV doesn't handle null values

Discussion in 'Questions (Windows Mobile)' started by RB Smissaert, Jan 8, 2009.

  1. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    When a table control has null values then Table1.SaveCSV will cause an error.
    I can work around that, but it would be nice if SaveCSV could handle this itself. Save as an empty string would be fine.

    RBS
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    How did the null values get in the table?
    From a SQL db?
     
  3. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Yes, from a SQLite DB:

    select * from sqlite_master

    I know I can do instead:

    select
    type,
    name,
    tbl_name,
    rootpage,
    coalesce(sql, '') as sql
    from
    sqlite_master

    but I thought maybe the SaveCSV method could handle NULL values internally, so you wouldn't have to worry about them. I suppose though that if it did that there might be some performance penalty.


    RBS
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Exactly.

    I think it will be better that ExecuteTable will handle the null values and convert them to "" or 0.
    It will be added in the next SQL library update.
    Null values can cause all kinds of errors if they get into a table control.
     
  5. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    OK, thanks for that.
    How about updating to the latest SQLite version?

    RBS
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    I will check that too.
     
  7. RB Smissaert

    RB Smissaert Well-Known Member Licensed User

    Great, thanks again. :)

    RBS
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice