question

yuan zhang avatar image
1 Like"
yuan zhang asked yuan zhang commented

Oracle Connection over ODBC

In FlexSim, I need remote access to the Oracle database.So I created an ODBC data source by instantclient_12_1,the test shows that the connection is successful.But when I called dbopen command in the model,it gives this error:

With authentication issues,I did not find a way to save password in the DSN.Is there any way to enter a password by FlexSim command? Or other way remote access to the Oracle database.

FlexSim 16.1.2
oracle connection over odbc
p2.png (5.6 KiB)
p3.png (36.3 KiB)
5 |100000

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

Steven Hamoen avatar image
2 Likes"
Steven Hamoen answered yuan zhang commented

@yuan zhang check out the dbusername() command.

Also check out this post in the old forum: ODBC questions

· 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.

yuan zhang avatar image yuan zhang commented ·

Hi Steven,

Thanks a lot! According to your post, I re-installed OracleXE11.2, it succeeded!

Now the model can connect to the database and read data from Oracle. But when I open the model second time and test, it gives an error.I have used the command dbusername("test","test"); dbopen("CIGflexsim","Select * From MAC3D",0); dbimportnode(reftable("GlobalTable1"),1,1,14,5);dbclose();

Do you know what might be the reason?

0 Likes 0 ·
error.png (6.4 KiB)
Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered yuan zhang commented

@yuan zhang Sorry I can't help you but have tried looking up on the internet about ORA-12154 or ODBC Code; 08004?

· 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.

yuan zhang avatar image yuan zhang commented ·

Hi Steven,

Yes I did.I have tried these methods and seem to have failed to solve.Remote connection seems to be fine.Because I tested several times, every time the new model can be successful, but the same model opended second time ,it gives error.

Thanks for your quick response.

0 Likes 0 ·