You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by kiran vuppla <ki...@yahoo.com> on 2008/02/10 23:19:09 UTC

Nested Select Statement or Nested Select Elements

Hi,
    I am new to IBatis and am in learning curve stage. I would like to know how to write a nested select statement in the IBatis SqlMapConfig file.
   
    My nested Oracle Select Statement:
   
    select * 
  from table1
   where val1 in (
               select val2 from           /* Self Join */
                      table2 a, table2 b
                      where a.id = b.id
                      and a.val = b.val
                     and b.id = id
                    and a.id != id;
                )
   
  I would like to know how to write a nested <select> element in IBatis in the config file.
   
  Thanks,
KV

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

RE: Nested Select Statement or Nested Select Elements

Posted by Clinton Begin <cl...@gmail.com>.
I think this is more of an issue with your understanding of SQL than it is
with iBATIS.  See, the nested SQL statement is not "exposed" to the caller.
It can only be used internally (except perhaps if you had put it in the FROM
clause and subsequently included it in the SELECT clause of the "parent"
statement...)

 

So, I don't think the question makes sense.  You write the nested select
like you would anywhere else.  It doesn't change the inputs (parameters) and
outputs (select clause of the outermost statement) available for iBATIS to
work with.

 

clinton

 

From: kiran vuppla [mailto:kirankumar_vuppla@yahoo.com] 
Sent: February-11-08 6:24 AM
To: user-java@ibatis.apache.org; lmeadors@apache.org
Subject: Re: Nested Select Statement or Nested Select Elements

 

Thanks for the info. I have seen the tutorial but I havent found it as I
assume it might not documented regarding the nested select elements. I knew
how to write the nested select query. I would like to know is it same or
different in writing a nested select statement in IBatis config file that we
write in Oracle toad  or store procedures.

 

Thanks

KV

 


Larry Meadors <lm...@apache.org> wrote:

Please don't ask the people on the list to write "hello world" for
you, it's incredibly disrespectful to assume that their time is best
spent teaching you things that are already freely available.

Go to www.google.com and enter "ibatis java tutorial" (or click here
-> http://www.google.com/search?q=ibatis+java+tutorial <-). You'll get
literally thousands of hits. Pick a couple and work through them.

Once you've put in a couple of hours (or days), and you're really
struggling with something, come on back and ask. We're a pretty
helpful bunch most of the time.

Larry


On Feb 10, 2008 3:25 PM, kiran vuppla wrote:
> Hi,
> I am new to IBatis and am in learning curve stage. I would like to know
> how to write a nested select statement in the IBatis SqlMapConfig file.
>
> My nested Oracle Select Statement:
>
> select *
> from table1
> where val1 in (
> select val from /* Self Join */
> table2 a, table2 b
> where a.val = b.val
>
> and b.id = id
> and a.id != id;
> )
>
>
> I would like to know how to write a nested [           \/] element in
IBatis in the
> config file.
>
> Thanks,
> KV
> ________________________________
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.
>
>
> ________________________________
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.

 

  

  _____  

Looking for last minute shopping deals? Find
<http://us.rd.yahoo.com/evt=51734/*http:/tools.search.yahoo.com/newsearch/ca
tegory.php?category=shopping>  them fast with Yahoo! Search.


Re: Nested Select Statement or Nested Select Elements

Posted by kiran vuppla <ki...@yahoo.com>.
Thanks for the info. I have seen the tutorial but I havent found it as I assume it might not documented regarding the nested select elements. I knew how to write the nested select query. I would like to know is it same or different in writing a nested select statement in IBatis config file that we write in Oracle toad  or store procedures.
   
  Thanks
  KV
   
  
Larry Meadors <lm...@apache.org> wrote:
  Please don't ask the people on the list to write "hello world" for
you, it's incredibly disrespectful to assume that their time is best
spent teaching you things that are already freely available.

Go to www.google.com and enter "ibatis java tutorial" (or click here
-> http://www.google.com/search?q=ibatis+java+tutorial <-). You'll get
literally thousands of hits. Pick a couple and work through them.

Once you've put in a couple of hours (or days), and you're really
struggling with something, come on back and ask. We're a pretty
helpful bunch most of the time.

Larry


On Feb 10, 2008 3:25 PM, kiran vuppla wrote:
> Hi,
> I am new to IBatis and am in learning curve stage. I would like to know
> how to write a nested select statement in the IBatis SqlMapConfig file.
>
> My nested Oracle Select Statement:
>
> select *
> from table1
> where val1 in (
> select val from /* Self Join */
> table2 a, table2 b
> where a.val = b.val
>
> and b.id = id
> and a.id != id;
> )
>
>
> I would like to know how to write a nested  element in IBatis in the> config file.>> Thanks,> KV>>>> kiran vuppla  wrote:>>>>> Hi,> I am new to IBatis and am in learning curve stage. I would like to know> how to write a nested select statement in the IBatis SqlMapConfig file.>> My nested Oracle Select Statement:>> select *> from table1> where val1 in (> select val2 from /* Self Join */> table2 a, table2 b> where a.id = b.id> and a.val = b.val> and b.id = id> and a.id != id;> )>> I would like to know how to write a nested element in IBatis in the
> config file.
>
> Thanks,
> KV
> ________________________________
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.
>
>
> ________________________________
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.


       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

Re: Nested Select Statement or Nested Select Elements

Posted by Larry Meadors <lm...@apache.org>.
Please don't ask the people on the list to write "hello world" for
you, it's incredibly disrespectful to assume that their time is best
spent teaching you things that are already freely available.

Go to www.google.com and enter "ibatis java tutorial" (or click here
-> http://www.google.com/search?q=ibatis+java+tutorial <-). You'll get
literally thousands of hits. Pick a couple and work through them.

Once you've put in a couple of hours (or days), and you're really
struggling with something, come on back and ask. We're a pretty
helpful bunch most of the time.

Larry


On Feb 10, 2008 3:25 PM, kiran vuppla <ki...@yahoo.com> wrote:
> Hi,
>   I am new to IBatis and am in learning curve stage. I would like to know
> how to write a nested select statement in the IBatis SqlMapConfig file.
>
>   My nested Oracle Select Statement:
>
>   select *
>   from table1
>    where val1 in (
>                select val from           /* Self Join */
>                       table2 a, table2 b
>                       where a.val = b.val
>
>                      and b.id = id
>                     and a.id != id;
>                 )
>
>
> I would like to know how to write a nested <select> element in IBatis in the
> config file.
>
> Thanks,
> KV
>
>
>
> kiran vuppla <ki...@yahoo.com> wrote:
>
>
>
>
> Hi,
>   I am new to IBatis and am in learning curve stage. I would like to know
> how to write a nested select statement in the IBatis SqlMapConfig file.
>
>   My nested Oracle Select Statement:
>
>   select *
>   from table1
>    where val1 in (
>                select val2 from           /* Self Join */
>                       table2 a, table2 b
>                       where a.id = b.id
>                       and a.val = b.val
>                      and b.id = id
>                     and a.id != id;
>                 )
>
> I would like to know how to write a nested <select> element in IBatis in the
> config file.
>
> Thanks,
> KV
>  ________________________________
>  Looking for last minute shopping deals? Find them fast with Yahoo! Search.
>
>
>  ________________________________
> Looking for last minute shopping deals? Find them fast with Yahoo! Search.

Re: Nested Select Statement or Nested Select Elements

Posted by kiran vuppla <ki...@yahoo.com>.
Hi,    I am new to IBatis and am in learning curve stage. I would like to know how to write a nested select statement in the IBatis SqlMapConfig file.
   
    My nested Oracle Select Statement:
  
    select * 
  from table1
   where val1 in (
               select val from           /* Self Join */
                      table2 a, table2 b
                      where a.val = b.val
                     and b.id = id
                    and a.id != id;
                )
   
  I would like to know how to write a nested <select> element in IBatis in the config file.
   
  Thanks,
KV

kiran vuppla <ki...@yahoo.com> wrote:
    
Hi,
    I am new to IBatis and am in learning curve stage. I would like to know how to write a nested select statement in the IBatis SqlMapConfig file.
   
    My nested Oracle Select Statement:
  
    select * 
  from table1
   where val1 in (
               select val2 from           /* Self Join */
                      table2 a, table2 b
                      where a.id = b.id
                      and a.val = b.val
                     and b.id = id
                    and a.id != id;
                )
   
  I would like to know how to write a nested <select> element in IBatis in the config file.
   
  Thanks,
KV
    
---------------------------------
  Looking for last minute shopping deals? Find them fast with Yahoo! Search.

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.