How to send an email when connection to teradata fails? - sas

I'm using the standard way of connecting to Teradata from SAS like below:
connect to teradata (user="youruserid" password="yourpassword" server="servername" mode=teradata);
I have multiple such codes which are scheduled one after the other. What I realized is that if Teradata server is down sometime then few codes fail. I want to do is to get an email each time such connection failure happens in SAS.

Related

Insert data from 1 mysql database on a local server to a different one on a remote server

I have two database one is at client side and one is running at another machine (which i am using a remote database). I have to send a table data from client database to my remote database. But problem is if I use this code:
mysql_query(con, " select * from DB.Table1")
this function only works for Database (client side) and don't connect with my remote database. Its mean only 1 connection is possible at a time. I am doing it in C++ do you have any solution. ?

ODBC connection gives Unknown Host error from Power BI

I am using an ODBC driver of MarkLogic instance which I am using in Power BI to access MarkLogic database files.
I am using 64 bit ODBC driver and have set up the connection and tested the connection successfully. I have also accessed the MarkLogic files under Documents Database.
But today when I tried to connect from Power BI, it gives me this error:
Could not translate hostname "myhostname" to address : Unknown host
The same error is thrown when I am trying to test the connection in ODBC set up.
The driver used is Marklogic SQL.
MarkLogic is up and running, and there have been no changes done in any connection properties so far.

Google big query data server connection with cognos Analytics 1116

I am trying to create google big query data server connection with cognos analytics on cognos portal but i am getting below error . I have followed all steps . Placed json in the driver folder inside cognos install directory along with all the simba jdbc driver but not sure where i am missing .I have installed simba odbc drivers as well , system dsn is also showing simba driver but still getting connection refused. My cognos setup is installed on windows server 2019 data center which is Virtual Machine hosted on GCP and port 80,443 traffic is also enabled.
XQE-DS-0006 Unable to logon to the data source.
[Simba]JDBC Connection Refused: [Simba]JDBC Required Connection Key(s): OAuthServiceAcctEmail; [Simba]JDBC Optional Connection Key(s): AdditionalProjects, AllowLargeResults, DefaultDataset, EnableHighThroughPutAPI, FetchThreadsPerResultSet, ForceHTAPI, HighThroughPutMinTableSize, IgnoreTransactions, KMSKeyName, Language, LargeResultDataset, LargeResultsDatasetExpirationTime, LargeResultTable, MaxResults, OAuthAccessToken, OAuthClientId, OAuthClientSecret, OAuthRefreshToken, ProxyHost, RequestGoogleDriveScope, StringColumnLength, Timeout, TimestampFallback, useQueryCache
Please see the following document which goes through the connection step by step.
Google big query data server connection with cognos Analytics 1116
Its most likely the JSON file is not in the JDBC connection URL.

How to Use CDatabase to connect to SQL Server database with ODBC?

My program uses ADO to connect to SQL Server in Visual C++ 2008. Now it seems that ADO is out-dated and MS recommends to use ODBC again.
Therefore, I now study how to use ODBC to connect to SQL Server. I see there is a class CDatabase that can do that. However, there are no good article in introducing how to use CDatabase to connect to SQL Server via ODBC.
Basd on my research, it seems one can connect to SQL Server via ODBC in the following way:
Via a direct connection string like this one:
Driver={SQL Server Native Client 11.0};Server=myServerAddress;
Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Using ODBC administrator to create a DSN(Data Source Name), and then connect with DSN.
THen if 1 works, why do we need to create DSN?
You don't need a ODBC DSN. A DSN simply allows one to externalize the ODBC configuration such that server name, driver. etc. can be configured in a common way for all ODBC applications.
It is not a requirement to use a DSN when you store connection string in an external file so that environment-specific values can be configured without code changes. Regardless of the technique used, be sure to protect secrets rather than storing as clear text.

Connecting to SAS libraries via ODBC

I am new to ODBC and trying to make a DSN in Windows ODBC administrator to call it from R using "RODBC" or similar R-packages.
I am able to find the "server name" and "database name" for anything on "SQL Server" driver. However, "SAS" driver does not let me find explicit names for server and database names. All I know is the URI where the data set is stored, also I can get the host name of the SAS server that stores the databases and its port. Is there a way to add it as a DSN or even call it directly from R? I have tried several permutations of these name and addresses but I constantly get the same error that odbc connection was not successful.
For example, after I followed the steps to add SAS server in ODBC administrator, and I used RODBC package in R, I got this result
odbcConnect("mydbname")
[1] -1
Warning message:
In RODBC::odbcDriverConnect("DSN=mydbname") : ODBC connection failed