From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Penchalaiah P.
Sent: 23 May 2006 13:41
To: pgsql-sql@postgresql.org
Subject: [SQL] hi can u give solution to this query

Hi sir…

 

 If u don’t mind can u reply for this  question

 

This is one table… it has one primary key…….so I can insert the values from  data edit…

 

1)…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;

 

2) this table doesn’t contain primary key … but I cant insert values from data edit…

 

 

CREATE TABLE "ADV_LTC"

(

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

  "Ltc_Block_Year" date NOT NULL,

  "Ltc_Type" varchar(10) NOT NULL,

  "Leave_Period_From" date NOT NULL,

  "Leave_Period_To" date NOT NULL,

  "Date_Journey" date NOT NULL,

  "Travelling" varchar(10) NOT NULL,

  "No_Child" int4,

  "No_Adult" int4,

  "Child_Fare" int4,

  "Adult_Fare" int4,

  "Journey_Fare" int4,

  "Amt_Clm" int4 NOT NULL,

  "Amt_Adm" int4,

  "Remarks" varchar(40)

)

WITHOUT OIDS;

ALTER TABLE "ADV_LTC" OWNER TO postgres;

 

 

 Can u check it y I am unable to insert values to 2nd table……….

 

You have answered your own question. pgAdmin won't allow you to edit a table without either OIDs or a Primary Key because it has no way to identify a row (which many would say is a broken design).

 

Regards, Dave.

Reply via email to