Skip to main content

Questions tagged [functions]

A function performs some specified work, usually taking parameters as input. In terms of databases these may be specific to SQL or to the database vendor.

1 vote
1 answer
87 views

I have many 'title' and 'name' columns in different tables that have the same set of restrictions about what characters can be inserted and what not. For example, names should only allow alphabet plus ...
Shahriar's user avatar
  • 121
-2 votes
2 answers
119 views

Why does MariaDb use these terms differently? #drop table dbstructA; create table dbstructA(datum date); insert into dbstructA values('2025-01-01'); insert into dbstructA values('2025-...
MBE's user avatar
  • 91
2 votes
1 answer
102 views

Some DBMSs have a pi() function to give the value of π. I can’t find the equivalent for Db2. I can use radians(180), I suppose, but is there something more direct?
Manngo's user avatar
  • 3,207
0 votes
1 answer
82 views

I have a user-defined function that modifies sql data. It inserts into one table and returns the ID of the returned row. Trying to use it like this UPDATE table_X SET REV = REVISION(:timestamp, :user) ...
coladict's user avatar
  • 123
3 votes
1 answer
120 views

I work on a project that uses PostgreSQL. Some analytic queries take a lot of time, and we would like to prewarm two indexes and one table. Here are the prewarming queries: SELECT pg_prewarm('...
Emmanuel Guefif's user avatar
0 votes
1 answer
101 views

I have a function that currently uses 3 parameters: CREATE FUNCTION dbo.RatesReport (@StartTapeDate DATE, @StartFcbVersionId int, @StartSvbVersionId int) SELECT * FROM dbo.DataTapes t WHERE t.TapeDate ...
Daylon Hunt's user avatar
2 votes
1 answer
273 views

I can't get GRANT to take current_database() as argument. These all fail with the same error: GRANT ALL PRIVILEGES ON DATABASE current_database() to justintestin; GRANT ALL PRIVILEGES ON DATABASE (...
Chema's user avatar
  • 131
-1 votes
2 answers
347 views

I have a costly function and it only provides relevant data when certain conditions are met. That data is inserted into the result through a LEFT JOIN LATERAL as shown below. As it works now, the ...
Björn Morén's user avatar

15 30 50 per page
1
2 3 4 5
51