Re: Problem with date type specifier in a view-class with MySQL

Dave Woodward <[email protected]> Tue, 7 Oct 2014 11:29:28 -0400
Newsgroups gmane.lisp.clsql.general
Message-ID <[email protected]>
Russ,

  Thanks for the quick reply!

  I was about to show my example code etc., but then it occurred to me I wa=
s doing this in the cl-user package.  Your comment about what =93date=94 is=
 mapped to helped me.

  A quick (in-package :clsql) did the trick!  Also, it seems changing my vi=
ew class from this (example):

(clsql:def-view-class report ()
  ((id :db-kind :key :type integer)
   (activity_date_start :type date)))

  To this (using package name in symbol for the type specifier):

(clsql:def-view-class report ()
  ((id :db-kind :key :type integer)
   (activity_date_start :type clsql:date)))

  Is a more correct fix and works when I=92m in cl-user as well.

  Thanks!

Dave
[email protected]



On Oct 7, 2014, at 11:12 AM, Russ Tyndall <[email protected]> wrote:

> I am not quite sure I understand the scenario.  Seeing the view-class =

> slot specification and table schema would certainly help matters, but =

> that said I think I can offer some insight.
> =

> Its highly probable that a typecase / multimethod somewhere does not =

> have the "date" type mapped to the clsql:date type.  The mysql backend =

> is the least well developed backend currently (I believe), though it has =

> been used successfully.
> =

> The easiest suggestion would be to use timestamp, or datetime, which I =

> am fairly sure are supported already (by virtue of these being valid =

> typenames across a couple database systems).
> =

> Other than that you would have to track down where the type mapper is =

> and make adjustments.  A quick grep did not immediately point out the =

> issue to me though or I would offer more.
> =

> You can also try turning on sql debugging =

> `(clsql-sys:start-sql-recording)` and see if this helps spot the problem.
> =

> Cheers,
> Russ Tyndall
> Acceleration.net
> [email protected]
> =

> =

> =

> On 10/07/2014 10:52 AM, Dave Woodward wrote:
>> I=92m using clsql to connect to a MySQL database that already exists.
>> =

>> I=92ve created a view class for one of the tables, and it works selectin=
g integer, string and even join types.
>> =

>> However when adding a column of a date type I get the error "Error: Unkn=
own type specifier: DATE=94 when using select with the view class with the =
date type in it.  The select works fine without that type in it.
>> =

>> I=92m using Clozure CL on OS X and used Quicklisp to load clsql.
>> =

>> Any pointer would be appreciated=85 thanks!
>> =

>> Dave
>> [email protected]
>> =

>> =

>> =

>> =

>> _______________________________________________
>> CLSQL mailing list
>> [email protected]
>> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql
> =

> _______________________________________________
> CLSQL mailing list
> [email protected]
> http://lists.b9.com/cgi-bin/mailman/listinfo/clsql