How to using replace function in tdengine through sql - tdengine

I have used tdengine for a few weeks, I know that tdengine has some basic methods that are helpful.
But I meet a problem while using sql to query data from tdengine, and I want to some column edit for the retrieve columns. In mysql the sql would like this :
SELECT REPLACE('www.mysql.com', 'w', 'Ww');
I didn't find any method like this for tdnengine. And i want to ask does tdengine support this function or not? if not does tdengine support udf that i can define a replace function by myself?

TDengine doesn't support "Seelct Replace()", we have plan to support UDF in near future, but there isn't specific target date for releasing UDF for now.

Related

Netezza Loading table from SQL Server

I have a very large table stored in SQL Server and I now want to transfer this table to the Netezza system. Do I need to use SSIS in order to accomplish this task?
Before this, I've only had to use Aginity to load tables that were stored on the network and not in a server to Netezza, so loading from another server is new to me. Can someone guide me in the right direction please?
I would unload to a file in UNIcode format and load to Netezza with an external table. Just remember to change all string datatypes to nvarchar unless you are 100% English in your data (not likely these days)
I know it sounds 1980 but it’s (still) the most performant and reliable method

Interbase to Firebird Migration

Besides doing a data pump. Is there any other solutions for migrating?
Can you take a GBK and restore it to firebird? Is there any other migration issues you may have run into?
Besides doing a data pump. Is there any other solutions for migrating?
no, this is the only solution
Can you take a GBK and restore it to firebird?
no, it is not compatibile backups files
Is there any other migration issues you may have run into?
you can run into many issues and as #Mark Rotteveel say it is to board. You can talk about specific issue you have.
I can point you to few issues:
Ambiguous field name between tables - as Interbase allow you to do select from two tables with same field names and put this names in the where clause without aliasing it
field not contained in the aggregate - as Interbase buggly check fields when you do group by
order by in aggregate like select count(*) from table_name ORDER BY some field Interbase allow this Firebird not
Count(*) return Int64 in Firebird in Interbase it is Integer
identifiers longer then 31 chars are not allowed in current Firebird Interbase allows it but not handle it as it understand only first 31 chars
if you use Delphi and IBX - you can not use Boolean fields in Firebird as IBX handling is not compatibile with Firebird

MS Azure DB: cannot find data type XML & Incorrect syntax near ' Identity'

I was trying to change the data type into XML in order to split one column into multiple columns. However, when I ran the syntax below, an error: cannot find data type XML was showed. I searched some of the answers online. It seems Azure is supported for XML. Is there a way to solve it?
cast('<m>'+replace(Employee_Name,#delimiter,'</m><m>')+'</m>' as XML)
Besides, I found that IDENTITY(1,1) is not supported either.
With SQL-Server 2016 there is native support for this: STRING_SPLIT()-function. But - according to the linked doumentation - this seems not to be offered for Azure Data Warehouse...
The string splitting via XML needs the XML-DataType, since you will need .nodes() and .value() to retrieve the values. According to this documentation this is supported with Azure Database, don't know of restriction with the Data Warehouse version...
There are many examples for string splitting functions using loops or recursive CTEs. This article compares some of them...
This error occurs when you try to run the query casting to XML while logged into a Microsoft Azure SQL Data Warehouse. Azure SQL Data Warehouse does not support the XML datatype. You can confirm your version with the following sql:
select ##version
https://learn.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-tables-data-types

Create a user-defined aggregate without SQL CLR

I am planning on deploying a database to SQL Azure, so I cannot use the SQL CLR. However, I have a need to create an aggregate function -- in my case, I need to STUnion a bunch of Geography objects together. (Azure is expected to support Spatial by June.)
Is there another way to accomplish this, without making use of the CLR, in a query? Or do I have to create a UDF that will take a table as a parameter and return the aggregate?
You can't do it.
Geography is supported in Azure SQL now.
https://msdn.microsoft.com/en-us/library/cc280766.aspx

Which is faster for SSIS, a View on a table or a Conditional Split?

I have an SSIS project where one of the steps involves populating a SQL Server table from an Oracle Table.
The Oracle table has a column ssis_control_flag. I want to pull across all records that have this field set to 'T'.
Now, I was wondering which would be the best way of doing this, and the two options as I have detailed in the question presented themselves.
So really, I am wondering which would be faster/better. Should I create a conditional split in the SSIS package that filters off all the records I want? Or should I create a view in Oracle that selects the records based on the criteria, and utilise that view as the data source in SSIS?
Or is there an even better way of doing this? You help would be much appreciated!
Thanks
Why don't you use a WHERE clause to filter the records, instead of creating a view? May be I am not getting your question correctly.
Then in general, bringing all the data to SSIS and then filtering out is not recommended. Especially when you can do the filtering at the source DB end itself. Consider the network bandwidth costs as well.
Then this particular filter that you are talking about here, cannot be done with a better efficiency in SSIS than that can be done at DB. Hence better do it in the Oracle DB itself.
You can use a query using openrowset as the source for the dataflow instead of directly accessing the Oracle table.

Resources