Original Message From: <[EMAIL PROTECTED]>
I have a table with many fields and the latest field is:
"CRC" character varying(255),
^^
Select * from base.points where crc = 'e19e26330a0db2f2435106b16623fa82'
What happens when you enter:
Select * from base.points where "CRC" = 'e19e26
- Original Message -
From: Aaron Bono
To: John DeSoi
I don't think so but there was some discussion a week or two ago about
mixing variables and using execute. I am curious, does anyone >know what
the "best" approach is?
Also, I did not address deletions. If you still need to d
- Original Message From: "Kevin Nikiforuk"
xp512-0715-0716=# FOR LV in 1..10 LOOP
It appears that you are trying to use the For .. Loop structure from the
psql command line. This structure is not plain SQL - its meant to be used
within PL/pgSQL. Have you tried incorporating it int
Hi Fotis,
If you end up having to create a solution for each of the 80 tables, you may
want to check out the following (may also give you addtional ideas for what
you're trying to achieve):
http://www.varlena.com/GeneralBits/104.php (Logging Audit Changes with
Composite Typed Columns).
Reg
- Original Message -
From: "Rommel the iCeMAn" <[EMAIL PROTECTED]>
I am trying to pass the following values to the function but I have been
so
far unsuccessful.
What error message are you receiving?
SELECT sp_insert_manifest('me', [EMAIL PROTECTED]', '[EMAIL PROTECTED]', 'test.t
- Original Message -
From: "Mario Splivalo" <[EMAIL PROTECTED]>
If you keep your definition in a script file, you can copy the script and
paste it into pgAdmin's Execute Arbitrary SQL Queries window, and then
execute the script from there.
It's still a pain. If I have two dozen vie
- Original Message -
From: "Mario Splivalo" <[EMAIL PROTECTED]>
Yes, I'm tied to the pgadmin3 for the moment, so there's nothing I could
do. It's a pain to develop a database such way.
Mario,
If you keep your definition in a script file, you can copy the script and
paste it into pg
Hi Rodrigo,
- Original Message -
From: "Rodrigo Carvalhaes" <[EMAIL PROTECTED]>
To:
Sent: Wednesday, April 27, 2005 12:39 PM
Subject: [SQL] SYNTAX ERROR ON FOR... LOOP
Hi Guys,
I am having a "simple syntax problem" but very strange...
I am trying to make an IF / ELSE / END IF inside of
Only specifying a default value does not prevent a NULL from being entered
either through accident or ignorance:
jan28-05=# create table test (foo text, foo1 int4 default(0));
CREATE TABLE
jan28-05=# insert into test values('a',1);
INSERT 98685 1
jan28-05=# insert into test values('b',4);
INSERT
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Monday, March 14, 2005 12:15 PM
Subject: [SQL] Generic Function
Hi,
Can I built a generic function like:
CREATE FUNCTION f (text) RETURNS TEXT as
$$
return 'select * from $1';
$$
I know its impossible as writed. Also I have lo
riginal Message -
From:
Theo Galanakis
To: 'George Weaver'
Cc: 'pgsql-sql@postgresql.org'
Sent: Tuesday, February 22, 2005 4:13
PM
Subject: Re: [SQL] Working with
XML.
George,
I have run this SP in
Cold Fusion, PgAdmin and EMS PostgreSQL M
worked as expected.
Perhaps the client you're using is causing the
problem. Can you run the query in pgAdmin?
Regards,
George
- Original Message -
From:
Theo Galanakis
To: 'George Weaver'
Cc: 'pgsql-sql@postgresql.org'
Sent: Monday, Febr
Title: Message
Hi Theo,There have been 2 major changes
between the 7 and 8 versions that affect the coding in xml2. You need to
edit the source code in order for it to compile properly on 7.First,
work_mem has to be changed to SortMem (line 666).
I.e. tupstore = tuplestore_begin_heap(tr
perly - I should be able to help you with
that. I don't think you can use it on any version earlier than
7.2.
Regards,
George
- Original Message -
From:
Theo Galanakis
To: 'George Weaver'
Sent: Tuesday, February 15, 2005 4:30
PM
Subject: RE: [SQL] Workin
:13:18''}2d4mat2Lptmdydtgqnc5vnuzxgqxiykqn1c4pr0oduk5gwz25b3Lq05dzqxetee9om45b69ytb48uvziL5xrvyu4k7ng4oouihx0764929641215{ts
''2005-02-14
16:13:18''}1z5x6dLc9n1vtcLbmk7q6hdriqLa2ub4et41podr7izcro4nkkLsvp9p0s7obzr27txvknn92m0ps4riqqx7puqoLn2wpmm2z50r'jan28-05(#
,&
Title: Working with XML.
Hi Theo,
I am not aware of any means of passing xml to
stored procedures, apart from writing your own function to parse the
xml.
In regard to your second question - how to
access the second record - try using a more explicit xpath query
incorporating a "where" co
Hi Marc,
One option is to create a simple data type and return the rowtype of the
datatype
eg CREATE TYPE tserverload AS ("server_name" text, "load_avg" int4);
CREATE FUNCTION getserverload()
RETURNS tserverload
AS
'DECLARE
r tserverload%rowtype;
etc.
You would then return r, comprise
Hi Richard,
What happens if you just do:
where trim(status) = trim($1)
Regards,
George
- Original Message -
From: "Richard Hurst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 12, 2004 4:04 AM
Subject: [SQL] Returning A Varchar From A Function
> Hi
>
> this has
David,
I tend to use \ to escape things like ' - I find it makes it somewhat easier
to debug.
What about:
sql_string :=\' INSERT INTO temp_table ( view_name, row_count ) SELECT \'
|| r_rec.viewname ||
\', count(*) FROM \'
||
Hi Tom,
Switching to a fixed-width font did the trick.
Thanks for the help.
George
- Original Message -
From: "Tom Lane" <[EMAIL PROTECTED]>
To: "George Weaver" <[EMAIL PROTECTED]>
Cc: "Josh Berkus" <[EMAIL PROTECTED]>; <[EMAIL PRO
oncatenate the two as they are being displayed as one column in a drop
down combobox.
Is what I'm trying to do possible???
George
- Original Message -
From:
Louise
Cofield
To: 'George Weaver' ; [EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 5:19
P
Hi Everyone,
I am trying to concatenate two fields through a
query:
SELECT
RPAD(no,30,' ') || tableb.kind FROM tablea
WHERE
tablea.kind = tableb.kind
The result gives (for
example):
4595448
Green5966
Yellow106-60033
Kumar,
What about this:
EXECUTE 'select now()+ interval \' || to_char(3,\'9\') || \'month\' ';
George
- Original Message -
From: "Kumar" <[EMAIL PROTECTED]>
To: "Christoph Haller" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, November 10, 2003 5:57 AM
Subject: Re: [SQL] Dyn
Kumar,
pg_class.relname is type "name". You are trying to compare it to p_tablename
which is type "varchar". Try changing your function definition to:
CREATE OR REPLACE FUNCTION public.desc_table(name)
HTH
George
SNIP
> CREATE OR REPLACE FUNCTION public.desc_table(varchar)
> RETURNS re
Hi Kumar,
Looks like I got up too early this morning -
please ignore my previous reply re: varchar(30) (I was looking at the wrong
function :-( ).
I do use arrays in Pl/pgSQL functions, and have
defined them as you did, e.g. varchar[], which does not return an error.
What version of P
Hi Kumar,
It is possible to pass an array to a PL/pgSQL
function, but I believe you must specify the length of the array (at least doing
so works for me). E.g. "varchar(20)".
Regards,
George
- Original Message -
From:
Kumar
To: psql
Sent: Wednesday, October 08, 2003
>From the manual:
replace(string text, from text, to text) text Replace all occurrences
in string of substring from with substring to replace('abcdefabcdef', 'cd',
'XX') abXXefabXXef
HTH.
George
- Original Message -
From: "HR" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Mo
Kumar,
Have you tried
EXECUTE 'update "WATS".action_plan_master set
rec_deleted_flag = \'Y\' WHERE action_plan_id IN ('|| p_action_plan_ids ||
')';^
^
HTH,
George
- Original Message -
From:
Kumar
Hi Wei,
I hadn't tried that, and it did the trick!
Thank you!
George
- Original Message -
From: "Wei Weng" <[EMAIL PROTECTED]>
To: "George Weaver" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, September 26, 2003 2:16 PM
Subject:
Hi Josh,
Thanks for the reply.
What I am trying to achieve is to have errors go to a file, rather than show
up on the screen.
Is this possible?
George
- Original Message -
From: "Josh Berkus" <[EMAIL PROTECTED]>
To: "George Weaver" <[EMAIL PROTECTE
I am in the process of creating a batch file
that will update some functions in a database for a remote user similar
to:
psql -o output dbname <
functionupdate.sql
Is there any way to save any ERROR and
NOTICE messages to a file?
The -o option doesn't capture this
information.
Tha
I had the same success using 7.3.2 with Cygwin:
e=# SELECT functest1('A','B'), functest1(null,'B'), functest2('A','B'),
functest2(null,'B');
functest1 | functest1 | functest2 | functest2
---+---+---+---
A | B | A | B
(1 row)
e=# select ve
Hi Yaroslav,
You must set the language as:
LANGUAGE 'plpgsql';
Regards,
George
- Original Message -
From:
Yaroslav Ulyanov
To: [EMAIL PROTECTED]
Sent: Thursday, September 04, 2003 2:46
AM
Subject: [SQL] Help me
Hello
I cannot write new functio
zle this one
through as well).
Sorry for the confusion.
George
- Original Message -
From: "George Weaver" <[EMAIL PROTECTED]>
To: "Tom Lane" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, August 25, 2003 9:51 PM
Subject: Re: [SQL] Strange be
) conventions
(1 row)
In both cases the month is being sent to the stored procedure first, but in
the first instance (month < 13) it is being interpreted as the day.
George
- Original Message -
From: "Tom Lane" <[EMAIL PROTECTED]>
To: "George Weaver" &l
Hi Everyone,
I have a situation where two tables have a
"Created" field defined as follows:
table
seedlot "created timestamptz DEFAULT
now(), "
table transaction"created
timestamptz NOT NULL DEFAULT now(),"
The transaction table records when a seedlot record
It works in 7.3.2.
George
- Original Message -
From:
Elielson Fontanezi
To: pgsql-general ; pgsql-sql
Sent: Wednesday, July 30, 2003 10:52
AM
Subject: [SQL] ALTER TABLE ... DROP
CONSTRAINT
Hi
all!
Who can tell me what postgres version supports
Brian,
You can also use the "record" type as well in the same way.
George
- Original Message -----
From: "George Weaver" <[EMAIL PROTECTED]>
To: "Brian Knox" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 2:01 PM
Subje
Hi Brian;
Assuming "NEW" has been declared as foo%rowtype, you can access the
columns thus
NEW.xxx where xxx is the column name
HTH.
George
- Original Message -
From: "Brian Knox" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 29, 2003 11:11 AM
Subject: [SQL] "re
39 matches
Mail list logo