Read data from ExternalDataSource

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Sep 27, 2023
Company:

Hi Experts,
 
i want to get data from external data source ExternalDataSources.XXXX.Tables.XXXX;

 how can i get all table data and iterate it,

 i tried like below but gives me error


 For Each DataRow In ExternalDataSources.XXX.Tables.XXXX Do

 EndDo;

 
#2
People who like this:0Yes/0No
Administrator
Rating: 25
Joined: Oct 3, 2019
Company:

Hello Selim!

None of the experts have answered you, so let me try to help you :)

For first - could you provide a more complete code?

And in general, it is better to work with external data sources using queries:



Code
   Query = New Query;
   Query.Text = 
      "SELECT
      |   dbo_CURRENCIES.CODE AS CODE,
      |   dbo_CURRENCIES.NAME AS NAME,
      |   dbo_CURRENCIES.STATUS AS STATUS,
      |   dbo_CURRENCIES.EXTCODE AS EXTCODE
      |FROM
      |   ExternalDataSource.RK_RKeeper7.Table.dbo_CURRENCIES AS dbo_CURRENCIES";
   
   QueryResult = Query.Execute();
   
   SelectionDetailRecords = QueryResult.Select();
   
   While SelectionDetailRecords.Next() Do
      // Insert selection processing SelectionDetailRecords
   EndDo;

 
#3
People who like this:0Yes/0No
Active user
Rating: 9
Joined: May 21, 2023
Company:

And how do you connect to external data source?

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.