# Data Source script to acquire Data having Scandinavian Characters in fields # Min WFA version needed: WFA4.0RC1 #Author: Abhishek Sinha #Email : sinhaa@netapp.com $pwd = Get-Location $mysqlcmd = $pwd.Path+"\..\..\..\..\mysql\bin\mysql.exe" $wfaService=(Get-WmiObject -Class Win32_service -filter "name='NA_WFA_SRV'").StartName if ( $wfaService -eq "LocalSystem" ) { throw("NetApp WFA Server service is running as LocalSystem. Restart it using an Administrator account and try again.") } # Default credentials for playground database $MySQLAdminUserName = 'wfa' $MySQLAdminPassword = 'Wfa123' $MySQLDatabase = 'scandinavia' $MySQLHost = "localhost" $MySQLLoginPath='wfa' ################ ##TRUNCATE ALL Data present into table scandinavia.football_players $Query = 'TRUNCATE TABLE scandinavia.football_players' $output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$Query" "$MySQLDatabase" #1st row $name = 'Thomas Sørensen' $country = 'Denmark' $position = 'Goalkeeper' $status = "Retired" $Query = $("INSERT INTO scandinavia.football_players (name, position, country, status) VALUES ('$name', '$position', '$country', '$status');") $output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$Query" "$MySQLDatabase" #2nd row $name = 'Simon Kjær' $country = 'Denmark' $position = 'Defender' $status = "Active" $Query = $("INSERT INTO scandinavia.football_players VALUES ('2', '$name', '$position', '$country', '$status');") $output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$Query" "$MySQLDatabase" #3rd row $name = 'Kim Källström' $country = 'Sweden' $position = 'Midfielder' $status = "Active" $Query = $("INSERT INTO scandinavia.football_players VALUES ('3', '$name', '$position', '$country', '$status');") $output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$Query" "$MySQLDatabase" #4th row $name = 'Gösta Löfgren' $country = 'Sweden' $position = 'Forward' $status = "Retired" $Query = $("INSERT INTO scandinavia.football_players VALUES ('4', '$name', '$position', '$country', '$status');") $output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$Query" "$MySQLDatabase" #5th row $name = 'Åge Hareide' $country = 'Norway' $position = 'Midfielder' $status = "Retired" $Query = $("INSERT INTO scandinavia.football_players VALUES ('5', '$name', '$position', '$country', '$status');") $output = & "$mysqlcmd" "--login-path=$MySQLLoginPath" "--user=$MySQLAdminUserName" "--host=$MySQLHost" "-B" "-f" "-e$Query" "$MySQLDatabase"