Questions tagged [create-view]

The statement that creates a table in SQL (`CREATE VIEW ...`).

The statement that creates a table in SQL (CREATE VIEW ...). Use this tag if your question refers to a problem that might have a relation with an SQL statement that involves a CREATE VIEW statement. Do not use this tag if you have no indication that the CREATE VIEW statement has no relation to the error you are asking about.

184 questions
58
votes
4 answers

Drop view if exists

I have script where I want to first drop view and then create it. I know how to drop table: IF EXISTS (SELECT * FROM sys.tables WHERE name = 'table1' AND type = 'U') DROP TABLE table1; so I did the same for views: IF EXISTS (SELECT * FROM sys.views…
4est
  • 3,010
  • 6
  • 41
  • 63
48
votes
2 answers

django createview how to get the object that is created

i've two concatenated form. Basically user fills in the first form and then is redirected to the second one which adds value to the data of the first form. E.G. I've a form Movie (first form) and then i'm redirected to the form (actor) which add the…
EsseTi
  • 4,079
  • 5
  • 36
  • 63
25
votes
6 answers

CREATE VIEW must be the only statement in the batch

I'm trying to make a view. So far, I have written this: with ExpAndCheapMedicine(MostMoney, MinMoney) as ( select max(unitprice), min(unitprice) from Medicine ) , findmostexpensive(nameOfExpensive) as ( select tradename from…
Kadaj13
  • 1,423
  • 3
  • 17
  • 41
8
votes
1 answer

Create View reverse to DetailView

I am trying to reverse from CreateView to DetailView after I have uploaded my Image. I get the same message NoReverseMatch at /photo/image/add Reverse for 'image-view' with arguments '()' and keyword arguments '{'pk': 50}' not found. 0 pattern(s)…
7
votes
1 answer

Android : Activity onviewcreated

My activity have some fragments in a linearLayout (R.id.liste, inside a scrollView) and it takes some time to show. I reduced the size of the array to 50 but it was first 350. Each fragment is independent since I need them to respond to click and to…
Dan Chaltiel
  • 7,811
  • 5
  • 47
  • 92
5
votes
4 answers

grant create view on Oracle 11g

I use SQL*Plus for school and I use the username Scott. I cannot create views because it says: ORA-01031: insufficient privileges; I've searched and searched, but nothing seems to get it right. Any help?
David Lacombe
  • 61
  • 1
  • 1
  • 6
4
votes
1 answer

Django Help: Resolving NOT NULL constraint failed error with CreateView

I am new to stackoverflow, python and Django, have a question on the '(NOT NULL constraint failed: sixerrapp_gig.user_id)' error I am getting when i click submit on the form. Pretty sure it is because I have not assigned a user_id value from what I…
Jim Tay
  • 127
  • 1
  • 1
  • 7
4
votes
1 answer

Django CreateView customise form default field based on url parameter

file: Capacity/models.py class Env(models.Model): name = models.CharField(max_length=50) def get_absolute_url(self): return reverse('index') class Envhosts(models.Model): env = models.ForeignKey(Env) hostname =…
Ashwin Sethi
  • 185
  • 2
  • 9
3
votes
1 answer

Need to create a view from a SQL Server Graph Table that does not include the hidden graph_id column

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].[FILE_NAME] But when I see the columns in the…
3
votes
3 answers

How to create multiple images upload in Django CreateView?

I have a Django project and I created a post operation in this project, so the user will be able to share multiple picture posts. But I have a problem. I can't write multiple image upload function. I looked at a lot of content, but it doesn't work.…
3
votes
1 answer

Redirect to previous page after registration in Django

For login and logout, I use Django's built-in view in django.contrib.auth.views. It is very easy to redirect user to previous page because you can pass a 'next' parameter to the login/logout view. They work quit fine. When I want to fulfill the…
Xiao Liang
  • 763
  • 2
  • 7
  • 12
3
votes
0 answers

Table view OR temporary table in Doctrine + symfony 2.3

I was trying to implement bayesian average logic in doctrine and symfony. I have basic native Mysql query like this: Create View `ratings` AS SELECT restaurant_id, (SELECT count(restaurant_id) FROM ratings) / (SELECT count(DISTINCT…
stefun
  • 1,261
  • 3
  • 24
  • 54
3
votes
1 answer

Django ManyToMany from String in CreateView

What i want to do, is give the people to tag a post by writing in a charfield, separating the tags with ','. now this is my model (just the part we care) class Tag(models.Model): name = models.CharField(max_length=100, default='') def…
EsseTi
  • 4,079
  • 5
  • 36
  • 63
3
votes
3 answers

Django CreateView : Append ForeignKey to CustomForm Data

I have a CreateView as follows: class ResumeCreateView(CreateView): model = Resume def form_valid(self, request, form): candidate = Candidate.objects.get(user=self.request.user) self.object = form.save(commit=False) …
Amyth
  • 32,527
  • 26
  • 93
  • 135
2
votes
0 answers

Django formset: unicity constraint pass form_valid()

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 constraint but this might not be the right way to…
SLATER
  • 613
  • 9
  • 31
1
2 3
12 13