Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Having to query several steps to get a "totals" result, I used a cte and I have also used a subquery with OVER (PARTITION BY) command. Which query, the cte or the subquery with OVER (...
Bernard Di Gregorio's user avatar
0 votes
1 answer
63 views

I need to create a view but an error occurs since statement after create view is IF statement. Create View Test_Data AS Checking if the Table exists to be dropped first IF OBJECT_ID('Test_T', 'U') IS ...
SQLNewby's user avatar
0 votes
1 answer
60 views

I’m working on an ASP.NET Core project with Entity Framework Core, and I'm facing issues with creating and editing records in the LoanTransaction model. Here's what I've done so far and the issues I’m ...
Victor Donado's user avatar
0 votes
2 answers
203 views

I am trying to create a view in snowflake stored procedure. I need one of the column from the variable. I tried following but getting following error, Error SQL compilation error: syntax error line 4 ...
Yasin's user avatar
  • 1
0 votes
1 answer
50 views

Issue: Cannot Assign "38" to "Pusinex2.seccion" - Must Be a "Seccion" Instance Models: The models Seccion and Pusinex2 are related in a ForeignKey manner. Seccion holds ...
toledano's user avatar
  • 291
-2 votes
1 answer
37 views

I have 2 tables like in the picture. In the first table I have column ID, in the second table I also have ID column and email column. In the end, I want a table 1 with specific email from table 2 ...
Darren's user avatar
  • 7
2 votes
0 answers
51 views

I try to use formset and CBV CreateView for a treatment model but validation failed. I am quite lost with validation logic in my view. I have added a try/catch in form_valid method to manage unicity ...
SLATER's user avatar
  • 683
0 votes
1 answer
188 views

I'm struggling with a problem in SQL - I keep getting this error: Incorrect syntax: CREATE VIEW must be the only statement in the batch I'm using newest Microsoft SQL Server Management Studio. ...
lordlaurent's user avatar
0 votes
2 answers
80 views

How implement that the user in the Model Entities add automatically the user that is authenticated in django? now, returning the following error: error I have tried differents methods that i have ...
AlbertoOG's user avatar
0 votes
1 answer
57 views

I have a CreateView to create artists but when submitting the form, nothing happens. models.py class Artist(models.Model): name = models.CharField(max_length=222, unique=True) slug = models....
prsnr's user avatar
  • 83
-1 votes
1 answer
320 views

I need help with that error this is my code CREATE OR REPLACE VIEW emplpersuc AS SELECT SUCURSAL.NOMBRE, COUNT(SUCURSAL.NOMBRE) FROM VENTA JOIN SUCURSAL ON SUCURSAL_CODIGO_SUCURSAL=CODIGO_SUCURSAL ...
RicardoRuizQ's user avatar
0 votes
1 answer
35 views

I've got problem with saving data to non-default database. In models.py I've got: grid_fs_storage = GridFSStorage(collection='tab_userinquiries', base_url='mydomain.com/userinquiries/',database='...
data_b77's user avatar
  • 433
-1 votes
1 answer
284 views

The problem is I am trying to use Create View for a query but I keep getting an error which means That I have a duplicate row My two table structure and relation My query SELECT * FROM user_profile ...
abed dak's user avatar
2 votes
1 answer
3k views

I'm working with Microsoft SQL Server 2019 (RTM-GDR) - 15.0.2095.3 (X64) Apr 29 2022 18:00:13 Copyright (C) 2019 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2016 Datacenter ...
AlexisPa's user avatar
0 votes
1 answer
53 views

I am still a beginner and i searched in google ,read w3schools and couldn't get how to do it the following thing. i want to create view from the info in cases field AS you saw these are the info ...
kimo_liz's user avatar
2 votes
1 answer
226 views

models.py is : class Todo(models.Model): user = models.ForeignKey(User,on_delete=models.CASCADE,null=True,blank=True) title = models.CharField(max_length=200) desc = models.TextField(null=...
santosh acharya's user avatar
1 vote
0 answers
172 views

This is my sql query for create view in Postgresql. But I need to query it from SqlAlchemy CREATE OR REPLACE VIEW public.my_view AS SELECT m.id AS mt_dump_model_csv_id, m.geom, ...
harini ravi's user avatar
1 vote
1 answer
835 views

I have a problem that I just can't figure out. After creating a work order I want to redirect to the detail page of that work order. Here is my models.py class Radni_nalozi(models.Model): Klijent =...
Damian Keretić's user avatar
1 vote
0 answers
992 views

I need to create a view from another database (linked as connectionserver) but here I need a different collation. Example: CREATE VIEW vw_table1 AS SELECT * FROM server2.table1; How can I specify the ...
Benni's user avatar
  • 11
0 votes
1 answer
71 views

I'm trying to write a test for my CreateView view in django. As part fo the test, I want to create a new object through a CreateView class, though I'm unsure how to save the object through tests.py. ...
Lian Miller's user avatar
1 vote
3 answers
1k views

--Creating View to store data for later visualizations CREATE VIEW PeopleVaccinatedpercent AS SELECT dea.continent, dea.location, dea.date, dea.population, vac.new_vaccinations ,SUM(cast(...
Amariei Ioan's user avatar
1 vote
1 answer
164 views

I created a class base create view.When i try to submite the post model create view. it will return NOT NULL constraint failed: spring_post.publisher_id how can i set the publisher the get the current ...
Prince Godswill's user avatar
0 votes
1 answer
1k views

I'm working on a new project and I'm having difficulties adding new objects from the users page. It can be added from admin dashboard. This is the model: class Product(models.Model): title = ...
youHaveAlsoBeenABeginner's user avatar
0 votes
1 answer
785 views

Here is my scenario. I want one of my model fields to be auto-fill based on whether the user is authenticated or not. Like when the user submits the form, I need to check if the user is authenticated ...
Sadra's user avatar
  • 394
1 vote
1 answer
3k views

I have 5 forms: MyForm, EducationForm, ExperienceForm, RecommendationForm, OtherDocumentsForm I want to disply them in one form template. I can not do it with CreateView because it only accepts one ...
Mukhammad Ermatov's user avatar
1 vote
3 answers
911 views

I need to create a view with the record count from 3 different tables but with the same columns. That is, these queries SELECT COUNT (*) AS count_a from table1 ta SELECT COUNT (*) AS count_b from ...
Cristian's user avatar
0 votes
1 answer
353 views

My views: class AddSuiteView(CreateView): model = TestSuite form_class = TestSuiteForm def get_context_data(self, **kwargs): context = super().get_context_data(**...
Wason's user avatar
  • 1,553
1 vote
1 answer
377 views

I have this CreateView that creates an object for me and after creating it I would like it to render me inside that object through its 'nome_scheda' which is a text field. views.py class ...
user avatar
1 vote
1 answer
739 views

This is my first post to SO, so please let me know if I've missed any important details. I am working on updates to a home-grown dJango based ticketing system. I have two "parent" models (...
Bill Newhouse's user avatar
0 votes
2 answers
376 views

I'm moving a bunch of SQL Server databases into SSDT projects so I can have source control. There is a view with a very large number of columns that prevent me from building one of the projects. ...
SZILÁRD ÁDÁM's user avatar
-1 votes
1 answer
320 views

I am trying to create a view with multiple tables with multiple select statements. The error message I receive is "Incorrect syntax: 'CREATE VIEW' must be only statement in batch." ...
Pete's user avatar
  • 1
1 vote
1 answer
1k views

I want to create a new view_type in Odoo 14. I followed these instructions: https://www.odoo.com/documentation/14.0/fr/developer/reference/javascript/javascript_cheatsheet.html#creating-a-new-view-...
l_grueni's user avatar
0 votes
1 answer
42 views

i have a problem with my CreateView. I wish I could have two different models that change based on the url it finds. I also have problems with success_url, I don't know how to pass it a parameter. url....
ian design's user avatar
3 votes
1 answer
158 views

The table was created as a NODE, therefore SQL Server adds a graph_id_xxxxxx column between others. I create a view with the following sentence: CREATE VIEW FILE_VIEW1 AS SELECT [NAME] FROM [dbo]...
Daniel Lederman's user avatar
-1 votes
1 answer
3k views

How to change column name in SQL? I have tried the following but giving a syntax error. create view cView as select * from College; alter table cView rename cName to collegeName, rename enrollment to ...
amitabha's user avatar
0 votes
2 answers
279 views

I'm a newbie in here. I had a problem that need your help. Here is my context: I have 1 table that contains 100 mil data rows. I need to build reports from this table. I use Power BI, using direct ...
DoanhDoanh's user avatar
2 votes
1 answer
5k views

I would like to create hierarchical query using with and removing 4 join, someone can help please i am beginner in SQL views. CREATE VIEW CAR( ID, CARLEVEL) AS select t.C_ID, coalesce(d.C_ID, ...
satcha's user avatar
  • 129
0 votes
0 answers
55 views

I am trying to create view table using UNION ALL. But I got one error. Below is my SQL code: CREATE VIEW dbo.v_DemographicInfo AS ( SELECT 'HSA' AS HospitalName, HSA.*,P.*,S.*,E.*, CASE WHEN DATEDIFF(...
merry's user avatar
  • 17
-1 votes
1 answer
89 views

[![I am getting error code: 1050 (as you can see at from the output in the image) Table already exists, when it doesnt. Can anyone help me with this? The question reads: Create a view called ‘...
Steve Wong's user avatar
1 vote
1 answer
1k views

When trying to create a create class-based view I get the IntegrityError listed above the full error is IntegrityError at /create_post/ null value in column "author_id" of relation "...
Kevin H's user avatar
  • 137
-2 votes
1 answer
59 views

This is very similar but NOT exactly the same error in an answer I saw for subject "MySQL inner join". The problem is an error at the WHERE statement, as follows: "ERROR 2.5could not ...
David Hernandez's user avatar
1 vote
1 answer
27 views

i want that a form is prepoluate with data my model: TYPE = (("S",'Swing'), ("R","Rapide")) class valuation(models.Model): stock = models.ForeignKey("...
tophil's user avatar
  • 15
0 votes
2 answers
27 views

Inside my generic CreateView class based view, I want to compare the request.user to a certain modelinstance.user, and if the users dont match, I want to raise a 404 error, how can I achieve this? ...
Ruben Adriaanse's user avatar
1 vote
1 answer
38 views

I've been through in similar topics for days for a possible solution, however none of them solved my issue which seems pretty simple to me but I stucked on this error right after I created a user: ...
user avatar
0 votes
3 answers
882 views

I have to create a view in SQL that has a set of default values without creating any tables, and I don't know if it is possible or not? Maybe something like this: CREATE VIEW PersonalView AS ...
Sara Moradi's user avatar
0 votes
2 answers
140 views

I'm trying to customize the form field errors for a changepasswordview in Django, however, to do that I believe I need to know the attribute names of the field errors so that I can do something like ...
orcaen7's user avatar
  • 51
1 vote
1 answer
2k views

I have a use case in which I need to create views in multiple databases using dynamic SQL. I realized that I can't give database name in front of the view in dynamic SQL, so used the use database ...
aseem puri's user avatar
0 votes
2 answers
490 views

I have two models Exercise and Area, Area has a manytomanyfield back to Exercise: class Exercise(models.Model): user = models.ForeignKey(Profile, on_delete=models.CASCADE) name = models....
sgt_pepper85's user avatar
0 votes
1 answer
3k views

My Area model has an exercise attribute with a ManyToManyField to my Exercise model: class Area(models.Model): name = models.CharField(max_length=100) exercise = models.ManyToManyField(...
sgt_pepper85's user avatar
0 votes
1 answer
100 views

I have a total of 10 forms I need to display. I am using a DetailView to display them and a CreateView to handle their logic. So far my views.py looks like this: from .forms import ( ...
sgt_pepper85's user avatar