Questions tagged [database-programming]
23 questions
0
votes
1 answer
Postgresql conditionally include distinct in query
Postgresql conditionally include distinct in query
Is there way to modify a query such as:
select distinct col1, col2
from our_schema.our_table
where (id = '1001')
The goal is to easily activate/deactivate the distinct…

JosephDoggie
- 1,514
- 4
- 27
- 57
0
votes
1 answer
PostgreSQL trigger on insert external script with arguments
I have created function calling external script with arguments:
CREATE OR REPLACE FUNCTION foo3(text, text) RETURNS TEXT AS $$
$ip = shift;
$username = shift;
$cmd="/bin/echo -n $ip $username > /tmp/test";
return `$cmd`;
$$ LANGUAGE plperlu;
It…

user2913139
- 557
- 2
- 5
- 13
0
votes
0 answers
Using EF only for Insert/Update/Delete and SQL for Querying
Anyone has experience of using/developing a Data Access model which uses Entity Framework only for Insert/Update/Delete and raw SQL for Reading/Querying purposes. If any, how was your experience, what are the pros and cons for such a Data Access…

Joe Gage
- 33
- 9
0
votes
1 answer
PostgreSQL internals- using GUC in an Operator?
I am creating my own index method in PostgreSQL based on GiST as extension. I want one of my functions (check out Examples section) in my operator to behave differently based on a value defined by the user- I want to avoid the user having to drop…

Zeruno
- 1,391
- 2
- 20
- 39
0
votes
1 answer
How to Quote Square Brackets in a Field Name for ADO Recordset's Filter Property
I am attempting to specify a filter condition on an ADO Recordset where one of the field names contains both left and right square brackets as part of the name. The resulting condition string is being assigned to the Recordset's Filter property so…

HexTheKiwi
- 1
- 1
0
votes
2 answers
How do you search or sort in SQLite Database?
I have an application that stores information in a database based on the information from 5 text fields. I'm having trouble being able to sort through fields or just even sorting from one field. Also, what method does the ORDER BY clause go in?…

David Etim
- 1
- 1
-1
votes
3 answers
How to associate a customized number with exception
I have some code where I want to throw two exceptions; however, the exception are basically the same but with different values. I would like to know an elegant generic way to determine which of these errors occurred.
I know I can do two try catches…

Aelphaeis
- 2,593
- 3
- 24
- 42
-4
votes
2 answers
Dynamic Statement to Get Top "n" for Each Individual Column from Ms SQL Table
Help me with this Dynamic statement perform faster, the statement will fetch top n values for each column from a table.
The table will have an "n" number of columns but will have a primary key. NULLs couldn't have been avoided as any other value is…

Dani Mathew
- 808
- 10
- 18