views

mysql views

Hi, I am trying to create a view for a UNION of 2 select statements that I have created. The UNION is working fine when executed individually But the problem is only the 1st part of the UNION is getting executed when I am executing it as a view. The query I am using is as below SELECT DISTINCT products.pid AS id, produ...

Do database views affect query performance?

Are database views only a means to simplify the access of data or does it provide performance benefits when accessing the views as opposed to just running the query which the view is based on? I suspect views are functionally equivalent to just the adding the stored view query to each query on the view data, is this correct or are there ...

C# Problem with two sorted Views ( ListCollectionView ) on the same collection

Hi, I have two windows that have a listbox bound to a ListCollectionView, both are sorted with the same SortDescription, View1 and View2 When i add item through View2 its reflected in View1 and i can see the label after the focus change event, then View2 gets sorted. and View1 is now unsorted. How can i slove this issue? Thanks, Eric...

How to create a reliable and robust page view counter in a web application?

I want to count the visits on a web page, and this page represents an element of my model, just like the Stack Overflow question page views. How to do this in a reliable (one visit, one pageview, without repetitions) and robust (thinking on performance, not just a new table attribute 'visits_count') ...

Oracle Database 10g VIEW performance

Hello, I have a view in one of my Oracle Database that is taking too long to execute. When the statement runs, it does not seem to stop. Is there anyway that we can verify the performance of this view or how we can check to see if the statement session is 'hanging'? Thanks, N2EE UPDATE I realised that the issue is with the underlyin...

Drupal 5 views -- can I have a random block and a sorted page?

I keep running into the same problem, and I feel like I'm solving it the clunky way. Do you have a better solution? I have a site that with the content type "Staff Bios". I've created a view page that lists all the bios in alphabetical order. I want to have a block that shows just one bio (like a sidebar teaser), and I want the choic...

generate scaffolding as code in cakephp

I have a cakephp app with some controllers using scaffolding for the logic and views... How can I make cake actually generate those as files and functions in my project that I can then modify and take ownership of... It's nice to have this stuff as a starting point, but it can't be true that I need to start basically from scratch if I ...

ADO.net without writing SQL (esp. WHERE)

I have this idea that using SQL VIEWS to abstract simple database computations (such as a count on a relation) is sufficient, and you don't need procedures (== procedural code) A simple sql view + a where clause >> a stored procedure with parameters sometimes While making this point I imagined a way of retrieving table/view data withou...

When to use database views and when not?

This question is about database views, not materialized-views. Pros: Query simplification. Avoid repeat the same joins on multiples queries. Avoid magic numbers. Cons: Hiding real queries (may be you are repeating joins). What else? ...

Cannot create index on view with User Defined Function in SQL Server

In SQL Server 2005, I'm trying to use a User Defined Function in a indexed view that will be used in a full-text index. I have been able to get the UDF to work with a stored procedure and the view in question. But, when I try to create an index on the view I get the following error... Cannot create index on view "DevDatabase.dbo.View_Pe...

C# Reading SQL tables and views

Hi all, I'm currently reading in a list of tables in a SQL database and populating a comboBox with the table names. I want to include SQL Views in the same list. The sysobjects type for tables is 'U' and for views it's 'V'. How would I alter the OdbcCommand line to retrieve both U and V? Thanks. OdbcConnection cn=getConnection(); Odbc...

Can I specify a custom location to "search for views" in ASP.NET MVC?

I have the following layout for my mvc project: /Controllers /Demo /Demo/DemoArea1Controller /Demo/DemoArea2Controller etc... /Views /Demo /Demo/DemoArea1/Index.aspx /Demo/DemoArea2/Index.aspx However, when I have this for DemoArea1Controller: public class DemoArea1Controller : Controller { public ActionResult Index() { ...

Using default namespaces in .NET MVC for views without using import?

How do you configure the views to able to reference a namespace like System.Web.Mvc without having to do <%@ Import Namespace="System.Web.Mvc" %>? I remember seeing this somewhere but my google skills are failing me at the moment. ...

When I create views from Clearcase explorer, both development and the integration views get created as snapshot.

I do not get the option at all to choose for the views to be snapshot or dynamic. What I would want is the development view to be snapshot and the integration view to be dynamic. Why is it that I am not prompted to let me choose my views to be snapshot/dynamic? ...

Why would "Where 1 <> 1" in a query return all rows?

I've come across a query in an application that I've inherited that looks like this: Select * From foo where 1 <> 1 As I parse that, it should return nothing (1 <> 1 should evaluate to false, right). However (at least on my Oracle box) it comes back with a full listing of everything in foo. When I try the same thing in MSAccess/Je...

Rails editing the HTML in views

I'm doing a tutorial from Head-First Rails (via Safari Online) and cannot get edited HTML to show up in the browser (the changes, I mean). Specifically, I'm just changing the label for one of the columns from "Seat seq id" to "Seat #". I've opened the four view files, edit, index, new and show.html.erb. Everywhere there's an 'f.label :se...

how to add a code-behind page to a view or partial view

I notice with the latest version of ASP.NET MVC that a View no longer defaults to having code-behind classes. How do I go about adding a code-behind class now to a View or Partial View?? ...

MySQL: Views vs Stored Procedures

Since MySQL started supporting stored procedures, I've never really used them. Partly because I'm not a great query writer, partly because I often work with DBAs who make those choices for me, partly because I'm just comfy with What I Know. In terms of doing data selection, specifically when considering a select that is essentially a d...

Eclipse RCP application - multi-window design for multiple monitors

Question about Eclipse RCP and whole perspective/view/editor design - what is the best way to create application which will display multiple windows on multiple monitors? Tutorials and book I've seen always pack RCP/SWT design into views inside perspective within single application window. Should one window rule all others or they all s...

How do i add Javascript to an ASP.NET MVC View?

Hi folks, simple question i'm sure (blush). I have a simple View and I wish to add a JQuery DatePicker javascript to this view (and not every view, via a masterpage). I'm not sure what is the best way to do this. Second, I'm conscience of where/when my Javascript loads. I'm a fan of YSlow and it recommends that i add any scripts to th...