question

Wang Yang avatar image
0 Likes"
Wang Yang asked Ben Wilson converted comment to answer

FlexSim linking with Oracle database

Background

  1. Aim:just with one click to import and visit oracle library.choose aim data and write automatically into global table
  2. The test condition for data quantity from dozes of thousands to million in library

Test situation:

We equip ODBC data source locally and visit library in below ways

dbusername("CSN","CSN"); 
dbopen("CIGflexsim","Select * From MES.MachineMenue",0); 
dbsqlquery("Select * From MES.MachineMenue WHERE MachineID ='15A01' OR MachineID ='16B01'");

The whole FlexSim interface is blocked when executing dbopen(). We guess the reason is too large data quantity.

FlexSim 17.0.1
oracle
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Ben Wilson avatar image Ben Wilson ♦♦ commented ·

@wang.yang,

We guess the reason is too large data quantity.

Have you tested on a smaller data set to see if this is the case?

0 Likes 0 ·
Wang Yang avatar image Wang Yang commented ·

@phil.bobo @Ben Wilson

We have hundreds of thousands pieces of data in the database(such as Oracle data type ). We would like to know how FlexSim can READ and WRITE the data in real-time?

This question is very important to us.

Thanks~

0 Likes 0 ·
Mischa Spelt avatar image Mischa Spelt Wang Yang commented ·

@steven.hamoen once used the Oracle C++ drivers to directly talk to an Oracle-database. This is much faster than using ODBC and allows you to use Oracle-specific features, however it requires you to do some C++-coding. Perhaps Steven can tell you more about this?

1 Like 1 ·
Wang Yang avatar image Wang Yang Wang Yang commented ·

@Mischa Spelt @steven.hamoen

Thanks~Thanks~I'll give feedback to our engineers to test it.And I'm looking forward to Steven response.

hi steven,Can you give me some ideas? Thanks~

0 Likes 0 ·

1 Answer

Steven Hamoen avatar image
1 Like"
Steven Hamoen answered

Hi @wang.yang I've used the Oracle OCCI. I created a seperate dll with functions that I wanted to use and included the Oracle dll's in that dll. Next I loaded that dll with the LoadLibrary function in my Flexsim dll and used a interface class that I defined in the first dll to access the oracle functions.

The reason for doing it this way was that the Oracle DLL's are all build with dynamic linking (compile option MD/MDd (meaning they require all kinds of dll on the system where it is installed) and Flexsim dll's are build with static linking (compile option MT/MTd).

So I got it working and it works very well concerning speed and available options, compared to the ODBC route, but it took quite some time to figure everything out.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Wang Yang avatar image Wang Yang commented ·

Hi @steven.hamoen Thanks for your help~

I'll tell the engineer this way right away
0 Likes 0 ·