Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 23rd, 2011, 05:43 PM
vikas.sh1 vikas.sh1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 10 vikas.sh1 Negative: is most likely a SPAMMER and a traitor to the cause. 
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

Reply With Quote
  #2  
Old October 28th, 2011, 11:16 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
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

Reply With Quote
  #3  
Old October 28th, 2011, 09:01 PM
vikas.sh1 vikas.sh1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 10 vikas.sh1 Negative: is most likely a SPAMMER and a traitor to the cause. 
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

Reply With Quote
  #4  
Old October 30th, 2011, 04:13 PM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
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';

Reply With Quote
  #5  
Old November 10th, 2011, 08:25 PM
vikas.sh1 vikas.sh1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 10 vikas.sh1 Negative: is most likely a SPAMMER and a traitor to the cause. 
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

Reply With Quote
  #6  
Old November 12th, 2011, 05:09 AM
rapgame rapgame is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 74 rapgame User rank is Private First Class (20 - 50 Reputation Level)rapgame User rank is Private First Class (20 - 50 Reputation Level) 
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

Reply With Quote
  #7  
Old November 13th, 2011, 11:53 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
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';

Reply With Quote
  #8  
Old November 13th, 2011, 11:54 AM
fikret fikret is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: Sarajevo, Bosnia
Posts: 120 fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level)fikret User rank is Corporal (100 - 500 Reputation Level) 
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 ;-)

Reply With Quote
  #9  
Old November 13th, 2011, 12:59 PM
rapgame rapgame is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2009
Posts: 74 rapgame User rank is Private First Class (20 - 50 Reputation Level)rapgame User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 14 h 12 m 41 sec
Reputation Power: 4
You right Fikret, "Show tables" is supported, "describe" not.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Query to get the column name from the database

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap