Menu

Getting an error when using ucanaccess driver

Help
radhika
2017-09-17
2017-09-17
  • radhika

    radhika - 2017-09-17

    File "/usr/local/lib/python3.4/site-packages/jaydebeapi/init.py", line 498, in execute
    self._prep = self._connection.jconn.prepareStatement(operation)
    jpype._jexception.UcanaccessSQLExceptionPyRaisable: net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::4.0.2 routine signature not found for: PUBLIC.LEFTWA(DOUBLE,INTEGER)

    Can anyone please help
    Can provide more information if required

     
  • Gord Thompson

    Gord Thompson - 2017-09-17

    I am able to reproduce your issue in Java with

    sql = "SELECT Left([dbl], 2) AS foo FROM [Table1] WHERE [id]=1";
    PreparedStatement ps = conn.prepareStatement(sql);
    

     
    where [dbl] is a Numeric (Double) column. UCanAccess has not defined a Left function for values of type Double and does not perform an implicit cast to String.

    The issue goes away when we use the CStr function to perform an explicit cast:

    sql = "SELECT Left(CStr([dbl]), 2) AS foo FROM [Table1] WHERE [id]=1";
    PreparedStatement ps = conn.prepareStatement(sql);
    
     

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.