Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How to read array of integers from database?

  • 1.  How to read array of integers from database?

    Posted 05/27/13 11:43 AM

    Originally posted by: RafaBeginner


    I created a  table in a database  for storing integers and filled with with exemplary data:

    [[1,1,1],[2,2,2],[3,3,3],[4,4,4]] .

    How can I read that data in my .dat file, so that these values would initialize an array:  int myData[1..4][1..3] ? I know how to read those numbers and store in a set of tuples, but it is not what I want. 

    Thanks in advance.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to read array of integers from database?

    Posted 05/28/13 04:09 PM

    Hi,

     

    you should have a look at the example oil and at the files oildDB2.mod and oildDB2.dat

    gasType Gas[Gasolines] = ...; in the .mod is an array

    Gasolines,Gas from DBRead(db,"SELECT name,name,demand,price,octane,lead FROM GasData"); in the .dat

    regards

     

    Alex


     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer