Thread: Simple Problem ?

Simple Problem ?

From
Hengky Lie
Date:
Dear friends,

I really amazed with this problem and need your help.

I run simple query from Query window of PgAdmin3: SELECT * FROM mytable 
limit 10;

and the result are NON UPDATABLE QUERY, while i need the result are 
updatable.

I run the same query from Passthrough SQL in Microsoft Access, the 
result are the same (non updatable). But when i run this query from EMS 
SQLMANAGER for postgre, the result are UPDATABLE. I really amazed.

Could someone help me ?

Thanks a lot


Re: Simple Problem ?

From
Guillaume Lelarge
Date:
Hengky Lie a écrit :
> [...]
> I really amazed with this problem and need your help.
> 
> I run simple query from Query window of PgAdmin3: SELECT * FROM mytable
> limit 10;
> 
> and the result are NON UPDATABLE QUERY, while i need the result are
> updatable.
> 
> I run the same query from Passthrough SQL in Microsoft Access, the
> result are the same (non updatable). But when i run this query from EMS
> SQLMANAGER for postgre, the result are UPDATABLE. I really amazed.
> 
> Could someone help me ?
> 

Do you have a primary key on mytable or OID ?

If you don't, pgAdmin3 can't allow modification because it doesn't know
how to select a line uniquely. I suppose it is the same for Access. And
it is a really bad behaviour of EMS SQL Manager.

Regards.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Simple Problem ?

From
Guillaume Lelarge
Date:
Hengky Lie a écrit :
> This is the same as what i think but the table has primary key and has
> no relation to other table. This is the table definition :
> [...]
> 
> These query result non updateable records :
> 
> SELECT kode, namabarang from tblproduk;
> 
> SELECT * from tblproduk;
> 
> What is the problem ?
> 

Oops, I was wrong on this. You can't edit results in the query tool. You
need to use the data viewer (menu Tools/View Data/View All Rows ;
there's also a button in the toolbar).


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com


Re: Simple Problem ?

From
Hengky Lie
Date:
I have to use sql command because i want to retrieve data according to 
several criteria. 

The SQL command just a sample to show that the data i retrieve not 
updateable. The real query like :

SELECT * FROM TBLPRODUK WHERE SUBKAT='abc';

So i do not need to view data from data viewer, but using query with an 
updateable result.

Any suggestion ?

Thanks in advance

Guillaume Lelarge wrote:
> Hengky Lie a écrit :
>   
>> This is the same as what i think but the table has primary key and has
>> no relation to other table. This is the table definition :
>> [...]
>>
>> These query result non updateable records :
>>
>> SELECT kode, namabarang from tblproduk;
>>
>> SELECT * from tblproduk;
>>
>> What is the problem ?
>>
>>     
>
> Oops, I was wrong on this. You can't edit results in the query tool. You
> need to use the data viewer (menu Tools/View Data/View All Rows ;
> there's also a button in the toolbar).
>
>
>   



Re: Simple Problem ?

From
Guillaume Lelarge
Date:
Hengky Lie a écrit :
> I have to use sql command because i want to retrieve data according to
> several criteria.
> The SQL command just a sample to show that the data i retrieve not
> updateable. The real query like :
> 
> SELECT * FROM TBLPRODUK WHERE SUBKAT='abc';
> 
> So i do not need to view data from data viewer, but using query with an
> updateable result.
> 
> Any suggestion ?
> 

Yes, use the data viewer : menu Tools/View Data/View Fitered Rows.


-- 
Guillaume.http://www.postgresqlfr.orghttp://dalibo.com