Hi,
I didn't fix this yet, it looks like it is related to using "(select ...)"
in the "from" part. A bit simplified:
public static void main(String[] args) throws Exception {
String url = "jdbc:h2:mem:test";
Connection conn = DriverManager.getConnection(url);
Statement stat = conn.createStatement();
stat.execute("create table test(id int)");
PreparedStatement prep = conn.prepareStatement(
"select * from (select * from test where id=?)");
PreparedStatement prep2 = conn.prepareStatement(
"select * from test where id=?");
System.out.println(prep.getParameterMetaData().
getParameterTypeName(1));
System.out.println(prep2.getParameterMetaData().
getParameterTypeName(1));
}
Regards,
Thomas
On Thu, Oct 24, 2013 at 10:16 AM, Akshay Mehta <[email protected]>wrote:
> Hi,
>
> Please go through the following test case :
>
> *drop table if exists testcase;*
>
> *create table testcase (id int, name varchar(255),dob date);*
>
> *insert into testcase values *
> * (1, 'ABC','2001-01-01'),*
> * (2, 'XYZ','1998-10-15'); *
>
>
> *select * from (*
> * select * from testcase where name in (*
> * select name from testcase where dob in (*
> * select dob from testcase where dob<?*
> * )*
> * )*
> * );*
>
> I am getting Sql Type:12 (using:
> PreparedStatement.getParameterMetaData().getParameterType(index))
> for the DOB Parameter, when I execute the above Select Statement. However
> When I execute the following query I get Sql Type:91 :
>
> * select * from testcase where name in (*
> * select name from testcase where dob in (*
> * select dob from testcase where dob<?*
> * )*
> * );*
>
> any ideas?
>
> regards
> Akshay
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/groups/opt_out.
>
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.