Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX - Old database access syntax

    Posted 10/09/20 02:10 PM

    Good morning to all,

    Up to what version of CPLEX can the following Database access syntax be used ???
    Is there a way to use CPLEX version 12.10 keeping the following Database access syntax ???


    DBConnection db("oledb","user/password/name_database/HOST\\INSTANCE_NAME");
    Movies,Weeks,WeekDemand from DBRead(db,"SELECT column from Table");

    FilmSet to DBUpdate(db,"INSERT INTO result(id_movie,week,demand) VALUES(?,?,?)");


    Thank you very much to all


    ------------------------------
    MIGUEL FLORES QUISPE
    ------------------------------

    #DecisionOptimization


  • 2.  RE: CPLEX - Old database access syntax

    Posted 10/09/20 04:40 PM
    Edited by System Admin 01/20/23 04:35 PM


  • 3.  RE: CPLEX - Old database access syntax

    Posted 10/09/20 07:56 PM
    Hi Alex,

    As far as I understand it is impossible to maintain the following syntax in versions higher than CPLEX 12.6.3. Then could you help me to rewrite the code shown in the image please (only access to tables, since in the new syntax (I use cplex 12.10) apparently you cannot place a Select that returns more than 1 column). Please don't send me the OIL example, help me adapt the image code with the new table access syntax following the shortest path. The truth is that I am against time and I need help. Thank you very much Alex. Blessings


    *.mod

    --
    *.dat




    ------------------------------
    MIGUEL FLORES QUISPE
    ------------------------------



  • 4.  RE: CPLEX - Old database access syntax

    Posted 10/10/20 03:11 AM
    Hi

    in 12.10 you could eirher use the exemples I Shared or évent call Python from opl to do anything you need

    https://github.com/AlexFleischerParis/howtowithopl/blob/master/dblinkpython.mod

    You May also See at 

    https://ibm-data-and-ai.ideas.aha.io/ideas/CPLEX-I-2

    that some news in the Next Release

    ------------------------------
    ALEX FLEISCHER
    ------------------------------



  • 5.  RE: CPLEX - Old database access syntax

    Posted 10/10/20 11:58 AM
    Hi Alex,

    Sorry for not explaining it before, but the main reason why I am forced to migrate to any version higher than 12.6 (12.7, 12.8, 12.9 or 12.10) is that the invocation I make to the * .mod and * .dat files from Visual Studio .NET 2017 is that there is a "Type" (as seen in the image) of the oplall.DLL file (located in CPLEX Studio) that does not have the class / type called "Cplex" (at least in version 12.10 the same code works correctly). I want to exhaust all the possibilities before migrating because there are thousands of lines of code in * .mod and * .dat (with the old table access syntax already mentioned above) and rewriting the code would take a long time. Maybe there is some trick to adapt / modify the oplall.DLL and avoid the error shown in the image. Thank you very much again.



    ------------------------------
    MIGUEL FLORES QUISPE
    ------------------------------



  • 6.  RE: CPLEX - Old database access syntax

    Posted 10/11/20 12:38 AM
    Thanks Alex,
    I have already solved my problem. I just had to remove the ILOG.OPL.Cplex code from the Visual basic .net program and everything was fixed.

    Thanks again Alex, for your time and patience.

    ------------------------------
    MIGUEL FLORES QUISPE
    ------------------------------