The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
2answers
59 views

Latitude and Longtitude Distance Calculation

I'm using MySQL and I am trying to calculate the distance in meters between two different longitude, latitude coordinates. I wrote a stored function in MySQL but it calculates just 1 for each row in ...
2
votes
1answer
56 views

Getting Visual Studio to deploy a UDF to Return NVARCHAR(MAX)

I have a SQLCLR stored procedure with the following signature in Visual Studio 2013: [SqlFunction(DataAccess = DataAccessKind.Read, SystemDataAccess = SystemDataAccessKind.Read)] public static ...
1
vote
1answer
298 views

Automatic conversion of anonymous records returned from an UDF to well known table-type

Proprietary code (that we cannot change) has a bunch of user defined functions of the type: create or replace function f() returns record as $$ ... $$ which we call in the following way (for ...
2
votes
2answers
434 views

Insert values from a record variable into a table

I am developing a user-defined function that takes two arguments: create or replace function gesio( events_table_in regclass, events_table_out regclass) returns void as $$ ... $$ ...
3
votes
2answers
321 views

Why cannot I call a table function in iSeries DB2 that I just created?

Using iSeries Navigator 'Run an sql script' window I created a new table function. When I go to the Functions branch under the schema where it was created, I see the function among the other few. But ...
1
vote
1answer
337 views

MySQL possibility to create global routines (stored procedures and/or functions)

Is it possible to somehow define globally available routines? It seems like every routine must be created in a scope of the database. When I tried to create a routine from console (without prior ...
1
vote
2answers
50 views

Optimizing UDF - Is Using DUAL Expensive

I am new to Oracle technology (primarily versed in SQL Server) and I am having trouble with the performance of a UDF. The purpose of the UDF is to take some inputs for an "event", and look up an ...
6
votes
1answer
574 views

Postgres functions vs prepared queries

I'm sure it's there but I've not been able to find a simple definitive answer to this in the docs or via Google: In Postgres, are prepared queries and user defined functions equivalent as a ...
1
vote
0answers
104 views

Inline TVF with One Row Result

I have several times converted scalar functions into inline tvf. Usually this is the basic design I used in inline tvf: CREATE FUNCTION TVF(@ID INT) RETURNS TABLE AS RETURN( WITH BASE AS( ...
1
vote
0answers
139 views

MariaDB CUstom Functions

In MySQL, I wrote functions in C++, compiled them as .so, and added them to MySQL. I am trying to find a website that shows an example for doing the same in MariaDB. I cannot find any instructions, ...
1
vote
0answers
105 views

When converting a table valued function to inline, why do I get a lazy spool?

I have a table valued function that I want to convert to inline to improve performance. It sets the value of variables to the value four bit columns in one row of a table (looking up the row using a ...
0
votes
1answer
102 views

Different Results between stored proc and udf

I am getting different results between my stored proc and my SVF. The jist of of the both of them is that, it queries a remotely linked server, jams those results into a temp table/table variable, ...