Dbc Queries...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dbc Queries...

S.Y.Shah
HI All,
         I am new to SCALA, i just wanted to convert some of my JDBC code to SCALA dbc. I looked at an example of dealing with databases on SCALA WIKI. But i have more complex queries of insert and select. Can any body provide me some pointers which help me to put my queries in right syntax to executStatment of SCALA. Two of my queries are as below..
////////////
"Select
CellName,Layer,AnatomicalType,ElectrophysiologicalType,GeneticType,Connections,Reconstructed,CellIndex.Comments,Age,Species,Gender,performer,Date_d,Date_m,Date_y,Region,weight
from CellIndex,ExpIndex where CellName='"+name+"'"
///////////////////
"insert into ConnectionIndex
values(\""+conname+"\",\""+contype+"\",\""+sytype+"\",\""+precel+"\",\""+postcel+"\",\""+cmnts+"\",\""+eid+"\",\""+conid+"\")"
//////////////////

Best Regards,
yousaf

Reply | Threaded
Open this post in threaded view
|

Re: Dbc Queries...

Burak Emir
Hello all,

Let me know if the new docu on http://scala.sygneca.com//libs/dbc 
answers your question.

cheers,
Burak

p.s.: you'd use ("CellName" in "CellIndex")==name for the whereclause.
It's the 'in' which turns that parenthesized thingy into a
StatementExpression. insert is not very nicely supported yet, but Gilles
is working on it.

S.Y.Shah wrote:

> HI All,
>          I am new to SCALA, i just wanted to convert some of my JDBC
> code to SCALA dbc. I looked at an example of dealing with databases on
> SCALA WIKI. But i have more complex queries of insert and select. Can
> any body provide me some pointers which help me to put my queries in
> right syntax to executStatment of SCALA. Two of my queries are as below..
> ////////////
> "Select
> CellName,Layer,AnatomicalType,ElectrophysiologicalType,GeneticType,Connections,Reconstructed,CellIndex.Comments,Age,Species,Gender,performer,Date_d,Date_m,Date_y,Region,weight
>
> from CellIndex,ExpIndex where CellName='"+name+"'"
> ///////////////////
> "insert into ConnectionIndex
> values(\""+conname+"\",\""+contype+"\",\""+sytype+"\",\""+precel+"\",\""+postcel+"\",\""+cmnts+"\",\""+eid+"\",\""+conid+"\")"
>
> //////////////////
>
> Best Regards,
> yousaf
>


--
Burak Emir

http://lamp.epfl.ch/~emir

Reply | Threaded
Open this post in threaded view
|

Re: Re: Dbc Queries...

Mathias Weyel
In reply to this post by S.Y.Shah
> Hello all,
>
> Let me know if the new docu on http://scala.sygneca.com//libs/dbc 
> answers your question.
>
> cheers,
> Burak
>
> p.s.: you'd use ("CellName" in "CellIndex")==name for the whereclause.
> It's the 'in' which turns that parenthesized thingy into a
> StatementExpression. insert is not very nicely supported yet, but Gilles
> is working on it.

There had once been ideas like writing queries as for comprehensions which I would regard as a much better way than integration sql syntax into the scala language. What is the status of these efforts?

Thx

Mathias

Reply | Threaded
Open this post in threaded view
|

Re: Dbc Queries...

Gilles Dubochet-2
Bonjour,

> There had once been ideas like writing queries as for comprehensions
> which I would regard as a much better way than integration sql syntax
> into the scala language. What is the status of these efforts?

It is still under development. Unfortunately, it depends of various
other techniques that must be available first. In particular, some kind
of macro system (actually I don't like calling it macro, rather staged
compilation) and an on-line interpreter (an interpreter that can be
called on a sub-part of a running program).

I'll post on this list when I have a useable pre-version. Don't expect
it very soon though (on a brighter side, you can expect it for both SQL
and XQuery)

Cheers,
Gilles.