The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> Firebird SQL Development
|
Query to get the column name from the database
Discuss Query to get the column name from the database in the Firebird SQL Development forum on Dev Shed. Query to get the column name from the database Firebird SQL Development forum discussing administration, Firebird SQL syntax, or other Firebird SQL-related topics. Firebird is the evolution of Borland's Interbase product.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 23rd, 2011, 05:43 PM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 10
Time spent in forums: 1 h 29 m 13 sec
Reputation Power: 0
|
|
|
Query to get the column name from the database
Hi,
Can any one let me know how we can get the column name of particular table?
Its urgent!!!!
BR
vikas
|

October 28th, 2011, 11:16 AM
|
|
Contributing User
|
|
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120
  
Time spent in forums: 1 Day 6 h 52 m 25 sec
Reputation Power: 12
|
|
Quote: | Originally Posted by vikas.sh1 Hi,
Can any one let me know how we can get the column name of particular table?
Its urgent!!!!
BR
vikas |
select RDB$RELATION_FIELDS.rdb$field_name from RDB$RELATION_FIELDS where RDB$RELATION_FIELDS.rdb$relation_name = :TABLE_NAME
|

October 28th, 2011, 09:01 PM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 10
Time spent in forums: 1 h 29 m 13 sec
Reputation Power: 0
|
|
Thanks for the reply.
I tried running the same query in firebird SQL manager.
it prompt me to enter table name.
when i enter the table name it shows column name.
I have to do it in c++. can you just clear the prompt section.
i tried the below query but giving an error
select RDB$RELATION_FIELDS.rdb$field_name from RDB$RELATION_FIELDS
where RDB$RELATION_FIELDS.rdb$relation_name = alarmjournal;
Quote: | Originally Posted by fikret select RDB$RELATION_FIELDS.rdb$field_name from RDB$RELATION_FIELDS where RDB$RELATION_FIELDS.rdb$relation_name = :TABLE_NAME |
|

October 30th, 2011, 04:13 PM
|
|
Contributing User
|
|
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120
  
Time spent in forums: 1 Day 6 h 52 m 25 sec
Reputation Power: 12
|
|
Quote: | Originally Posted by vikas.sh1 select RDB$RELATION_FIELDS.rdb$field_name from RDB$RELATION_FIELDS
where RDB$RELATION_FIELDS.rdb$relation_name = alarmjournal; |
Try
select RDB$RELATION_FIELDS.rdb$field_name from RDB$RELATION_FIELDS
where RDB$RELATION_FIELDS.rdb$relation_name = 'alarmjournal';
|

November 10th, 2011, 08:25 PM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 10
Time spent in forums: 1 h 29 m 13 sec
Reputation Power: 0
|
|
|
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
ALARMJOURNAL.
At line 2, column 47.
From the second one i am getting
Emptyset
|

November 12th, 2011, 05:09 AM
|
|
Contributing User
|
|
Join Date: Nov 2009
Posts: 74

Time spent in forums: 14 h 12 m 41 sec
Reputation Power: 4
|
|
|
Consider installing the free Firebird database administration tool:
Flamerobin
Connect, browse to tables --> your answer without technical bla bla and difficult queries.
Its a pitty that Firebird does not support MySQL commands like
"SHOW TABLES" (--edit--: sorry it does but not: ) "DESCRIBE [tablename]"
So much easier, right?
So Flamerobin, looks a bit like pgAdmin.
Good luck!
Last edited by rapgame : November 13th, 2011 at 12:58 PM.
Reason: statement was not true
|

November 13th, 2011, 11:53 AM
|
|
Contributing User
|
|
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120
  
Time spent in forums: 1 Day 6 h 52 m 25 sec
Reputation Power: 12
|
|
Quote: | Originally Posted by vikas.sh1 Dynamic SQL Error.
SQL error code = -206.
Column unknown.
ALARMJOURNAL.
At line 2, column 47.
From the second one i am getting
Emptyset |
Try
select RDB$RELATION_FIELDS.rdb$field_name from RDB$RELATION_FIELDS
where RDB$RELATION_FIELDS.rdb$relation_name = 'ALARMJOURNAL';
|

November 13th, 2011, 11:54 AM
|
|
Contributing User
|
|
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120
  
Time spent in forums: 1 Day 6 h 52 m 25 sec
Reputation Power: 12
|
|
Quote: | Originally Posted by rapgame
Its a pitty that Firebird does not support MySQL commands like "SHOW TABLES" |
It does support SHOW TABLES; command, using ISQL tool.
Be carefull with your words ;-)
|

November 13th, 2011, 12:59 PM
|
|
Contributing User
|
|
Join Date: Nov 2009
Posts: 74

Time spent in forums: 14 h 12 m 41 sec
Reputation Power: 4
|
|
|
You right Fikret, "Show tables" is supported, "describe" not.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|