Обсуждение: some error when executing query in pgAdmin tool

Поиск
Список
Период
Сортировка

some error when executing query in pgAdmin tool

От
"Penchalaiah P."
Дата:

 

I created one table in pgAdmin tool but when I am executing query it is giving error….

 

CREATE TABLE "ADV"

(

  "T-Section_Id" varchar(10) NOT NULL,

  "CDA_No" varchar(7) NOT NULL,

  "Imp_Schedule_Id" int4 NOT NULL,

  "Sanction_No" varchar(20) NOT NULL,

  "Sanction_Date" date NOT NULL,

  "Station_From" varchar(20) NOT NULL,

  "Station_To" varchar(20) NOT NULL,

  "Amt_Claimed" int4,

  "Amt_Admitted" int4,

  "Dak_Id" varchar(20) NOT NULL,

  "Refund_Dak_Id" int4 NOT NULL,

  "T-Wing_Allowance_Id" varchar(10) NOT NULL,

  CONSTRAINT "ADV_pkey" PRIMARY KEY ("T-Section_Id")

)

WITHOUT OIDS;

ALTER TABLE "ADV" OWNER TO postgres;

 

Above table I created…..

Select * from ADV;   when I am executing this query I am getting error is

 

Relation ADV does not exist… like this error is giving … may I know y am I getting this error

Thanks  &  Regards

Penchal reddy | Software Engineer           

Infinite Computer Solutions | Exciting Times…Infinite Possibilities...

SEI-CMMI level 5 | ISO 9001:2000

IT SERVICES | BPO                                                                                                                                                                          

Telecom | Finance | Healthcare | Manufacturing | Energy & Utilities | Retail & Distribution | Government                                                       

Tel +91-80-5193-0000(Ext:503)| Fax  +91-80-51930009 | Cell No  +91-9980012376|www.infics.com          

Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and/ or its Customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at info.in@infics.com and delete this mail from your records.

 

Re: some error when executing query in pgAdmin tool

От
"Dave Page"
Дата:
 


From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Penchalaiah P.
Sent: 23 May 2006 13:11
To: pgsql-sql@postgresql.org
Subject: [SQL] some error when executing query in pgAdmin tool

 

I created one table in pgAdmin tool but when I am executing query it is giving error….

 

CREATE TABLE "ADV"

(

  "T-Section_Id" varchar(10) NOT NULL,

  "CDA_No" varchar(7) NOT NULL,

  "Imp_Schedule_Id" int4 NOT NULL,

  "Sanction_No" varchar(20) NOT NULL,

  "Sanction_Date" date NOT NULL,

  "Station_From" varchar(20) NOT NULL,

  "Station_To" varchar(20) NOT NULL,

  "Amt_Claimed" int4,

  "Amt_Admitted" int4,

  "Dak_Id" varchar(20) NOT NULL,

  "Refund_Dak_Id" int4 NOT NULL,

  "T-Wing_Allowance_Id" varchar(10) NOT NULL,

  CONSTRAINT "ADV_pkey" PRIMARY KEY ("T-Section_Id")

)

WITHOUT OIDS;

ALTER TABLE "ADV" OWNER TO postgres;

 

Above table I created…..

Select * from ADV;   when I am executing this query I am getting error is

 

Relation ADV does not exist… like this error is giving … may I know y am I getting this error 

 

Try

 

SELECT * FROM "ADV";

 

pgAdmin quoted the tablename because you used uppercase characters. Without the quotes, the name is folded to lowercase.

 

Regards, Dave. 

Re: some error when executing query in pgAdmin tool

От
"Dave Page"
Дата:
 


From: Penchalaiah P. [mailto:penchalaiahp@infics.com]
Sent: 23 May 2006 13:18
To: Dave Page
Subject: RE: [SQL] some error when executing query in pgAdmin tool

Hi sir…

 

I tried like that also … but I am getting same error……I tried like these……

 

1).Select * from adv;

2). Select * from “adv”;

3).Select * from public.adv;   here public is the schema name

 

 Like I said, try:

 

SELECT * FROM "ADV";

 

You created the table with a quoted, uppercase name, so that is how you must reference it.

 

Regards, Dave

Re: some error when executing query in pgAdmin tool

От
Patrick JACQUOT
Дата:
Penchalaiah P. wrote:

> I created one table in pgAdmin tool but when I am executing query it 
> is giving error….
>
> CREATE TABLE "ADV"
>
> (
>
> "T-Section_Id" varchar(10) NOT NULL,
>
> "CDA_No" varchar(7) NOT NULL,
>
> "Imp_Schedule_Id" int4 NOT NULL,
>
> "Sanction_No" varchar(20) NOT NULL,
>
> "Sanction_Date" date NOT NULL,
>
> "Station_From" varchar(20) NOT NULL,
>
> "Station_To" varchar(20) NOT NULL,
>
> "Amt_Claimed" int4,
>
> "Amt_Admitted" int4,
>
> "Dak_Id" varchar(20) NOT NULL,
>
> "Refund_Dak_Id" int4 NOT NULL,
>
> "T-Wing_Allowance_Id" varchar(10) NOT NULL,
>
> CONSTRAINT "ADV_pkey" PRIMARY KEY ("T-Section_Id")
>
> )
>
> WITHOUT OIDS;
>
> ALTER TABLE "ADV" OWNER TO postgres;
>
> Above table I created…..
>
> Select * from ADV; when I am executing this query I am getting error is
>
> Relation ADV does not exist… like this error is giving … may I know y 
> am I getting this error
>
> *Thanks & Regards*
>
> *Penchal reddy **|** Software Engineer *
>
> *Infinite Computer Solutions **|** Exciting Times…Infinite 
> Possibilities... *
>
> *SEI-CMMI level 5 **| **ISO 9001:2000*
>
> *IT SERVICES **|** BPO *
>
> *Telecom **|** **Finance **|** **Healthcare **| **Manufacturing **|** 
> **Energy & Utilities **|** **Retail & Distribution **|** **Government *
>
> *Tel +91-80-5193-0000(Ext:503)**|** Fax +91-80-51930009 **|** Cell No 
> +91-9980012376**|**www.infics.com** *
>
> *Information transmitted by this e-mail is proprietary to Infinite 
> Computer Solutions and/ or its Customers and is intended for use only 
> by the individual or entity to which it is addressed, and may contain 
> information that is privileged, confidential or exempt from disclosure 
> under applicable law. If you are not the intended recipient or it 
> appears that this mail has been forwarded to you without proper 
> authority, you are notified that any use or dissemination of this 
> information in any manner is strictly prohibited. In such cases, 
> please notify us immediately at** **_info.in@infics.com _**and delete 
> this mail from your records.*
>
by quoting ADV in the CREATE TABLE you made it case-sensitive
then by not quoting it in the SELECT, you used the case-insensitive form,
wich PostgreSQL (IIRC) translates as lower case
adv != ADV