473,544 Members | 1,959 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting n-th attribute

Hi!

I have a following problem: I need to select some attributes from
table, i.e.
first, third, fifth...

Can anyone give me the hint how to do it. Is there some method to say
somthing like this:

SELECT $1, $3, $5 which will refer to the 1st, 3rd and 5th attribute?

Thanks!

Mario.
Jul 20 '05 #1
5 1298
Columns are referred to by name not by position. Please explain why you want
to do this so that someone can suggest an alternative solution. Your
requirement suggests to me either that this table is not normalised or that
you are trying to implement something that might be better handled in your
client application.

--
David Portas
------------
Please reply only to the newsgroup
--
Jul 20 '05 #2
If you are doing C++, ADO and ODBC can do this. I agree that you are
probably doing something wrong if you are doing this. I've seen people use
this construct before and it usually places an unneeded restriction on you.

Michael

"Mario Pranjic" <ke****@fly.srk .fer.hr> wrote in message
news:6a******** *************** *********@4ax.c om...
Hi!

I have a following problem: I need to select some attributes from
table, i.e.
first, third, fifth...

Can anyone give me the hint how to do it. Is there some method to say
somthing like this:

SELECT $1, $3, $5 which will refer to the 1st, 3rd and 5th attribute?

Thanks!

Mario.

Jul 20 '05 #3
On Sat, 01 Nov 2003 22:41:00 GMT, "M Simpson" <no***@nowhere. com>
wrote:
If you are doing C++, ADO and ODBC can do this. I agree that you are
probably doing something wrong if you are doing this. I've seen people use
this construct before and it usually places an unneeded restriction on you.


I have to do it inside a stored procedure. Depending on user who
executes that procedure, it will return all just some of the
attributes.
The procedure also does some math on some restricted attributes
returning all or just a part of them. In case of lowest sec.level
user, it will return the tuple without those restricted attributes.
It also must work for all tables (it receives tablename as argument).

So, the client application will receive from database already filtered
data. That is why I must do this inside a SP.

Mario.
Jul 20 '05 #4
Create a view for each level of access. The view can be limited to just the
required base table columns and calculated values.

See "Using Views as Security Mechanisms" in Books Online.

--
David Portas
------------
Please reply only to the newsgroup
--
Jul 20 '05 #5
On Sun, 2 Nov 2003 09:17:51 -0000, "David Portas"
<RE************ *************** *@acm.org> wrote:
Create a view for each level of access. The view can be limited to just the
required base table columns and calculated values.

See "Using Views as Security Mechanisms" in Books Online.


I have a extra requirement that I create only one view or SP which
will handle all tables for all access levels.

I can dig my way out of that with some extra code, but, the less code
necessary, the better.

Mario.
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3107
by: Joe Six-Pack | last post by:
Hi, Im having problems in randomly selecting an element in an array that has not been selected before.. in other words, I have an array of answers to questions, then I want to select 5, with one of them being the correct answer to the question, and the others not.. Here is my code.. (I already have the correct answer at array position ) ...
3
2512
by: Simon G Best | last post by:
Hello! The C++ standard library provides facilities for finding out the sizes (and other such stuff) of numeric types (::std::numeric_limits<>, for example). What I would like to do is to select a type on the basis of its traits. More specifically, I would like to select an unsigned integer type on the basis of the number of bits I need...
2
3964
by: Paul Bradford | last post by:
I have a query that takes about two minutes and returns 97 rows. If I change the query only by adding ROWNUM to the outermost select clause, the query never returns (I let it run overnight). I'm not using ROWNUM in the where clause, I'm just selecting it. I can't think of any reason that just selecting ROWNUM would make any difference. This...
3
2447
by: Pawe³ | last post by:
I'm desinging a graphical interface and I frequently take advantage of the double click event. Unfortunately in most browsers double clicking also involves selecting and I would like to avoid that since whatever is selected has dark blue background and white letters what spoils the whole visual effect.... Any way I can block it por avoid it?
3
2399
by: james.dixon | last post by:
Hi I was wondering if anyone else had had this problem before (can't find anything on the web about it). I have three select elements (list boxes - from here on I'll refer to them as 'the list boxes'). Users can add and remove items from the list boxes. When the users are adding and removing items, the list boxes are single
2
1556
by: Dag | last post by:
Hi I am pretty much an xml beginner; hopefully someone can easily answer this one... I want to select a node representing a worksheet in an xml document for the Office Web Components spreadsheet. The file uses xml namespaces, of which I know very little. But it does seem clear that I can't select the <ss:Worksheet> element by name only; the...
0
1213
by: Kim | last post by:
Hello, I am selecting data from a text file in the following format: INSERT INTO SELECT * FROM " & sSource & " IN '' " & _ "'text;Database=" & sPath & ";FMT=Delimited;HDR=No' " & _ "WHERE = '01'" Variable names are used for the file name, etc. But the problem lies in the "SELECT *". We have strings that are larger than 254
1
2556
by: Ramesh | last post by:
hi, I am selecting fields from three table for manupulating data and i want to display total number of records selected. But i am always getting -1 value, eventhough 1000 of records are selected. Below is my code. here strSelectSQL value is strSelectSQL = "Select emp.Empno, emp.FirstName, emp.LastName, emp.DB,...
1
2228
by: Jay | last post by:
Hi All, My users are complaining about the page refreshing when they are selecting multiple rows in a datagrid. Has anyone tried to manage this using javascript? I tried smartnavigation but that caused me other problems. Any ideas? Thanks, Jay
3
15706
by: larry mckay | last post by:
anyone have the code to select and listview item or row (subitems) after a doubleclick event from a listview. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
0
7365
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7772
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5909
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5297
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4918
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1841
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
988
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
661
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.