Nov 8, 2013

How to get query through code ?

static  void  TestQuery(Args _args)
{
       AifInboundPort                 aifInboundPort;
       Query                               query;
       QueryBuildDataSource     queryBDS;
       QueryRun                         qr;
        ;
       query =  new Query(queryStr("AifInboundPortQuery"));
    // queryBDS = query.dataSourceTable(tablenum(AifInboundPort)); // Optional
       qr = new QueryRun(query);

       while (qr.next())
       {
          // aifInboundPort = qr.get(tableNum(AifInboundPort));
             aifInboundPort = qr.getNo(1);
             info(aifInboundPort.AosChannelId);
       }

}

No comments: