Menu

#7 SpfDefaultEntityPersister cmd string error

v1.2.10
open
nobody
Core (1)
5
2003-10-21
2003-10-21
No

The default entity persister creates an Insert string that
raises an exception when a table name is the same as a
SQL reserved word. For instance a table named "Order"
will cause a problem. Other table names that will cause a
problem are: asc, desc, where, by, from, group, values,
etc...

Issue can be corrected by enclosing table names and
column names in [].

Discussion

  • Scott Pascoe

    Scott Pascoe - 2003-10-21

    Logged In: YES
    user_id=511729

    MySql does not use brackets to quote names. In its standard
    mode, it uses the ` (backtick), in ANSI_MODE, it uses "
    (doublequotes).

    MySql calls bracketed names a syntax error.

    How about we add a method called QuoteChar to the
    ISpfDataStore and implement it as appropriate in the
    DataStores. Then the Persisters can call the QuoteChar to
    get the proper character for the datastore.
    Scott

     
  • Vlad Romanenko

    Vlad Romanenko - 2004-01-21

    Logged In: YES
    user_id=663309

    The method should be string QuoteName(string dbObjectName)
    because single character is not enougth.
    For example for MS SQL Server you should have [TableName],
    when for MySQL `TableName` or "TableName"

     

Log in to post a comment.

MongoDB Logo MongoDB