Menu

quoted name in CREATE TABLE causes error

Help
2019-05-07
2019-05-07
  • Mick Francis

    Mick Francis - 2019-05-07

    Hi,

    If I try to create a table whose name is quoted and contains non-identifier characters, and error occurs trying to create the trigger:

    create table ` t a b l e ` (c char);
    Cannot execute:CREATE TRIGGER "GENERICINSERT_ T A B L E "  AFTER INSERT ON  T A B L E    FOR EACH ROW      CALL "net.ucanaccess.triggers.TriggerInsert"  user lacks privilege or object not found: T
    UCanAccess>UCAExc:::4.0.4 java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: T
    

    Cheers,

    Mick.

     
  • Gord Thompson

    Gord Thompson - 2019-05-07

    UCanAccess is choking on the leading space in the table name. This fails ...

    CREATE TABLE [ t a b l e ] (id LONG PRIMARY KEY, txt TEXT(10));
    

    ... but this does not fail

    CREATE TABLE [t a b l e ] (id LONG PRIMARY KEY, txt TEXT(10));
    

    However, Microsoft Access itself cannot work with tables that have trailing spaces in their names.

    TL;DR - Table names should not have leading or trailing spaces.

     
  • Mick Francis

    Mick Francis - 2019-05-07

    That's fair enough then - thanks for investigating.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.