Ana-plan Connect to SQL Server

Options
roshin
roshin Member, ALL USERS, Partner Posts: 4 New Contributor

Hi Team, 

 

Am trying to create a connection between Anaplan to SQL server to import the as list from MS Sql table to Anaplan. Please find the below script i am using. 

 

@echo off

set AnaplanUser= roshin.rasheed@xxxx.com:password
set WorkspaceId= 123434343
set ModelID= sdsfsdsdsdsds

set Operation= -file "Source System from SampleLoad.txt" -jdbcurl "jdbc:sqlserver://localhost:1433;DatabaseName=Anaplan_Source" -jdbcuser ":" -jdbcquery "jdbc.query=select * from Anaplan_Tbl_1" -import"Source System from SampleLoad.txt" -execute


rem *** End of settings - Do not edit below this line ***


setlocal enableextensions enabledelayedexpansion || exit /b 1
cd %~dp0
if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation%
@echo %Command%
cmd /c %Command%
pause

 

*******************

Its not giving me output but giving error. Please advise where am wrong. 

 

Regards

Roshin 

Comments

  • roshin
    roshin Member, ALL USERS, Partner Posts: 4 New Contributor

    Hi Jesse, 

     

    I tried to do it a different way like below . 

     

    *****************************************

    @echo off

    set AnaplanUser= "roshin.rasheed@gds.ey.com"
    set WorkspaceId= "asasasasasas"
    set ModelID= "sasasasasasa"

    set Operation= -file "Anaplan_Sql" -jdbcproperties "C:\Users\Roshin.Rasheed\Desktop\anaplan-connect-1.4\jdbc.properties" -import "Source Systems from Anaplan_Sql" -execute

    rem *** End of settings - Do not edit below this line ***

    setlocal enableextensions enabledelayedexpansion || exit /b 1
    cd %~dp0
    if not %AnaplanUser% == "" set Credentials=-user %AnaplanUser%
    set Command=.\AnaplanClient.bat %Credentials% -workspace %WorkspaceId% -model %ModelId% %Operation%
    @echo %Command%
    cmd /c %Command%
    pause

    *******************************

     

    Properties file as below : 

     

    # JDBC Connection string (Oracle, Mysql, H2, etc.)
    jdbc.connect.url=jdbc:sqlserver://localhost:1433;DatabaseName=Anaplan_Source

    # JDBC login username
    jdbc.username=

    #JDBC login password
    jdbc.password=

    # (Optional) JDBC Fetch size, might not be applicable for all JDBC driver flavors.
    jdbc.fetch.size=10

    # Boolean flag, needs to be true if provided {jdbc.query} is a
    # stored-procedure/function call.
    # Defaults to false if no value provided, or invalid.
    jdbc.isStoredProcedure=false

    # SQL query could be Select or a Stored-Procedure/Function call. In case of latter,
    # require {jdbc.isStoredProcedure} above set to "true".
    # NOTE: SQL query needs to be parametrized with ? placeholders and values for
    # placeholders needs to be provided below in {jdbc.params}.
    jdbc.query=select * from Anaplan_Tbl_1

    # JDBC parameters for parametrized SQL query in {jdbc.query} above.
    # NOTE: Number of parameters must equal to the number of parameters provided in {jdbc.query} above.
    #jdbc.params=1234,ABC

     

    Now its showing me error as :

     

    2019-03-14 14:20:16 [32mINFO [0;39m [35m15940[0;39m |-- Initializing Service...
    2019-03-14 14:20:17 [32mINFO [0;39m [35m15940[0;39m |-- Authenticating via Basic...
    2019-03-14 14:20:38 [32mINFO [0;39m [35m15940[0;39m |-- Retrying API request: Attempt (1)
    2019-03-14 14:21:01 [32mINFO [0;39m [35m15940[0;39m |-- Retrying API request: Attempt (2)
    2019-03-14 14:21:26 [32mINFO [0;39m [35m15940[0;39m |-- Retrying API request: Attempt (3)

  • roshin
    roshin Member, ALL USERS, Partner Posts: 4 New Contributor

    Hi Team , 

     

    The probelm was with our internal Network blocking the connection , We are good now. 

     

    Thanks again for your responses and help in this matter. 

     

    Regards

    Roshin