thanks it worked.
onnobid <[EMAIL PROTECTED]> wrote:
Hi,
use a 2nd Statement object for the inner loop as shown below:
> Connection Con = new Connection();
> Statement Stmt = Con.createStatement();
//############### STMT2 ########################
> Statement Stmt2 = Con.createStatement();
//############### STMT2 ########################
> ResultSet R,R1;
> sql ='SELECT ACCOUNTNUM,ACCOUNTNAME,ACCOUNTPLTYPE,RECID FROM
> LEDGERTABLE WHERE ACCOUNTNUM <= \'699\'ORDER BY ACCOUNTNUM';
> R=Stmt.executeQuery(sql);
> while (R.next())
> {
>
> acno1=R.getString(1);
> i = R.getInt(3);
> k= R.getString(4);
> if(strlen(acno1)==3)
> {
> if(i==LedgerAccountType::sum)
> {
>
> sql = 'SELECT FROMACCOUNT,TOACCOUNT FROM
> LEDGERTABLEINTERVAL WHERE ACCOUNTTABLEID ='+_tableId+' AND
> ACCOUNTRECID = '+k+'';
//############### STMT2 ########################
> R1 = Stmt2.executeQuery(sql);
//############### STMT2 ########################
> while(R1.next())
> {
> print R1.getString(1),' ',R1.getString(2),' ',k;
> pause;
> }
>
> }
> else
> {
> //blaaaa.....
> }
> }acno1
> } ledgertable2
>
> it just takes the first value from the second resultset and then go
> out of the loop.
Regards,
Onno
Yahoo! Groups SponsorADVERTISEMENT
---------------------------------
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
[Non-text portions of this message have been removed]
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

