tmlab / tmql

Automatically exported from code.google.com/p/tmql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add named parameters

GoogleCodeExporter opened this issue · comments

It would be nice to have names parameters somethin like:

Select ?p1 / occtype1, ?p1 / occtype2, ?p1 / ?

The number of parameters is 2 and should be set like

stm.setTopic(0, topic1);
stm.setTopic(1, occtypetopic1);

Original issue reported on code.google.com by h.niederhausen@googlemail.com on 17 Dec 2010 at 12:43

Original comment by h.niederhausen@googlemail.com on 17 Dec 2010 at 12:43

I think an implementation like this will be ambiguous or confusing.

The number of parameters will be 4, the other is to much magic.

We will add some new methods to the prepared statement like 

set(String,Object)

The string argument represents the name of the wildcard, with or without ?. The 
second argument is the value to set.

But using set(int,Object) will ignore the naming arguments, and will set only 
the value at the given position and not at all positions of the wildcard at the 
given position. A special method will be added set(Object) representing the 
anoynmous wildcard and works like set("?", Object)

Original comment by Sven.Kro...@googlemail.com on 4 Jan 2011 at 9:02

  • Changed state: Started

Original comment by Sven.Kro...@googlemail.com on 4 Jan 2011 at 10:17

  • Changed state: Fixed