This tag specifies that the question is independent of any particular database and the sql should work in any rdbms.
Questions tagged [database-agnostic]
100 questions
0
votes
1 answer
Extracting date parts using DBIC while keeping queries database agnostic
I use a MySQL database in production and a SQLite database for running tests. One part of my application is used to gather monthly statistics for a year. I've successfully done this, however it came at a cost of not being able to automate tests…

a7omiton
- 1,597
- 4
- 34
- 61
0
votes
2 answers
Database INSERT INTO SET ... WHERE(SELECT ...)
I am trying to insert my values into table if Admin_User_Role_Id value against Admin_Id is not present in the table. Is it possible to insert!
My Table Structure:
Admin_User_Id (FK)
Admin_User_Role_Id (FK)
Is_Enabled (boolean flag)
Query which I…

mumair
- 2,768
- 30
- 39
0
votes
1 answer
How can I write a "no two values in [column_list] are equal" condition?
In SQL, the condition that a set of columns must have equal values is a bit repetitive:
SELECT * FROM t
WHERE col1 = col2
AND col2 = col3
AND col3 = col4;
But that's not half as bad as a "no two values can be equal" type condition:
SELECT *…

Air
- 8,274
- 2
- 53
- 88
0
votes
3 answers
What orm.xml features should be avoided to stay database agnostic?
I'm embarking on an adventure in JPA and want to, inasmuch as possible, stay database agnostic. What orm.xml features should I avoid to stay database agnostic?
For example, if I use strategy="AUTO" in orm.xml as follows:
…

Kaleb Pederson
- 45,767
- 19
- 102
- 147
0
votes
1 answer
What happens when a table in a database has more rows than the max size of the index data type?
For example if i have a unsigned int index in my table, what happens when i get more rows than sizeof(unsigned int) ?
I'm interested in MySQL/PostgreSQL/MsSQL.

daniels
- 18,416
- 31
- 103
- 173
0
votes
1 answer
Moving from Oracle SQL to ANSI SQL pros and cons
I work in a project where the UI has direct access to the database through SQL code. The company has a framework where we create UI pages in xml and after that it is parsed and creates FLEX pages. If we want some data from the DB (Oracle) we add a…
0
votes
1 answer
Pluggable database interface
I am working on a project where we are scoping out the specs for an interface to the backend systems of multiple wholesalers. Here is what we are working with,
Each wholesaler has multiple products, upwards of 10,000. And each wholesaler has…

sotn
- 1,833
- 5
- 35
- 65
0
votes
2 answers
Static Analysis Tools for Database Design
I'm looking for Static Analysis Tools for Database Tier. I got some answers for reviewing PLSQL, TSQL code, i'm wondering what are the options available for reviewing database design for naming conventions of tables and their columns, foreign key…

suyasha
- 41
- 2
- 3
- 12
-2
votes
2 answers
Cumulative sum() every 3 days SQL
I have a table like this
date amount
2020-02-01 5
2020-02-02 2
2020-02-03 10
2020-02-04 2
2020-02-06 3
2020-02-07 1
And I need sum() every 3 days as below:
date amount sum
2020-02-01 5 5
2020-02-02 …

Anastasia
- 13
- 1
-5
votes
1 answer
Expected behavior or truncated/overflow cast
Is there a standard way for how the following statements evaluate, or is it implementation-defined?
SELECT CAST(100000 AS int16); # integer overflow
SELECT CAST("hello" AS VARCHAR(2)); # string overflow (truncation?)
For example, should the…

David542
- 104,438
- 178
- 489
- 842