web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Pushing data from axapta customer table to external database using odbc connection both database on oracle

(0) ShareShare
ReportReport
Posted on by

Hi,

I have an requirnment for pushing real time data from Axapta Customer table to external system which have same database as oracle.

for example: In axapta if i insert an record in customer table same time it should also insert data in external system database using odbc . It is a real time pushing data using db link.

Pls help

current code: wrritten on customer table insert method : getting error cursor state

LoginProperty                      LP;
    OdbcConnection                     myConnection;
    Statement                          myStatement;
    ResultSet                          myResult1;
    ResultSet                          LocalResult;
    Statement                          LocalStatement;
    int RecCount=0;
    str                                 a;
    ;
     super();
      ttsbegin;
    
     LP = new LoginProperty();
     LP.setDSN("teststaging"); 
     LP.setUsername("teststaging");
     LP.setPassword("teststaging");
    

    try
      {
       myConnection = new OdbcConnection(LP);
      }
    catch
    {
    PRINT("Check username/password.");
    return;
     }

    LocalStatement = myConnection.createStatement();

    LocalResult = LocalStatement.executeQuery(strfmt("insert into teststaging.ARtable(AR_CODE) values ('%1')",this.Custcode));
                     ttsbegin;
                     while(LocalResult.next())
                    {

                     a = LocalResult.getString(1);
                     BOX::info(a);
                       RecCount++;

                    }
                    ttscommit;



   info(int2str(RecCount)+" Records are inserted.");

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    236,394 Most Valuable Professional on at
    RE: Pushing data from axapta customer table to external database using odbc connection both database on oracle

    It seems that you've copied code for selecting data and you're trying to use for inserts.

    Use executeUpdate() instead of executeQuery() and remove your code for processing records returned by a query, because you don't have any query at all.

  • Community Member Profile Picture
    on at
    RE: Pushing data from axapta customer table to external database using odbc connection both database on oracle

    thanks resolved

  • Martin Dráb Profile Picture
    236,394 Most Valuable Professional on at
    RE: Pushing data from axapta customer table to external database using odbc connection both database on oracle

    If my reply is the solution, please mark it accordingly (notice Did this answer your question? beside the reply).

    Otherwise please explain the solution, so other people can benefit from this thread.

  • bprashant644 Profile Picture
    20 on at
    RE: Pushing data from axapta customer table to external database using odbc connection both database on oracle

    Hey Martin,

    In such a scenario, where both tables are updated. Do the the users of external DB require CAL??

    Since, its an indirect use of AX data, it seems to me that they do require.

    I have posted a similar query in my post. Just thought that this thread is more relevant therefore, asking here as well..

    Thanks

  • nmaenpaa Profile Picture
    101,160 Moderator on at
    RE: Pushing data from axapta customer table to external database using odbc connection both database on oracle

    This licensing question has nothing to do with the original question which was about technical solution for syncing data to external database. Please post a new question.

  • bprashant644 Profile Picture
    20 on at
    RE: Pushing data from axapta customer table to external database using odbc connection both database on oracle

    Sure Nikolaos.

    Thank you.

    I have posted the question here - community.dynamics.com/.../1085349

    if possible please respond..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans