Unable to retrieve data from tble

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

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.

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’;’)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs