# Unable to retrieve data from tble

**URL:** <https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536>\
**Category:** Ruby\
**Created:** [September 24, 2010, 6:17pm UTC](https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536 "2010-09-24T18:17:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arihan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@arihan](https://www.ruby-forum.com/u/arihan)\
**Post date:** [September 24, 2010, 6:17pm UTC](https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536/1 "2010-09-24T18:17:32Z")

</div>

Hi All,

I am unable to retrieve data from table.The screenshot is also attached  
for determining the position of table in the database. Any thoughts how  
to sort it out? I am using Postgres

#The table name is MasterUser

require ‘postgres’

def update\_emailid()

```
conn = PGconn.connect("chi-test-dbs1", 5432, '', '', "UserMaster",

```

“postgres”, “postgres”)  
res = conn.exec(‘SELECT Email FROM  
UserMaster.Schemas.public.Tables.MasterUser WHERE  
UserName=‘arihan123’;’)  
puts res

end

update\_emailid()

The error comes as

Test-unit version : 2.0.1 loaded  
C:/Ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.6.3/lib/postgres-pr/connection.rb:142:in  
`query’: ERROR C42601 Mimproper qualified name (too many dotted names):  
usermaster.schemas.public.tables.masteruser P19 Fgram.y L9933  
Rbase\_yyparse (RuntimeError)

Cheers  
Arihan

---

<div class="post-metadata">

**Author:** ![arihan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@arihan](https://www.ruby-forum.com/u/arihan)\
**Post date:** [September 24, 2010, 7:11pm UTC](https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536/2 "2010-09-24T19:11:04Z")

</div>

Arihan S. wrote:

> ```
> res = conn.exec('SELECT Email FROM
> 
> ```
> 
> UserMaster.Schemas.public.Tables.MasterUser WHERE  
> UserName=‘arihan123’;’)  
> …  
> `query’: ERROR C42601 Mimproper qualified name (too many dotted names):  
> usermaster.schemas.public.tables.masteruser P19 Fgram.y L9933  
> Rbase\_yyparse (RuntimeError)

This isn’t a ruby question, it’s a postgres one.

Make a query which works using the pg command line tool, then use it in  
Ruby.

---

<div class="post-metadata">

**Author:** ![arihan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c0e974/32.png) [@arihan](https://www.ruby-forum.com/u/arihan)\
**Post date:** [September 27, 2010, 11:45am UTC](https://www.ruby-forum.com/t/unable-to-retrieve-data-from-tble/195536/3 "2010-09-27T11:45:09Z")

</div>

Brian C. wrote:

> Arihan S. wrote:
> 
> > ```
> > res = conn.exec('SELECT Email FROM
> > 
> > ```
> > 
> > UserMaster.Schemas.public.Tables.MasterUser WHERE  
> > UserName=‘arihan123’;’)  
> > …  
> > `query’: ERROR C42601 Mimproper qualified name (too many dotted names):  
> > usermaster.schemas.public.tables.masteruser P19 Fgram.y L9933  
> > Rbase\_yyparse (RuntimeError)
> 
> This isn’t a ruby question, it’s a postgres one.
> 
> Make a query which works using the pg command line tool, then use it in  
> Ruby.

Thanks . I’ve done that.

It would be

res = conn.exec(‘SELECT “Email” FROM “MasterUser” WHERE  
“UserName”=‘arihan123’;’)
