sql-function Questions
2
Solved
I have a table valued function. Also I have scalar valued function within I have declared a temp table. I want to execute the table valued function inside of scalar valued function and set that val...
Midgard asked 19/1, 2018 at 7:19
2
Solved
My application is c# MVC5, using EF 6.1. Imported tables and functions using Database First. I can see the function in model (emdx) browser listed under DALModel.Store / Stored Procedures / Functio...
Padauk asked 15/10, 2014 at 6:25
4
I have a table valued function that returns a table. When I try to JOIN the table-valued function with another table I don't get any results, but when I copy the result of the function into an actu...
Fanfani asked 1/5, 2014 at 5:4
3
Solved
I have a table in SQL Server 2012 as the snapshot shows:
Then I'm using Last_Value() and First Value to get AverageAmount of each EmpID for different YearMonth. The script is as follows:
SELECT...
Neuromuscular asked 13/3, 2013 at 15:1
1
Solved
I'm new to SQL functions and trying to create a calendar table that displays custom week numbers, with each week starting with Saturday and ending on Friday. The first week of each year always cont...
Kannry asked 23/8, 2016 at 4:17
4
I want integrate Entity Framework 6 to our system, but have problem.
I want to use Code First. I don’t want to use Database First *.edmx file for other reasons.
I use attribute mapping [Table], [...
Truong asked 24/5, 2013 at 14:29
2
Solved
I created a function in SQL Server to execute a dynamic SQL query and return a value. I'm getting error when calling function in SQL query:
Only functions and some extended stored procedures can...
Cockle asked 1/9, 2016 at 4:16
1
Solved
I could not figure out how to use SQLite's functions like substr(X, Y, Z) with SQLAlchemy's query expression syntax. I am aware that I could use raw queries, but that would make it more difficult t...
Gabriello asked 4/8, 2016 at 19:2
3
Solved
I want to load some SQL functions in a empty database through psql:
psql -d my_database -f fuctions.sql --set ON_ERROR_STOP=1
I use --set ON_ERROR_STOP=1 because I want that psql fails if the...
Lowery asked 20/3, 2015 at 8:10
5
Solved
I have migrated a database from oracle, and now have a few Scalar-valued Functions.
However, when I call them, I get an error saying:
Cannot find either column "dbo" or the user-defined functio...
Skat asked 1/9, 2011 at 19:27
4
Solved
CREATE FUNCTION [dbo].[udfGetNextEntityID]
()
RETURNS INT
AS
BEGIN
;WITH allIDs AS
(
SELECT entity_id FROM Entity
UNION SELECT entity_id FROM Reserved_Entity
)
RETURN (SELECT (MAX(entity_id...
Exanimate asked 1/10, 2013 at 15:55
3
I have a table as follows
cat_id Cat_Name Main_Cat_Id
1 veg null
2 main course 1
3 starter 1
4 Indian 2
5 mexican 2
6 tahi 3
7 chinese 3
8 nonveg null
9 main course 8
10 indian 9
11 starter 8
12...
Gallegos asked 28/5, 2014 at 11:20
1
Solved
SELECT query I am using:
SELECT ARRAY[table_name,pg_size_pretty(table_size)]
FROM (
SELECT
table_name,
pg_table_size(table_name) AS table_size,
pg_indexes_size(table_name) AS indexes_size,
pg...
Hildegardehildesheim asked 10/12, 2015 at 6:4
3
Solved
Can any body help me in understanding if the execution plan for functions cached in SQL server?
Any online resource for this?
Tachyphylaxis asked 22/6, 2010 at 6:45
2
This sort of follows on from a previous question:
SQL Server Query time out depending on Where Clause
In which a query would run extremely slowly depending on a where clause. I rewrote that query...
Fontaine asked 3/12, 2012 at 5:38
2
Solved
I am trying to strip HTML tags from all of my records directly through MySQL. Thanks to StackOverflow's this question, I found the following function, that kind of does strip html tags -
SET GLOBA...
Squashy asked 12/8, 2015 at 7:27
4
I have to execute a loop in database. This is only a one time requirement.
After executing the function, I am dropping the function now.
Is there any good approach for creating temporary / disposa...
Goldie asked 14/2, 2011 at 9:36
7
Solved
If you set up a table's column to be a computed column whose Formula calls a Function, it becomes a pain to change that underlying Function. With every change, you have to find every single column ...
Trudytrue asked 12/2, 2009 at 21:55
1
Solved
I have a fullname column for authors and would like to extract the surname into another column. I do that with the following raw SQL:
SELECT name,
SUBSTRING_INDEX(`name`, ' ', -1) AS `surname`
FRO...
Mertens asked 15/6, 2015 at 13:6
3
I have a scalar-valued function in my SQL database.
I receive this error when importing this function into Entity Framework model:
Error 6046: Unable to generate function import return type of the...
Caucasoid asked 11/6, 2014 at 10:48
3
Solved
Can I SELECT multiple columns into multiple variables within the same select query in MySQL?
For example:
DECLARE iId INT(20);
DECLARE dCreate DATETIME;
SELECT Id INTO iId, dateCreated INTO dCr...
Cylinder asked 15/3, 2010 at 21:12
6
Solved
I have a sql function that includes this code:
DECLARE @CodeNameString varchar(100)
SELECT CodeName FROM AccountCodes ORDER BY Sort
I need to concatenate all results from the select query...
Rusert asked 4/3, 2011 at 16:15
1
Solved
So I wrote this method that aims at querying to another remote database with the same structure using dblink (inspired from this post Specify dblink column definition list from a local existing typ...
Blackface asked 5/9, 2014 at 18:1
2
Solved
What's the difference between a function that returns TABLE vs SETOF records, all else equal.
CREATE FUNCTION events_by_type_1(text) RETURNS TABLE(id bigint, name text) AS $$
SELECT id, name FROM...
Handcrafted asked 15/3, 2014 at 12:43
4
Solved
I have to keep track of revisions of records in a table. What I've done is create a second table that inherits from the first and adds a revision counter.
CREATE TABLE A (
id SERIAL,
foo TEXT,
PRI...
Laomedon asked 13/2, 2010 at 21:38
© 2022 - 2025 — McMap. All rights reserved.