[SQL] How to change a view's owner in postgres(is it possible?)

2008-08-01 Thread Anoop G
Dear all, We can change the owner of a tbale like this alter table tbl_year_end owner to anoop; Is it possible to change the owner name of a view through sql?

[SQL] How to change a view's owner in postgres

2008-08-01 Thread Anoop G
Dear All, How to change a view's owner in postgres? thanks in advance: Anoop

Re: [SQL] Test if a table is present

2008-07-25 Thread Anoop G
you can find it throuh a query like this select tablename from pg_tables where tablename = 'tbl_updated_status_master'; regards: Anoop

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Anoop G
Hai all, my postgres version is PostgreSQL 8.1.8 didn't support clock_timestamp() regards: Anoop

Re: [SQL] postgres time zone settings(time difference in Server and client)

2008-07-25 Thread Anoop G
Hai all, I have database running on server. I am using python to run my application.postgres client is running on the clients .All clients are connected to a single database running on server. Each time application starts ,the login time is taken from server using the query """select CAST ( t

[SQL] postgres time zone settings

2008-07-24 Thread Anoop G
Hai all, when i was going through the Postgresql documents, i came across a section which tells about the TIME ZONE settings what i understood from the document is, based on the value given in this conf file postgres will add or subtract the displacement hours to the system time assuming that th

Re: [SQL] how to perform minus (-) operation in a dynamic query

2008-07-14 Thread Anoop G
Hai all, Thanks to all , I got the answer, actualy I am write the function in openoffice.org and paste it to a .sql file that is the reason for the error. thanks Anoop On Mon, Jul 14, 2008 at 7:32 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Anoop G" <[EM

[SQL] how to perform minus (-) operation in a dynamic query

2008-07-13 Thread Anoop G
Hai all, I am new to plpgsql ,I have a table structure: Column | Type | Modifiers +--+--- mf | double precision | sf | double precision | comm | integer | I create a the following funtion create or replace function test_perc(

Re: [SQL] Problem in dynamic query execution in plpgsql

2008-07-12 Thread Anoop G
rn res; end$body$ language 'plpgsql' Then i try to call it from another function vchr_query:='SELECT mf,sf,comm,calc_perse(mf,sf,comm) as flt_claim from calc'; FOR r in EXECUTE vchr_query LOOP RETURN NEXT r; END LOOP; It also faild, How I can call a function like this from other function? thanks in advance Anoop G

[SQL] Problem in dynamic query execution in plpgsql

2008-07-10 Thread Anoop G
next problem is i have a varchar variable vchr_our_lpo how I can check is it containn an empty string or characters in a dynamic query string I tried different methods like, vchr_query :='' (vchr_our_lpo = '' '' OR vchr_our_lpo = "VS") ''; str_temp2:= ''VS''; vchr_query := '' (vchr_our_lpo = '' '' OR vchr_our_lpo = %) '',str_temp2; but all failed How I can solve these problem in a dynamic query string?.pls help me with a suitable example thanks in advance: Anoop G

[SQL] How I can check a substring is a valid number in postgresql ?

2008-04-24 Thread Anoop G
Dear All, How I can check a substring is a valid number in postgresql ? example: I have a query select max(substring(code,2,length(code))::INT) from emp where substring(code,0,2) = 'A'; code A0001 A0002 ABC005 S0002 This query fails because of ABC002, how I can avoid this erro

[SQL] how to returns set of records in PL/python

2008-04-07 Thread Anoop G
Hi , Iam new to plpython,how can I return a recordset from a plpython function? Is there is any way give me an example; plpgsql function CREATE OR REPLACE FUNCTION function_to_get_all_countries() RETURNS SETOF RECORD AS $BODY$ DECLARE r RECORD; BEGIN

[SQL] BROBLEM IN BETWEEN QUERY (plpgsql)

2008-04-03 Thread Anoop G
hai all, I have a plpgsql function and I am using postgresl 8.1.9 CREATE OR REPLACE FUNCTION get_vehicle_id(INT) RETURNS SETOF RECORD AS $BODY$ DECLARE r RECORD; int_day ALIAS FOR $1; BEGIN FOR r in SELECT fk_bint_old_vehicle_number AS vehicle_id FROM tbl_rac_ve