I have a nodejs server that uses tds to connect to a sqlserver database and returns the requested query in xml or json format.
The request would be in http and include the sql query i.e.
Select * from customers
The node server works fine, but I now want to connect to this from Pentaho and have been trying to figure out how I can do this.
is this possible and if so how ?
If you use the CTools, you can use an AjaxRequestComponent or directly in jquery with $.ajax
Related
I'm new to SQL Server. I would like to pull data from an AppsFlyer website, which requires some information like date in the format yyyy-MM-dd and an API key.
Here's a example of the API I need to use:
https://hq.appsflyer.com/export/br.com.mottu/partners_report/v5?api_token={Account owner API key should be used}&from=yyyy-mm-dd&to=yyyy-mm-dd
Here's the website
https://support.appsflyer.com/hc/en-us/articles/207034346-Pull-APIs-Pulling-AppsFlyer-Reports-by-APIs
I am trying to connect my SQL Server directly to the SAP backend database so that I don't have to extract the data everyday (for fresh data) using SSIS packages.
Instead I want to create views that will access this data directly (direct querying) and get refreshed periodically.
Can someone give me a link or show/tell me the steps on how to do this?
If you know the hostname of the backend server, you can do something like this:
SELECT TOP 1 * FROM hostname.databasename.dbo.tablename
If you want to access your data from external SQL server directly in SAP you can define connection to external database in transaction DBCO:
Then in your ABAP code you can write SQL statements using OPEN SQL:
EXEC SQL.
CONNECT TO my_new_connection.
ENDEXEC.
...
EXEC SQL.
SELECT * INTO TABLE :lt_internal_table FROM dbtable.
ENDEXEC.
...
EXEC SQL.
DISCONNECT my_new_connection.
ENDEXEC.
or using Classes CL_SQL_CONNECTION, CL_SQL_STATEMENT. An Example program ADBC_DEMO show how to use it.
Can I validate a web-service response with a database query?
Run webservice --> Get response --> Capture response
Run corresponding SQL Query
Compare response with SQL query result
Yes. Use Java interop. There are two examples in the demos. For example, this one.
I have a legal requirement to store the entire SOAP request to my service in a database. I have SQL Server 2008 R2. And I recently learnt about the XML datatype in SQL Server. My requirement is to store the request xml and expose the same in the get method of the service. This data is not 'transactional' as in nobody can make updates to this request. So is the XML type a good candidate for this? And I want to be able to tie a schema with this.
Request Id int
Request XML
As long as these SOAP requests are indeed well-formed XML - sure, you can use the XML datatype for this - that's what it's been introduced for in SQL Server 2005 !
One point to be aware of: the XML is not stored as is as a text representation - it is tokenized and stored in an optimized fashion. So when you ask for the XML back from SQL Server, you'll get an XML representation that is semantically correct - but it might not be exactly the same as you stored into the XML column. SQL Server can e.g. replace an explicit opening and closing tag (<SomeNode></SomeNode>) with an auto-closing tag (<SomeNode />) or do other optimizations. Just something to know when you're using the XML datatype in an auditing capacity as you seem to intend it for.
I tried to query another specific server many times, but i failed... I searched and i found out that the server must be linked with the other server in order to achieve what i want. Unfortunately is not in my hands to change that so my question is, if it is possible to query the other server by providing credentials.
The server i want to query has SQL Server 2005 Service Pack 4 (9.00.5000) and the server i'm working on has SQL Server 2005 Service Pack 3(9.00.4035).
Thanks in advance.
Use OPENROWSET or OPENDATASOURCE instead. Both allow you to pass credentials. This is your best option if you are unable to use a linked server.
This example works if you are using SQL Server logins.
SELECT a.*
FROM OPENROWSET('SQLNCLI', 'SERVER=<servername>;UID=<username>;PWD=<password>',
'SELECT FOO FROM FOO.BAR') AS a