Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  DBConnection Issues

    Posted 05/01/17 10:50 AM

    Originally posted by: mikeabd


    Hello Team

    I'm trying to connect to a SQL server Express in my .dat file and I keep getting an error. Here is what I'm using to connect:

    DBConnection db("oledb","BCGCKA/ [bunch of numbers for my password] /BCGSandBox/BKA-BAROUMIK\\SQLEXPRESS");

    my user name: BCGCKA

    my Database name is BCGSandBox

    I believe my server name is 

    and the error i receive is (when I open SQLServer in the server name at Log In part it says this) : BKA-BAROUMIK/SQLEXPRESS

     

    Data parsing error: syntax error, unexpected (identifier), expecting from or to. 

    Will you please advise ? Do I miss something ?

     

    Thanks

    Mike

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: DBConnection Issues

    Posted 05/01/17 01:41 PM

    Originally posted by: mikeabd


    I have tried creating an ODBC and use that but it didnt work and I ended up with the same issue (error). Here is what I have done:

    DBConnection db("odbc","SQLServerODBC/BCGCKA/********")

     

    ODBC name: SQLServerODBC

    Username: BCGCKA

    Password: ********

     

    Thanks

    Mike

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: DBConnection Issues

    Posted 05/01/17 02:49 PM

    Hi,

    in the release notes for CPLEX 12.7 : DBLink has been removed.

    If you rely on Java you may use https://github.com/IBMDecisionOptimization/OPL-jdbc-custom-data-source

    With .NET https://github.com/IBMDecisionOptimization/OPL-.net-custom-data-source

    And do not forget that you may also use CPLEX 12.6.3 in order to generate a .dat file that you could then use with 12.7

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: DBConnection Issues

    Posted 05/01/17 03:00 PM

    Originally posted by: mikeabd


    Yes it is the 12.7 version. What is replaced for the DB link now ?

     

    Best

    Mike


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: DBConnection Issues

    Posted 05/01/17 03:13 PM

    Hi,

    what about the links I gave for java and .NET ?

    Or you could try what I suggested at https://www.ibm.com/developerworks/community/forums/html/topic?id=4bc2f3a5-19a6-4b68-91a4-c1447f209301&ps=25

    mix 12.6.3 and more recent versions.

    Could that work ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: DBConnection Issues

    Posted 05/01/17 03:41 PM

    Originally posted by: mikeabd


    Alex,

     

    I couldnt figure it out. Will you guide me to an example ? I'm using ILOG not Java or .NET.

    Also the link you sent doesnt work.

    Thanks

    Mike


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: DBConnection Issues

    Posted 05/02/17 02:46 AM

    Hi,

    here the example I provided at that link:

    So what you could do is

    oplrun -de exp.dat model.mod data.dat

    with oplrun v 12.6.3 in order to generate exp.dat which is a flat .dat not relying on dblink, contrary to data.dat with DBLink instructions

    And then you run oplrun with the latest cplexversion

    oplrun model.mod data.dat

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 8.  Re: DBConnection Issues

    Posted 05/02/17 08:14 AM

    Originally posted by: mikeabd


    Hi Alex,

     

    Where do I suppose to write this ? What are exp.dat model.mod and data.dat.

    Please make your explanations clear. Where is this DBLink instructions ? and BTW, why in the world IBM got rid of the BDLink ?

     

    Thanks

    Mike


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 9.  Re: DBConnection Issues

    Posted 05/02/17 08:22 AM

    Hi,

    you would type those in a command prompt

    See https://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.1/ilog.odms.ide.help/OPL_Studio/refoplrun/topics/oplrun_syntax_commandline.html

    for more about oplrun

    oplrun -de exp.dat model.mod data.dat

    will use DBLink and generate exp.dat as a flat file that you could use later with a more recent CPLEX version.

    Of course you could simply use CPLEX 12.6.3 alone if you need DBLink and do not need recent improvements.

    regards

     

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 10.  Re: DBConnection Issues

    Posted 06/23/17 01:21 AM


  • 11.  Re: DBConnection Issues

    Posted 11/02/17 04:51 AM

    Originally posted by: Monuy


    For the java, link is asking you to install a new Apache ant  

    And after that also Build and run etc.

    My only query is SheetConnection my_sheet("sheet_name") is working fine with  the excelSheet. Then there should be something which works for access files too.

    We expect it to be some keyworld/line that woulb be use as a replacement for DBConnection.

    Because for such a small thing we have to do a lot according to the link. I beleive there should be something for cplex 12.7.0.0, they can't be that hrash while improving the version. There should be the compatibility.

    Please reply.

     

    Thanks

    -Monu

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 12.  Re: DBConnection Issues

    Posted 11/02/17 06:17 AM

    Hi,

    in this thread I provided a workaround : mix CPLEX 12.6.3 where DBLink works and CPLEX 12.7

    You may also log your wishes as RFE :

    https://twitter.com/AlexFleischer1/status/916284494096846848

     

    https://twitter.com/AlexFleischer1/status/916284494096846848


    #DecisionOptimization
    #OPLusingCPLEXOptimizer