Questions tagged [database-view]

64 questions
1
vote
1 answer

Spring Data mongodb view

We use Spring Data mongodb version 2.1.3. We have two collections cities and countries. @Document public class City { private String name; private ObjectId id; private ObjectId countryId; } @Document public class Country { private…
Yan Khonski
  • 12,225
  • 15
  • 76
  • 114
1
vote
2 answers

Transforming a Query into a View

I have a long query that counts a few itens, based on periods. With that said, I have period P1 (which translates into 07:00:00 and 08:59:59, and so it goes. I have to calculate all the counts by medic and period . I use a binded value to search the…
Dosc84
  • 25
  • 5
1
vote
1 answer

Best way to page through results in SQLite

Suppose I have the following query in SQLite: SELECT * FROM mytable ORDER BY product ASC I would like the end user to be able to view the data in a scrollable manner (for example, like the currently-viewable data in Excel). If the user scrolls down…
David542
  • 104,438
  • 178
  • 489
  • 842
1
vote
1 answer

Create a database view joining multiple tables

I would like to get some help in creating a database view. My DB schema looks as following: products (id, ignored_comments_ids (array)) activities (id) comments (id) activities_comments (activity_id…
Dennis
  • 11
  • 2
1
vote
1 answer

Substring of a column in a join condition of database view

I need to create an SAP Database view for EKPO table with some other tables. And need to get EBELN column's first three chars like Substring(EBELN,0,3)
tarzanbappa
  • 4,930
  • 22
  • 75
  • 117
1
vote
1 answer

Problems Using Django 1.11 with Sql-Server database view

I am trying to use Django (django 1.11.4) to read data from a SQL-Server view (sql server 2012 - I use sql_server.pyodbc [aka django-pyodbc] for this), and nothing seems to work. Here's my model: class NumUsersAddedPerWeek(models.Model): id =…
1
vote
0 answers

Create view from multiple database

I learned about using db.siblingsDB and db.sisterDB. But I can't use both in creating a view from different databases. My example query I tried are: use "database1" var users = db.getSiblingDB("database2").getCollection("User").find({}) …
trying...
  • 309
  • 1
  • 11
1
vote
1 answer

ORA-22816 while updating Joined View with Instead of trigger

I read a lot about it but didn't found any help on that. My Situation: I've two database tables which belongs together. This tables I want to query with EntityFramework. Because Table B contains for EntityFramework the discriminator (for choosing…
1
vote
2 answers

JPA map view with no primary key to an entity

I've got a database view with no primary key. It has a set of columns which uniquely identify a row in the view, but three of those columns can be null. I've tried creating an entity with a composite primary key based on those four columns but when…
Daniel Rusev
  • 1,331
  • 2
  • 16
  • 35
1
vote
1 answer

Adding a view to EF4 model in 1:1 relationship

I am using EF4 and trying to add a SQL view into the model. The relationship between them is 1-1, one side is Order the other is OrderSummary (the summary is the view and contains aggregate data). When I add the view it detects the key on the view…
0
votes
0 answers

org.postgresql.util.PSQLException: ERROR: column j1_0.id does not exist error in springboot when trying to get data from database view

``package mk.ukim.finki.npb_proekt_be.model; import jakarta.persistence.*; import lombok.Data; import org.hibernate.annotations.Immutable; import org.hibernate.annotations.Subselect; import…
Markos
  • 1
0
votes
0 answers

Aurora Postgres's view with UDF - Performance issue

I'm facing a performance problem while joining a table with a view that has UDF in its definition. Although the documentation says that running a query against a view is just like running the SQL statement directly, in my case, the execution plan…
0
votes
1 answer

PostgreSQL insert all the matching columns on NEW in a INSTEAD OF trigger

My question is best illustrated with an example: Let's say we have two tables: CREATE TABLE usr_static ( id bigint, dob text, ... ); CREATE TABLE usr_version ( id bigint, name text, gender text, ... ) And a view: CREATE…
Marnix.hoh
  • 1,556
  • 1
  • 15
  • 26
0
votes
1 answer

Cloud Spanner Error: Cannot read properties of null (reading 'join')

In the cloud console, I created a new Cloud Spanner View called StudentView which left joined my Student table and a ClassEnrollment table. The update seemed to work as I could see the new View created. I then looked at my Students table and I got…
0
votes
0 answers

Trigger, Views or something else?

I have some tables to describe a trips. Table stops keeps intermediate stops of trips. Table trip has an attribute type witch indicates on which continent the trip was made. CREATE TABLE continent ( id_continent SERIAL PRIMARY KEY, name…
pinkiBet
  • 13
  • 3