That may be right. The code was just written in Notepad at the time.

Morten

-----Original Message-----
From: Axapta-Knowledge-Village@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of
victor_zuev
Sent: 29. juli 2005 11:06
To: Axapta-Knowledge-Village@yahoogroups.com
Subject: [Axapta-Knowledge-Village] Re: Somthing cool - IO

Thanks very much for an interesting example.

The example was quite difficult for me to execute because this line:
>     sql = strFmt('void executesql()\n{\nTable1 table1;\nTable2

I think, it would be more comprehensive if the line was written as :

>     sql = strFmt('void executesql(ProjTable projTable)\n{\nTable1 
table1;\nTable2

Anyway, Thanks

--- In Axapta-Knowledge-Village@yahoogroups.com, "Morten Aasheim" 
<[EMAIL PROTECTED]> wrote:
> Here is a simple example (written in notepad):
> 
>  
> 
> class FormRun extends ObjectRun
> 
> {
> 
>     Source                      sql;
> 
> }
> 
>  
> 
> void init()
> 
> {
> 
>               ;
> 
>               this.buildQuery();
> 
> }
> 
>  
> 
> void buildQuery()
> 
> {
> 
>     xppCompiler compiler = new xppCompiler();
> 
>     table1
> 
>     table2
> 
>     str                         sSql, sWhere, sExists;
> 
>  
> 
>     ;
> 
>     sSql = 'SELECT ProjTable';
> 
>  
> 
>     switch (ctrl.selection())
> 
>     {
> 
>         case Enum::1:
> 
>             break;
> 
>         case Enum::2:
> 
>             sSql += ' exists join table2';
> 
>             sWhere = 'where ................;
> 
>             sWhere += strFmt(' && ......... == \'.....\'',var);
> 
>             break;
> 
>         case Enum::3:
> 
>                              .....................
> 
>             break;
> 
>     }
> 
>  
> 
>     sql = strFmt('void executesql()\n{\nTable1 table1;\nTable2
> table2;\n;\n%1 %2;\n}\n',sSql, Swhere);
> 
>     if(Compiler.compile(sql))
> 
>         ProjTable_ds.executeQuery();
> 
>     else
> 
>         info(compiler.errorText());
> 
> }
> 
>  
> 
> public void executeQuery()
> 
> {
> 
>     Table1 table1;
> 
>     Table2 table2;
> 
>     ;
> 
>     super();
> 
>  
> 
>     runbuf(sqlCmd,this.cursor());
> 
> }
> 
>  
> 
> Regards,
> 
> Morten
> 





Sharing the knowledge on Axapta. 
Yahoo! Groups Links



 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12hdufoqs/M=362343.6886682.7839641.1493532/D=groups/S=1705001380:TM/Y=YAHOO/EXP=1122730537/A=2894352/R=0/SIG=11fdoufgv/*http://www.globalgiving.com/cb/cidi/tsun.html";>Help
 tsunami villages rebuild at GlobalGiving. The real work starts now</a>.</font>
--------------------------------------------------------------------~-> 

Sharing the knowledge on Axapta. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Axapta-Knowledge-Village/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to