Unable to retrieve data from tble

Discussion in 'Ruby' started by Arihan Sinha, Sep 24, 2010.

  1. Arihan Sinha

    Arihan Sinha Guest

    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

    Attachments:
    http://www.ruby-forum.com/attachment/5085/screenshot.png
     
    Arihan Sinha, Sep 24, 2010
    #1
    1. Advertisements

  2. 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 Candler, Sep 24, 2010
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.