By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,983 Members | 2,082 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,983 IT Pros & Developers. It's quick & easy.

How to get column name

P: 1
I am using pgSQL as database with JSP.
I have given coomets to each column in table.
I have retieved the column comment using :

"select col_description('table_name'::regclass,column+inde x)"
Now i have stored these column comments in a combo box.
Now i want to retrieve the column name matching with the comments in combo.
When user selects the comment from combo then appropriate column name should be desplayed below.

columns: instcode,instname.
column comments: institute code,institute name // this will be in combo
When user selects "institute name" from combo then "instcode" then i should get "instname"

PLz help me
Jun 19 '07 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 534
Using comments in this manner is something I would refrain from, but if you really want to do it this way why not use the column names and comments together when coding your combo-box?
For each selection (OPTION in HTML) the comment would make a display string, while the column name will be used as actual value.
Jun 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.