Just keep in mind that this way of doing it is incredibly slow
performance wise, so I'd definitely use a "while select" construction
instead.  Remember that SQL Server is optimized for execution plans, not
interactive SQL (like Oracle), so stepping through it with next() will
kill it.  Axapta's own use of SQL is not exactly great (somebody might
whisper *understatement of the decade"), but there's no point in making
matters worse...  :-)  And, before I get flamed by MBS people trying to
defend Axapta:  Yes, Axapta 4.0 is going to remedy this according to a
just released statement!  I think we're all looking forward to 2006...

Also, optimize your use of indexes.  Don't rely on index hints (I know
that the standard Axapta application does this in many places, but that
doesn't mean it's the right thing to do).  If in doubt of what index to
use, use the SQL profiler to get a suggestion, and if it takes to long
to execute, consider creating an index if it's a statement that is
intended to be used often.

There's a lot of things to be said and done about optimizing code in the
Axapta application, but there's much better articles about that
elsewhere than what I can write here in a short fashion...

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 19, 2005 4:13 AM
To: [email protected]
Subject: Re: [development-axapta] Direct SQL Queries



Hi Raaf,

AFAIK,

You might use Connection and Statement class for this purpose, try
something like this

    Connection Con = new Connection();
    Statement Stmt = Con.createStatement();
    ResultSet R = Stmt.executeQuery('SELECT ITEMID FROM INVENTTABLE');

    while ( R.next() )
    {
        print R.getString(1);
    }

CMIIW,

Arief Darmawan

>
>
> Hi,
>
> Is there any way to make a QueryRun object move through a direct SQL
> query? Rather than creating QueryBuildRanges and such, can I





________________________________

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]
<mailto:[EMAIL PROTECTED]
be>
       
*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .




[Non-text portions of this message have been removed]






Yahoo! Groups Links

Reply via email to