Показать сообщение отдельно
Старый 16.12.2009, 12:05   #1  
Blog bot is offline
Blog bot
Участник
 
23,901 / 804 (74) +++++++
Регистрация: 28.10.2006
hariprasadp: Code for pulling data from other than AX Database of SQL to AX Table
Источник: http://hariprasadp.spaces.live.com/B...B91F!203.entry
==============
X++:
//HariPattela- code for pulling data from other than AX Database of SQL to AX Table
static void SQL_CustPaym(Args _args)
{
 LoginProperty LP = new LoginProperty();
  myConnection;
  myStatement;
  myStatement1;
  myResult,myResult1;
  paymTerm;
 str tstCustId;
 ;
 //DSN - if the data base is on diffrent server
 LP.setDSN("SqlTestSvr");
 LP.setDatabase('newErp');
 myConnection = new OdbcConnection(LP);
 myStatement = myConnection.createStatement();
 myResult = myStatement.executeQuery("SELECT * FROM SA_PayTerm");
 while (myResult.next())
 {
  = myResult.getString(1);
 if(!paymterm::find(tstCustId))
 {
 ttsbegin;
 paymTerm. = tstCustId;
 paymTerm. = myResult.getString(2);
 paymTerm. = any2int(myResult.getString(3));
 paymTerm.insert();
 ttscommit;
 info(tstCustId);
 }

 // myResult1 = myStatement.executeQuery("delete FROM SA_PayTerm "+ "where SA_PayTerm.PaymentCode ="+"'"+ tstCustId+"';");
//               _strSQL = "delete from fwcatns_materialmaster " +
//                  "where MaterialId = '" + _InventTable.ItemId + "';";
//        while(myResult1.next())
//        {
//            info("Payment Term Id = %1", tstCustId);
//        }
//
 }
}


==============
Источник: http://hariprasadp.spaces.live.com/B...B91F!203.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.