Questions tagged [view]

This tag is for questions about database view or UI / architectural view. See also the following tags: sql-view, android-view, uiview.

The purpose of almost any computer program is to process data in one form or another. When the program requires user interaction it is often necessary to provide the user with a view of that data to represent it in a useful and comprehensible manner.

View also refers to:

  • A stored query in a relational database that can be accessed as if it were a table.
  • The display or presentation layer of a MVC architecture.

Questions tagged should also be tagged with the relevant language.

25981 questions
67
votes
7 answers

Stored Procedures Vs. Views

I have used both but what I am not clear is when I should prefer one over the other. I mean I know stored procedure can take in parameters...but really we can still perform the same thing using Views too right ? So considering performance and other…
Vishal
  • 12,133
  • 17
  • 82
  • 128
66
votes
8 answers

Android: get height of a view before it´s drawn

For an animation I need to know the height from a View. The Problem is, that the getHeight() method allways return 0 unless the View is drawn. So is there any way to get height without drawing it? In this case the View is a LinearLayout. EDIT: I…
anonymous
  • 1,141
  • 3
  • 11
  • 20
66
votes
16 answers

how to add button click event in android studio

So I have done some research, and after defining you button as an object by the code private Button buttonname; buttonname = (Button) findViewById(R.id.buttonnameinandroid) ; here is my problem buttonname.setOnClickListener(this); //as I understand…
user2699451
64
votes
3 answers

MySQL truncates concatenated result of a GROUP_CONCAT function

I've created a view which uses GROUP_CONCAT to concatenate results from a query on products column with data type of 'varchar(7) utf8_general_ci' in a column named concat_products. The problem is that MySQL truncates value of "concat_products"…
pouya
  • 3,400
  • 6
  • 38
  • 53
63
votes
10 answers

Create a view with ORDER BY clause

I'm trying to create a view with an ORDER BY clause. I have create it successfully on SQL Server 2012 SP1, but when I try to re-create it on SQL Server 2008 R2, I get this error: Msg 102, Level 15, State 1, Procedure TopUsers, Line 11Incorrect …
El Sa7eR
  • 881
  • 3
  • 10
  • 17
62
votes
9 answers

Class views in Django

Django view points to a function, which can be a problem if you want to change only a bit of functionality. Yes, I could have million keyword arguments and even more if statements in the function, but I was thinking more of an object oriented…
Seb
  • 17,141
  • 7
  • 38
  • 27
62
votes
9 answers

Create Table from View

I have a view that I want to create a table from in SQL Enterprise Manager, but I always get an error when I run this query: CREATE TABLE A AS (SELECT top 10 FROM dbo.myView) So far the error is: "syntax error at 'as'" View is too large. Is it…
tdjfdjdj
  • 2,391
  • 13
  • 44
  • 71
62
votes
6 answers

In Rails when a resource create action fails and calls render :new, why must the URL change to the resource's index url?

I have a resource called Books. It's listed as a resource properly in my routes file. I have a new action, which gives the new view the standard: @book = Book.new On the model, there are some attributes which are validated by presence, so if a…
rcd
  • 1,348
  • 1
  • 14
  • 27
61
votes
2 answers

Cannot create index on view 'View_Table_Name' because the view is not schema bound

I am using Views in my stored Procedure(SQL-Server). For Improving Performance, I have tried to created INDEX of that View. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER VIEW VW_Table_Name AS SELECT Col1,Col2,Col3 FROM Table_Name GO CREATE…
Jagadeesh
  • 1,630
  • 8
  • 24
  • 35
61
votes
6 answers

Setting a maximum width on a ViewGroup

How do I set the maximum width of a ViewGroup? I am using a Theme.Dialog activity, however, this does not look so good when resized to bigger screens, it's also sort of lightweight and I don't want it taking up the whole screen. I tried this…
zsniperx
  • 2,732
  • 6
  • 25
  • 32
61
votes
6 answers

Error referencing an inner class View in layout/main.xml

Grrr... I create a subclass of view as an inner class in my Activity. Before I simply linked to this view from my activity with: setContentView(new CustomView(this)); without problems. Now, however, my view is getting more complex so I am making it…
IcedDante
  • 6,145
  • 12
  • 57
  • 100
60
votes
4 answers

Android DataBinding where to get context?

I have TextView for showing time. I want to use Android's DataBinding plugin. For formatting time I am using DateUtils.formatDateTime(context, int, int) method which takes Context instance. Is it possible to get context include element? Or do I…
bakua
  • 13,704
  • 7
  • 43
  • 62
60
votes
5 answers

What is a View in Oracle?

What is a view in Oracle?
laxmi narayana
60
votes
5 answers

MySQL: View with Subquery in the FROM Clause Limitation

In MySQL 5.0 why does the following error occur when trying to create a view with a subquery in the FROM clause? ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause If this is a limitation of the MySQL engine, then why haven't…
Daniel
  • 1,231
  • 3
  • 15
  • 20
60
votes
7 answers

Qt jpg image display

I want to display .jpg image in an Qt UI. I checked it online and found https://doc.qt.io/archives/qt-4.8/qt-widgets-imageviewer-example.html. I thought Graphics View will do the same, and also it has codec to display video. How to display images…
Lily
  • 5,872
  • 19
  • 56
  • 75