Direct Select Vs select from host variables

Hi all

Question regarding what is bad regarding a select statement. I am using
a stored procedure for this:

Table contains 15 columns
1. select all 15 columns in a select statement
    select column1, column2 ..... from tablename
2. declare @column1 , @column 2 ....
    select @column1 = column1, @column2 = column2 ... from table
    select @column1, @column2 ....

The reason is because, i need to pass one or more column values to
another stored procedure for some access control validations. If I have
access, then proceed with select.

 Which is not good and why?


Thanx in advance
Anil


0
Anil
3/11/1999 12:18:02 PM
sybase.powerbuilder.database 9855 articles. 0 followers. Follow

0 Replies
136 Views

Similar Articles

[PageSpeed] 22

Reply:

Similar Artilces:

Direct 'Select' vs 'Select' from host variables
Hi all Question regarding what is bad regarding a select statement. I have a table contains 15 columns and I need to select all the 15 columns. My question is: what is the performance hit, if I take the column values into host variables and then select from them. The usual way is: 1. select all 15 columns in a select statement select column1, column2 ..... from tablename What I would like to do is: declare @column1 , @column 2 .... select @column1 = column1, @column2 = column2 ... from table select @column1, @column2 .... I need to pass the values of column...

SELECT from SELECT
Hi! I remember seeing an example where you can do a select from a nested select, but I cannot seem to make it work. So it would be something like this: select max( name ) from ( select name from customer union select name from vendor ) Was I dreaming I saw that? Thanks! D In article <4500243f@forums-2-dub>, daniel_AT_infrontsoftware_DOT_com@N0SPAM.com says... > Hi! > > I remember seeing an example where you can do a select from a nested > select, but I cannot seem to make it work. No, you weren't. Try (UNTESTED!) adding a...

Select into vs. insert ... select ...
Hello, I am using temp tables to generate a report. I created most of the temp tables and then use insert select. I found for one that when I use insert select I get a different query plan that if I use select into. The select into get a much better performance. The problem is I get dead lock on the statement. Is there anything I can do to change this behavior? Thanks, Josh Manfred SELECT INTO #temp is a non-logged operation. This can provide a performance increase. However, one downside is that you may end up with a lot of contention on system tables. (I didn...

select into vs insert/select
I am looking for ways to speed up a procedure, which as a part of an overnight processing is called about 3000 times. The procedure begins by inserting about 20 rows into a temp table created outside of the proc. I thought that this may be better done by a select into statement because it is minimally logged etc. I am running the two versions of the statement (insert/select and select into) 2700 times on a quiet server and it seems that the insert/select is a bit faster, a second or two. Any ideas what I'm doing wrong? Is it my assumption about select into being fas...

SELECT * vs. SELECT 1
I have always understood that when using the WHERE EXISTS clause, one codes it as WHERE EXISTS (SELECT * FROM .....). Lately, I've been told that performance is better if the it's coded as ...(SELECT 1 FROM ...) (or SELECT '' .. - that is, to select some literal). Everything I've read says that SELECT * is used with EXISTS because there's no result set returned - it only evaluates into true or false. I'm now curious - is there an advantage to writing SELECT 1 instead of SELECT * with EXISTS? If so, how much of an advantage, & why do all of the SQL b...

Why is the select saying selected after an item is selected?
This was a whitelisting issue due to a software upgrade at hostgator..  Nothing wrong with my code..Scot King SEO Software Tool | Search Engine Optimization"Get your page rank high"  huh? It is smart to put your question in the body and not just in the title. Have no idea what your question is or if it even a question.Eric Pascarello.com | Twitter epascarello | LinkedIn use thisddl.options[ddl.selectedIndex].selected = false; //Clear the selection ddl.options[1].selected = trueMAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP.Net Hosting : Host DepotMy Sit...

country selected vs language selected
Hi, looking for suggestions on how to handle the following with 2.0. in some cases, sites would be required to switch between countries and independantly, switch the language. For instance; a US english site would be presenting items available only in the US, but a user might wish to have a separate control to switch the language to spanish or whatever. Therefore, users may change countries to see what products are available in that country, but may wish to change the language while in the country specific site. Hope that makes sense. any feedback is appreciated. See if the following ar...

Select in Powerbuilder Database painter WORKS but does NOT in Powerbuilder run mode.
I have enclosed the actual information from a debug run. Will apprecaite any hints. Thanks Jim jimo@jdssc.com in ls_mod_string DataWindow.Table.Select="SELECT DISTINCT ~"inv_dtl~".~"inv_id~", ~"inv_dtl~".~"orig_cost~", ~"inv_dtl~".~"last_cost~", ~"inv_dtl~".~"regular_cost~", ~"inv_dtl~".~"orig_price~", ~"inv_dtl~".~"current_price~", ~"inv_dtl~".~"sugg_price~", ~"inv~".~"vend_id~", ~"inv~".~"style~", ~...

Select in Powerbuilder Database painter WORKS but does NOT in Powerbuilder run mode.
I have enclosed the actual information for a debug run. Will apprecaite any hints. Thanks Jim jimo@jdssc.com in ls_mod_string DataWindow.Table.Select="SELECT DISTINCT ~"inv_dtl~".~"inv_id~", ~"inv_dtl~".~"orig_cost~", ~"inv_dtl~".~"last_cost~", ~"inv_dtl~".~"regular_cost~", ~"inv_dtl~".~"orig_price~", ~"inv_dtl~".~"current_price~", ~"inv_dtl~".~"sugg_price~", ~"inv~".~"vend_id~", ~"inv~".~"style~",...

select * vs select field, which one is faster ?
Suppose we have a table of 50 fields, which command should we use to take the result faster : SELECT * FROM Employee SELECT employee.id, employee.name FROM Employee Thanks for help. -- Best regards, Ridwan Goldbase Technology Visit our Homepage : http://www.geocities.com/Wallstreet/Floor/5251/index.html http://members.tripod.com/~goldbase http://members.xoom.com/goldbase * Check out the Y2K (Year 2000 Problems - Millenium Bugs) The second one. In that case, only data for two columns is retrieved. -- - Eric Aling [TeamPS], Cypres Informatisering bv, T...

ddl Selected Index vs Selected Value
Obviously I'm missing something...in all my debugging I find that when trying to set the selectedindex to my dropdownlist that all previous logic goes out the window! In standard VB, setting the selectedindex meant referring to it's option value. What I find now is there is a distinct index array collection not based on the listitem value. To summarize, I have a datagrid with template column that contains a read-only textbox for it's Item Template and a dynamic dropdownlist for it's Edit Item Template. When the edit hyperlink command is clicked, I grab the text value from the textbox a...

Selecting database dynamically (as a variable)
Hey all. I need to call another database in the same server dynamically; creating a varible off it or somehow. Example: -- In database DBaseA declare @dbname as varchar (30) set @dbname='[DBaseB].[dbo]' select * from @dbname.[table2] I know this block of code doesnt work. And i need a way of making the  database DBaseB dynamic. DBaseA and DBaseB are in the same server. I am using Sql Server 2000. How do i solve this? Solutions ? You can use EXEC to execute dynamic SQL statement: declare @dbname sysnameset @dbname='[DBaseB]'EXEC('select * from '+@dbname+'.[dbo].table...

insert select and select into
Hello, I am using temp tables to generate a report. I created most of the temp tables and then use insert select. I found for one, when I use insert select, I get a different query plan than if I use select into. The select into get a much better performance. The problem is I get dead locks on the statement. Is there anything I can do to change this behavior? Thanks, Josh Manfred ...

Bug in SELECT from SELECT ?
I have a table intwb_items CREATE TABLE intwb_items ( wb_id integer not null, prod_id integer not null, qty numeric(12,5) not null, primary key(wb_id, prod_id) ) How can I obtain sum of 10 greatest "qty"? I tried to execute query: SELECT sum(qty) FROM ( SELECT top 10 qty FROM intwb_items ORDER BY qty DESC )as tmp But it raise error: "Syntax error or access violation: near 'ORDER' in ... FROM intwb_items [ORDER]" The same query but without "ORDER BY" works perfectly, but "TOP N" without "ORDE...

Web resources about - Direct Select Vs select from host variables - sybase.powerbuilder.database

Variable - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Westpac interest rate rise is one of many variable loan rate rises
WESTPAC is not alone in hitting its owner-occupier customers with a surprise interest rate rise, as dozens of other variable rate home loans ...

Airbnb upgrades variable pricing tool for hosts
Online home rental group Airbnb is rolling out an upgraded variable pricing tool that automatically raises or cuts room rates based on supply ...

Commonwealth Bank raises variable home loan rates
Home owners' mortgage costs are set to rise by hundreds of dollars a year, after the Commonwealth Bank became the latest bank to hike interest ...

CBA lifts variable home loan rates to offset costs associated with stricter capital requirements
The Commonwealth Bank to lift its home loan interest rates independently of the Reserve Bank to partially offset costs associated with stricter ...

Washington Square Signs Spielbergs, Choi Joins Variable and More
... films and an episode of the HBO comedy series "Girls," on which he plays the role of Ray Ploshansky. New York-based creative collective Variable ...

YouTube v10.32 Tweaks Some Interface Elements And Includes Hints About Virtual Reality Content And Variable ...
Forget Update Wednesday! Monday is the new big day. Not only were we treated to the latest M preview release and the official Marshmallow name, ...

"You have to ignore many variables to think women are paid less than men. California is happy to try." ...
Writes Sarah Ketterer in The Wall Street Journal in "The ‘Wage Gap’ Myth That Won’t Die" (which you can get to without subscribing if you Google ...

Staley: 'A lot of different variables...been a hard year'
... 41° Navigation Home Giants A's Sharks Warriors Kings 49ers Raiders Quakes Insiders More Tickets Shop Watch Staley: 'A lot of different variables...been ...

Expert Reveals the Latest Variable Capacity Technology
Learn about gForce Ultra CRAC equipment, the latest variable capacity technology to lower energy usage and increase reliability.

Resources last updated: 1/3/2016 9:32:32 AM