473,320 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1295
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.com...
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
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...
3
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...
2
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...
3
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...
3
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...
2
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....
0
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 =...
1
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....
1
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.