We are working on Migrating netezza to Snowflake. And their are some functions in Netezza which needs to migrated as well.
However Like we can get the function defination in snowflake with below command.
Select get_ddl('Function','Get_beta(i int)');
Do we any thing similar in Netezza. We are using Dbeaver to connect to Netezza. and have no access to Netezza terminal.
Thanks in advance.
Related
I am working on SQL Server migration to Databricks.
I have a number of TSQL procedures, minimum of 100 lines of code.
I want to convert these procedures to Spark code.
For POC ( worked on 1 TSQL proc), all source files were imported and created as GlobalTempView's, and converted TSQL into Spark SQL.
and by using final globalTempView exported as a file.
Now, I have a question here, creating GlobalTempView's and converting TSQL proc to Spark SQL is the best way?, or loading all files into a data frame and re-write that TSQL proc to Spark data frame logic is best way.
kindly please let me know which is the best way to convert TSQL procs to Spark SQL or dataframes? and reason also.
You can use Databricks to query many SQL databases using JDBC drivers, therefore no extra task is required to convert the existing stored procedure to Spark code.
Check this Databricks official document to know more and steps to Establish connection with SQL Server
Migrating file to DataFrame is also another possible approach but be aware that Spark DataFrames are immutable so any UPDATE or DELETE actions will have to be changes to output to a new modified DataFrame.
I suggest you to go through Executing SQL Server Stored Procedures from Databricks (PySpark) in case you are approaching to execute stored procedures from Databricks.
I am connecting DBeaver to snowflake using jdbc 3.13.5 driver.When I am running queries on snowflake, the queries are not returning any data and are getting stuck in Discover attributes. When I check it on Snowflake history, the query already ran.
So in conclusion , the query ran on snowflake, but not able to display result in DBeaver.
Please help.
I have Netezza DB table DDL's in bulk for which I would like to convert them into Snowflake version. Is there any simpler method to do this?
Please advise.
Thank you!
If you DDLs are ANSI SQL standard, then it will work without any issue as Snowflake SQL is ANSI SQL (1999 & 2004) standard and hence it makes the SQL migration easy. What part of SQL makes so different in Netezza which you think is not compatible with Snowflake SQL?
We are using a SAP HANA environment to connect to various databases (SQL Server, Oracle, Teradata). Now one of our sources (the SQL server one) contains a lot of stored procedures to calculate transient values. We would need to have these values as well in SAP HANA and are thinking about the best way:
Ideally, HANA can call the stored procedure of SQL and get back the result data, but I could not find information about this. Is this possible?
Another option is to write a little program (Java) in HANA that can call the stored procedure on SQL Server and then give back the data (either directly, or by storing is some temporary table on SQL side and then read in with HANA).
Other ideas?
Does anybody have suggestions on this?
As long as you can run SQL queries you could see if using OPENROWSET would work for you.
Using OPENROWSET with stored procedure as source you can then consume data as it would SQL rowset.
SELECT * FROM
OPENROWSET ('SQLOLEDB','Server=(local);TRUSTED_CONNECTION=YES;','exec master.dbo.sp_who')
AS tbl
Using SAP HANA Smart Data Integration (SDI) remote sources, you are able to access/federate to remote tables, views and stored procedures.
First create the remote source, then wrap the Stored Procedure in a Virtual Procedure, these can be created via the Web IDE or SQL. You would use the CREATE VIRTUAL PROCEDURE statement as described below.
Create Virtual Procedure with Web IDE
CREATE VIRTUAL PROCEDURE via SQL
Just wondering what is best practice to achieve:
We have stored procedure that runs in SQL Server and needs to do some calculations with a huge fact table to be stored on Netezza.
The flow:
Stored procedure will create temp tables on SQL Server
These will be sent to Netezza to be joined with the fact table
Calculations will be made in Netezza
Results will be passed back to SQL Server
What are the ways to pass the temp tables from SQL Server to Netezza?
Thanks
The Only way that I know of to get data in and out of Netezza is through flat files, or using the ODBC drivers to work with Netezza directly and hold a recordset in memerory and write to Netezza through an odbc connection..
Regardless of if you are on Windows or Unix, Netezza comes with client tools that you can use to connect to Netezza. Fyi, don't bother looking for them on the internet. You will have to get them from Netezza directly, or from the person that manages that relationship.
I would suggest looking into how I might be able to use the ODBC drives in SSIS to do the work for you. I'm not a pro at SSIS so I can't say I would know how to do that, but I would look into that first.
If I had to accomplish the task I would write something in C# to perform the following tasks.
Create flat files from sql server
Connect to Netezza Create external table that links to the flat file.
Call procedures in Netezza to do the work and generate the data for export in a temp table.
Export the new data to a flat file and import that back into sql server.
Now that I think about it you might also try the following, it is untested however. I wonder if you can create a linked table in sql server and an external table in Netezza that uses the same flat file. Baring a file lock, if they can, you can create a quasi-link to netezza from sql server.
To find out more about external tables in netezza. Look in the doc Netezza User Guide in chapter 5.
Netezza User Guide
Also, if you are interested in the coding side there is a very good link below to how to connect to netezza via c#.
Stack Post
I ended up using some of that post to build the method below to execute commands against Netezza.
OdbcDataReader GetReaderForCommand(string strCmd, string dbname)
{
var conn = new OdbcConnection();
conn.ConnectionString = "Driver={NetezzaSQL};servername=<servername>;port=5480;database="+dbname+"; username=<username>;password=<pwd>;";
OdbcDataReader rdr = null;
conn.Open();
System.Data.Odbc.OdbcCommand cmd = new System.Data.Odbc.OdbcCommand(strCmd, conn);
rdr = cmd.ExecuteReader();
return rdr;
}
Lastly, here are a couple of links that I would follow up with.
enzeecommunity.com - User base to search and ask questions of.
A free management studio to use with Netezza.
http://www.aginity.com/ProductivityTools/WorkbenchOverview.aspx -