Lisp HUG Maillist Archive

Problem with SQL

Hi

I am resurrecting some SQL code that was written for LW 4.x and ODBC  
and I am running into some problems on LW 5.x with MySQL.

Here is the problem.  Please note that I used the SQL::MAKE-DB- 
IDENTIFIER because I need to rename the tables.


CL-USER 26 >  (sql:select ["CHILD" acc]
               :from '(#.(sql::make-db-identifier
                          :val "term PARENT")
                       #.(sql::make-db-identifier
                          :val "term2term TERM2TERM")
                       #.(sql::make-db-identifier
                          :val "term CHILD"))
               :where [and [= ["PARENT" acc] "GO:0042254"]
                           [= ["PARENT" id] [TERM2TERM.term1_id]]
                           [= ["CHILD" id] [term2term.term2_id]]
                           [= 2
                              [term2term.relationship_type_id]]]
               :flatp t)

Error: Sql-Database-Data-Error id 1054 : In PREPARE : Unknown column  
'TERM2TERM.TERM1_ID' in 'where clause'
   1 (abort) Return to level 0.
   2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other  
options

CL-USER 27 : 1 >


Any idea about what could be wrong?  AFAICS the MySQL db (a version of  
Gene Ontology for those interested) has all the bits required.  I  
would also welcome suggestions about changing the query in a better way.

thanks

--
Marco Antoniotti, Associate Professor				tel.	+39 - 02 64 48 79 01
DISCo, Università Milano Bicocca U14 2043
Viale Sarca 336
I-20126 Milan (MI) ITALY

Please note that I am not checking my Spam-box anymore.



--
Marco Antoniotti



Re: Problem with SQL

Unable to parse email body. Email id is 8760

Updated at: 2020-12-10 08:41 UTC