Questions tagged [table-functions]

A function in a relational database system that does not return a single value or row, but an arbitrary number of them. In SQL, a call to a table function can usually be used instead of a table.

A function in a system that does not return a single value or , but an arbitrary number of them.

In , a call to a table function can usually be used instead of a table.

Table functions go by different names in different relational database systems, such as in .

94 questions
0
votes
2 answers

Configure Entity Framework to call a SQL Server table function instead of a table on a specific entity

I have a table of entities (let's say documents), where each document may have a different entity connected to it (let's say permission). A permission has a foreign key to the document table. Example: Schema: Document -> Id | Data Permission -> Id |…
Amir Popovich
  • 29,350
  • 9
  • 53
  • 99
0
votes
0 answers

two different operation in different cases sql table function

I want to program a function that sees how much time the client spent of time without paying the seller. My problem is that I'm kind of confused because this is the function that already programmed: ALTER function [dbo].[bal_cli](@date date, @diff1…
0
votes
0 answers

connectby of PostgreSQL gives invalid return type error

I'm trying to recreate the following connect by sql of Oracle's HR Schema in PostgreSQL. select employee_id, manager_id, lpad(' ',level*2,' ')||first_name name, level from employees start with manager_id = 100 connect by prior employee_id =…
Varun Rao
  • 781
  • 1
  • 10
  • 31
0
votes
0 answers

DRG-10849 - Only when calling from higher level function

I have several tiers of table functions which are used to perform a search. I have a CTXCAT index on the relevant tables. When calling one particular function directly I recieve no errors and get the results I am expecting to see However when I call…
Zach Ross-Clyne
  • 779
  • 3
  • 10
  • 35
0
votes
1 answer

How can I do this faster than cursor?

I have 2 tables: first is : dept second is : payment I want to compare these tables and make one result table . Tables include : table debt: customerid order amount 1 1 30 1 2 50 1 3 …
CompEng
  • 7,161
  • 16
  • 68
  • 122
0
votes
2 answers

Using a table function with no importing parameters in a HANA graphical calculation view

I'm wondering if someone can help me decipher this Hana Studio Error. I'm very new to this, so apologies if this is just me being simple. I'm trying to use table functions, just something simple for starters (i.e no params in, table out). The…
mitch_au
  • 323
  • 1
  • 2
  • 9
0
votes
1 answer

Teradata UDF's in C++

I have gone through the official documentation of Teradata. I am planning to write a table function (UDF in C++) which accepts 2 columns as input, processes the input and converts it to a std::map< string,string > or array of structs and passes it…
0
votes
1 answer

Defining a psql C function gives a column definition list is required for functions returning "record"

I am trying to write a function for Postgres 9.6 that access some code written in C. My function is defined as: CREATE OR REPLACE FUNCTION graph_cluster_graph (sql text, has_rcost boolean) RETURNS SETOF RECORD AS '$libdir/libpgrouting-2.4',…
Dave
  • 577
  • 6
  • 25
0
votes
1 answer

T-SQL call table function passing multiple values and aggregate results

I have a Table function which returns a set of rows based on a parameter, which looks like this example: CREATE FUNCTION fn_get_records (@PARENTID INT) RETURNS @returnTable TABLE ( -- columns returned by the function Id INT NOT NULL, …
Raffaeu
  • 6,694
  • 13
  • 68
  • 110
0
votes
1 answer

V$SQL stats for PLSQL table function

I recently moved a set of my Oracle SQL queries to a package with table functions where I am returning data pipelined. However, I started observing something unusual. V$SQL stats like buffer_gets, fetches, cpu_time, execution_time etc, have started…
Chinmoy
  • 1,750
  • 2
  • 21
  • 45
0
votes
1 answer

how to corectly call table function in PL/SQL

I have table function which returns table of file names (type t_file_list is table of clob;) from .zip file (in BLOB format) the header is like: function get_file_list( p_zipped_blob in blob ,p_encoding in varchar2 := null ) return…
Silverrook
  • 51
  • 1
  • 2
  • 8
0
votes
1 answer

Creating a Table valued Function if doesn't exist dynamically and altering it normally

I am working on creating a table-valued function but before creating it I would like to check if it exists and if it doesn't exist then create the function using dynamic script and then alter it normally. IF NOT EXISTS (SELECT * FROM…
DoIt
  • 3,270
  • 9
  • 51
  • 103
0
votes
1 answer

Table function in sql database, getting error output

I'm trying to create a Table Function Total_Salary_By_Dept that returns a table Total_Salary_By_Dept_Table with 5 column: Dept_No (Int) Dept_Name (Char(30)) COUNT_Emp (INT) SUM_Salary (INT) AVE_Salary (INT) All with company database; This is what I…
0
votes
0 answers

Stored procedures return table function, having hard time finish it, stuck at the last few parts

I want to create a stored procedure Report_NEWTotal_Salary_ByDept using (by calling) the table function I created here: select e.Dept_No, d.Dept_Name, Count(e.Dept_No), SUM(e.salary) as Sum_Salary, AVG(e.salary) as AVE_Salary from …
0
votes
1 answer

Stuck at table function

Dept_No (Int) Dept_Name (Char(30)) and using the following database: EMPLOYEE (fmane, minit, lname, ssn, birthdate, address, sex, salary, superssn, dno) KEY: ssn DEPARTMENT (dname, dnumber, mgrssn, mgrstartdate) KEY:…
Lin Wei
  • 87
  • 1
  • 5