LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2004, 10:55 AM   #1
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Rep: Reputation: 30
[SQL] Generic Field Specifier?


Is there a way to access fields of a SQL table in a generic manner?

Lets say you have a table with this description:

Code:
+-----------+-------------+------+-----+---------+-------+
| Field     | Type        | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| invoice   | varchar(10) |      | PRI |         |       |
| cardno    | varchar(25) | YES  |     | NULL    |       |
| name      | varchar(25) | YES  |     | NULL    |       |
| expdate   | varchar(5)  | YES  |     | NULL    |       |
| city      | varchar(25) | YES  |     | NULL    |       |
| radio     | varchar(25) | YES  |     | NULL    |       |
| email     | text        | YES  |     | NULL    |       |
| address   | varchar(25) | YES  |     | NULL    |       |
| ipaddress | varchar(15) | YES  |     | NULL    |       |
| status    | char(1)     |      |     |         |       |
| time      | varchar(10) | YES  |     | NULL    |       |
+-----------+-------------+------+-----+---------+-------+
How would I query this table using generic specifiers in place of the field names?

Something like:

select * from TABLE where TABLE.f1='1234' and where TABLE.f2='5678';

Is there some sort of dot-notation that I can use to generically access the table's fields?

Thanks...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to do recursive file delete using specifier (*.tmp) from nested directories? Arodef Linux - General 3 11-11-2009 08:49 AM
Postfix From Field Cottsay Linux - Software 0 09-14-2005 11:36 AM
Migrating from MS-SQL server to My-SQL emailssent Linux - Networking 2 02-07-2005 03:20 PM
Which SQL is suitable for EMbedded SQL on C? hk_michael Programming 4 01-10-2005 06:07 PM
What conversion specifier do I use for .... purpleburple Programming 12 09-03-2002 02:34 PM


All times are GMT -5. The time now is 04:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration