This is a discussion on searching for a column within the pgsql Databases forums, part of the PostgreSQL category; --> I have a (hopefully) very simple question:- How can I search through a database for a specific column name? ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a (hopefully) very simple question:- How can I search through a database for a specific column name? I'm trying to reverse-engineer some reports and this would make my life much easier. Thanks maxcoppin@humphreyfarms.com |
| |||
| This just gives me a syntax error. Any more ideas? "Peter de Vries" <peter@devnull.local> wrote in message news:slrnbgr11t.19c.P.de.Vries@tux.thuis.local... > Max Coppin wrote: > > I have a (hopefully) very simple question:- > > > How can I search through a database for a specific column name? I'm > > trying to reverse-engineer some reports and this would make my life > > much easier. > > FOR EACH _field NO-LOCK > WHERE _field-name = "field to find", > FIRST _file OF _field NO-LOCK: > > DISPLAY _file-name _field-name. > > END. > > Is that what you mean? > > -- > Peter de Vries, ICQ 7787398 |
| |||
| "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in news:bfj7h6$qp6$1 @hercules.btinternet.com: > This just gives me a syntax error. Any more ideas? > >> FOR EACH _field NO-LOCK >> WHERE _field-name = "field to find", >> FIRST _file OF _field NO-LOCK: >> >> DISPLAY _file-name _field-name. >> >> END. >> The code works for me.. Did you change "Field to find" to the name of the field you are looking for?? What kind of error are you receiving?? Kevin |
| |||
| I get a syntax error:- === SQL Exception 1 === SQLState=42000 ErrorCode=-20003 [JDBC Progress Driver]:Syntax error (7587) i typed in this:- FOR EACH _field NO-LOCK WHERE _field-name = "ORDER_NUMBER", FIRST _file OF _field NO-LOCK: DISPLAY _file-name _field-name. END. "Kevin" <Joe@Joe.com> wrote in message news:Xns93C0C327B81F0JoeJoecom@195.8.68.206... > "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in news:bfj7h6$qp6$1 > @hercules.btinternet.com: > > > This just gives me a syntax error. Any more ideas? > > > >> FOR EACH _field NO-LOCK > >> WHERE _field-name = "field to find", > >> FIRST _file OF _field NO-LOCK: > >> > >> DISPLAY _file-name _field-name. > >> > >> END. > >> > > The code works for me.. Did you change "Field to find" to the name of the > field you are looking for?? What kind of error are you receiving?? > > Kevin |
| |||
| I've tried the pub. suffix but get the same error. Only _field should have the suffix i presume? "Kevin" <Joe@Joe.com> wrote in message news:Xns93C1D9381C48DJoeJoecom@195.8.68.206... > "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in > news:bflj2l$rcn$1@sparta.btinternet.com: > > > I get a syntax error:- > > > > === SQL Exception 1 === > > SQLState=42000 > > ErrorCode=-20003 > > [JDBC Progress Driver]:Syntax error (7587) > > > > i typed in this:- > > > > FOR EACH _field NO-LOCK > > WHERE _field-name = "ORDER_NUMBER", > > FIRST _file OF _field NO-LOCK: > > > > DISPLAY _file-name _field-name. > > > > END. > > > > > Ahh.. This is 4GL, code not SQL.. The same table names should work just > fine, but be sure to use the pub suffix.. > |
| |||
| _file should have the suffix as well "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in message news:bfon07$jh4$1@sparta.btinternet.com... > I've tried the pub. suffix but get the same error. Only _field should have > the suffix i presume? > > > "Kevin" <Joe@Joe.com> wrote in message > news:Xns93C1D9381C48DJoeJoecom@195.8.68.206... > > "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in > > news:bflj2l$rcn$1@sparta.btinternet.com: > > > > > I get a syntax error:- > > > > > > === SQL Exception 1 === > > > SQLState=42000 > > > ErrorCode=-20003 > > > [JDBC Progress Driver]:Syntax error (7587) > > > > > > i typed in this:- > > > > > > FOR EACH _field NO-LOCK > > > WHERE _field-name = "ORDER_NUMBER", > > > FIRST _file OF _field NO-LOCK: > > > > > > DISPLAY _file-name _field-name. > > > > > > END. > > > > > > > > > Ahh.. This is 4GL, code not SQL.. The same table names should work just > > fine, but be sure to use the pub suffix.. > > > > |
| ||||
| Correction: This thread has talked about a suffix. It is really a prefix as in PUB._file and PUB._field "Grant Dyer" <grant.dyer@bigpond.com> wrote in message news:51z_a.32872$bo1.30426@news-server.bigpond.net.au... > _file should have the suffix as well > > "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in message > news:bfon07$jh4$1@sparta.btinternet.com... > > I've tried the pub. suffix but get the same error. Only _field should > have > > the suffix i presume? > > > > > > "Kevin" <Joe@Joe.com> wrote in message > > news:Xns93C1D9381C48DJoeJoecom@195.8.68.206... > > > "Max Coppin" <maxcoppin@humphreyfarms.com> wrote in > > > news:bflj2l$rcn$1@sparta.btinternet.com: > > > > > > > I get a syntax error:- > > > > > > > > === SQL Exception 1 === > > > > SQLState=42000 > > > > ErrorCode=-20003 > > > > [JDBC Progress Driver]:Syntax error (7587) > > > > > > > > i typed in this:- > > > > > > > > FOR EACH _field NO-LOCK > > > > WHERE _field-name = "ORDER_NUMBER", > > > > FIRST _file OF _field NO-LOCK: > > > > > > > > DISPLAY _file-name _field-name. > > > > > > > > END. > > > > > > > > > > > > > Ahh.. This is 4GL, code not SQL.. The same table names should work just > > > fine, but be sure to use the pub suffix.. > > > > > > > > > |