[SQL] SQL query not working when GROUP BY / HAVING is used

2000-12-19 Thread juerg . rietmann

Hello there

I have a question regarding a SQL statement.

When I execute (and that's what I need)

SELECT Zylinder.Z_durch_soll, Zylinder.Z_id, Zylinder.Z_durch_ist,
((Zylinder.Z_durch_soll+0.12) - Zylinder.Z_durch_ist) AS durchmesserdelta,
(Zylinder.Z_durch_soll+0.12) AS effektiv
FROM Auftrag,Zylinder_Typen, Zylinder
WHERE Auftrag.A_nr = '11'
AND (  Auftrag.A_farbe_1  > '0' AND Zylinder_Typen.Z_farbe='1' AND
Zylinder_Typen.Z_SW='0')
AND Zylinder_Typen.Z_durch_soll = Zylinder.Z_durch_soll
AND Auftrag.A_Ztyp=Zylinder.Z_typ
AND Z_A_nr = NULL
AND Z_status = 'zcu'
GROUP BY Zylinder.Z_durch_soll
HAVING durchmesserdelta >= 0.085
ORDER BY Zylinder_Typen.Z_durch_soll desc

I get the following error in the pgadmin.log file.

19.12.00 10:53:34   Executing: SELECT Zylinder.Z_durch_soll, Zylinder.Z_id,
Zylinder.Z_durch_ist, ((Zylinder.Z_durch_soll+0.12) - Zylinder.Z_durch_ist)
AS durchmesserdelta, (Zylinder.Z_durch_soll+0.12) AS effektiv FROM
Auftrag,Zylinder_Typen, Zylinder WHERE Auftrag.A_nr = '11' AND (
Auftrag.A_farbe_1 > '0' AND Zylinder_Typen.Z_farbe='1' AND
Zylinder_Typen.Z_SW='0') AND Zylinder_Typen.Z_durch_soll =
Zylinder.Z_durch_soll AND Auftrag.A_Ztyp=Zylinder.Z_typ AND Z_A_nr = NULL
AND Z_status = 'zcu' GROUP BY Zylinder.Z_durch_soll HAVING durchmesserdelta
>= 0.085 ORDER BY Zylinder_Typen.Z_durch_soll desc
19.12.00 10:53:34   Executing SQL Query...
19.12.00 10:53:34   Done - 0,01 Secs.
**
* Error - 19.12.00 10:53:34
**

Software

Program: pgAdmin
Version: 7.0.4
Sub or Function: frmSQL, cmdExecute_Click

Error Details
*
Error No: -2147217887
Error Description: Der ODBC-Treiber unterstützt die angeforderten
Eigenschaften nicht.
Error Source: Microsoft OLE DB Provider for ODBC Drivers
DLL Error Code: 0

Memory Details
**
Total Physical: 132435968
Total Swap: 434098176
Total Virtual: 2147352576
Available Physical: 34004992
Available Swap: 291512320
Available Virtual: 2079350784
Percentage Free: 0

System Details
**
Processor: 586
OEM ID: 0
No. Processors: 1
Page Size: 4096

OS Details
**
Platform: Windows NT
Version: 4.0
Build: 1381
OS Info: Service Pack 5

Environment Details
***
Datasource: pgmondadori
Tracking: False
TrackVer: 0
Connect: Provider=MSDASQL.1;Extended Properties
="DSN=pgmondadori;DATABASE=mondadori;SERVER=srvlnx01.pup.ch;PORT=5432;UID=postgres;PWD

**;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=1;SHOWOIDCOLUMN=1;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS

"
Version: 2.6


Using the same statement without the GROUP BY and HAVING it is ok !

SELECT Zylinder.Z_durch_soll, Zylinder.Z_id, Zylinder.Z_durch_ist,
((Zylinder.Z_durch_soll+0.12) - Zylinder.Z_durch_ist) AS durchmesserdelta,
(Zylinder.Z_durch_soll+0.12) AS effektiv
FROM   Auftrag,Zylinder_Typen, Zylinder
WHERE   Auftrag.A_nr = '11'
AND (Auftrag.A_farbe_1  > '0' AND Zylinder_Typen.Z_farbe='1' AND
Zylinder_Typen.Z_SW='0')
AND  Zylinder_Typen.Z_durch_soll = Zylinder.Z_durch_soll
ANDAuftrag.A_Ztyp=Zylinder.Z_typ
ANDZ_A_nr =NULL
ANDZ_status = 'zcu'
ORDER BY Zylinder_Typen.Z_durch_soll desc

Whats wrong, according to the docs, the syntax is ok and it should be
possible to use these keywords!


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315





[SQL] how to build this query ??? Please help !!!

2001-01-03 Thread juerg . rietmann

Hello there

I have a problem, building a query. Who can help ?
I use postgreSQL 7.0.3.

Thanks for any help and suggestions ... jr

orders
a_nr ¦ product ¦ state
-
11   ¦ tp  ¦ 
12   ¦ fi  ¦ 
13   ¦ tp  ¦ 
14   ¦ ok  ¦ 
15   ¦ dm  ¦ 

cylinders
z_a_nr   ¦ z_status
--
11 ¦  zdr
11 ¦  zdr
12 ¦  zdr
12 ¦  zcu
13 ¦  zdr
13 ¦  zcu
13 ¦  zcu
13 ¦  zcr
15 ¦  zcu
15 ¦  zcu
15 ¦  zdr

I need a query for the following output :

a_nr   ¦  #cylinder #zdr #zcu #zcr productstate
--
112 200dm 
122 110tp 
134 121fi 
140 000ok 
153 120dm 






PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315





[SQL] how to store this record ?? pg_atoi

2001-01-09 Thread juerg . rietmann

Hello there

Using coldfusion 4.5.1 together with postgreSQL 7.0.3 I try to store a new
record in my table. There is an inputfield type="text" with the value of 6.
I get the following error when I try to add a new record to the database.

How to change this ???

Thanks in advance ... jr

6



Error Occurred While Processing Request


|--|
| Error Diagnostic Information 
||
|  
||
|  
||
| ODBC Error Code = S1000 (General error)  
||
|  
||
|  
||
| Error while executing the query; ERROR: pg_atoi: error in "6.00": can't parse
||
| ".00"
||
|  
||
|  
||
| The error occurred while processing an element with a general identifier of 
|(CFINSERT),  |
| occupying document position (14:3) to (19:76).   
||
|  
||
|  
||
| Date/Time: Tue Jan 9 10:36:28 2001   
||
| Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)  
||
| Remote Address: 172.16.30.7  
||
| HTTP Referer: http://mondadori.pup.ch/main.cfm   
||
| Query String: actionstring=add   
||
|--|










PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315





[SQL] monster query, how to make it smaller

2001-01-23 Thread juerg . rietmann

Hello everybody

I need some help on a monster query. Please see the attached file for the
query itself. The only difference is Z_durch_soll and the offset, which is
currently 0.25. The query will run in a loop where I increment this offset
until I find enough records.

Thanks in advance ... jr

(See attached file: monsterQuery.txt)


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315

 monsterQuery.txt


[SQL] how to query this ??

2001-01-26 Thread juerg . rietmann

Hi everybody

I have quite a query to build and don't know, whether this can be done with
SQL.

Please see the attachment for the details.

Any help is really appreciated !!

Thanks in advance  jr

(See attached file: queryDetails.doc)


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315

 queryDetails.doc


[SQL] no value for numeric filed in SQL statement causes an error

2001-01-31 Thread juerg . rietmann

Hi there

I have a table with char and int fields. From my form  I get no values back
for int fields when they are left blank. This causes the SQL insert to
fail.

field type
name char
id   int2
city char

insert into table (name,id,city) values ('roger rabbit',,'carrot city')

The default for int/float fields is 0. Since I reuse the code of the
referring page I don't like to have all fields assigned 0 at the beginning.

Who can help ???

Thanks ... jr


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315





[SQL] How to build this field

2001-03-08 Thread juerg . rietmann

Hi everybody

I need to build an additional field (metakey) out of three fields in the
table.

SELECT a.a_kurzbez, a.a_ausgabenr, a.a_bundnr, a.a_nr, a.a_z_blaenge,
a.a_z_laenge, a.a_z_umfang  FROM auftrag a

should be changed to something like

SELECT (a.a_kurzbez + a.a_ausgabenr + a.a_bundnr) as metakey, a.a_kurzbez,
a.a_ausgabenr, a.a_bundnr, a.a_nr, a.a_z_blaenge, a.a_z_laenge,
a.a_z_umfang  FROM auftrag a


output :

field :   metakeya_kurzbez   a_ausgabenr
a_bundnr

 DMD 001 03 DMD 001
03

Thanks for any help ... jr


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] copy a record from one table to another (archive)

2001-03-13 Thread juerg . rietmann

Hello there

Is it possible to move a record from one table to another to do a archive
with a simple command like move  ?

Thanks  jr


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] postgres DB temporary on NT

2001-03-19 Thread juerg . rietmann

Hi there

For testing, I have a Microsoft Windows NT Server with IIS 4.0 running in
my DMZ. Currently it is not possible to migrate this server to LinuX. Is
there a way to move an existing postgreSQL 7.0.3 db (with views/sequences)
from a Linux Server to this NT Web server. I have coldfusion on NT, all I
need is the postgres DB or a 100% compatible on NT.

Any ideas ??  Thanks in advance ... jr

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] postmaster not starting on my MS WIN NT

2001-03-20 Thread juerg . rietmann

Hi everybody

I found the needed install package for postgres 7.0.3 for win32.
Installation worked. When I try to start the postmaster in the cygwin bash
shell with

postmaster -D /data

I get the error as documented in the attached gif.

It says something about shared memory problem and semaphore stuff.

Thanks for any help ... jr

(See attached file: cygwin.gif)


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315

 cygwin.gif


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] how to build this string ?

2001-03-22 Thread juerg . rietmann

Hello there

Is it possible (and I think it is) to do the following :

I have a table with diameters and types. I need to build a comma separated
string.

typ   diam
01800
01840
01870
011120
02760
02780
02800
02900
031200
031234
031352

select diam from zylinder where typ='01'

should produce the string "800,840,870,1120"

Thanks for any help ... jr


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] Still don't know how to build this string ?

2001-03-26 Thread juerg . rietmann

Hello there

I have still the same problem. Any help would really be appreciated !
Thanks ... jr

Is it possible (and I think it is) to do the following :

I have a table with diameters and types. I need to build a comma separated
string.

typ   diam
01800
01840
01870
011120
02760
02780
02800
02900
031200
031234
031352

select diam from zylinder where typ='01'

should produce the string "800,840,870,1120"




PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315




---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



[SQL] Re: Still don't know how to build this string ? how to concat ??

2001-03-27 Thread juerg . rietmann


Hello

I'm closer to a solution. The query results is :

Result:
01   1440
02   1460
03   1398

The values (1440, ...) are the last entries of z_u_umfang for each z_u_typ.
This is correct since in the function the list:= ... is overwritten until
the last record is read.
When I try to concat the list in the manner of list := list ||
text(rec.z_u_umfang); the zustring is empty !

Thanks for any help ... jr

Query :
select distinct z_u_typ, buildString(z_u_typ) as zustring from
zylinder_umfang

Function:
CREATE FUNCTION buildString(bpchar) RETURNS text AS '
DECLARE
list   text;
rec  record;
BEGIN
  FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE z_u_typ
= $1;
 list := text(rec.z_u_umfang);
  END LOOP;
  RETURN list;
END;
' LANGUAGE 'plpgsql';



PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



[SQL] Re: Still don't know how to build this string ?

2001-03-27 Thread juerg . rietmann


Hey folk's

Thanks everybody helping me with my problem, it is solved ! The problem was
that I took double quotes instead of single quotes ... arg.

By the way, is there any doc's about plpgsql ?

jr

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] how to do this join ?

2001-04-06 Thread juerg . rietmann

Hello there

I have another SQL question. Please see the example :

select *,
(select a_typ from auftrag where a_nr=z_a_nr) as typ,
(select a_t_definition_d from auftrags_typ where a_t_code=typ) as text
from zylinder

I have three tables that I need data from. I'd like to use the  to
temporary store the kind of auftrag and then use it to get the
definition (clear text) from another table.

The query returns that typ is not known .

How can I do it ?

Thanks ... jr

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] calling a function within a view causes problems doing a pg_dumpall

2001-05-07 Thread juerg . rietmann

Hello

I need to transfer a db form one to another server. I wanted to do this
with pg_dumpall and psql -e 

I isolated the problem in a view. When I call a self defined function
(buildstring) the problem occurs and when I remove this call pg_dumpall
works. Calling the view with select * from viewrzumfang works with and
without the function call.

I use postgresql 7.0 on SUSE Linux

Function :

CREATE FUNCTION buildString(bpchar) RETURNS text AS '
DECLARE
list   text;
rec  record;
BEGIN
list := '''';
  FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE z_u_typ
= $1;
 list := list || text(rec.z_u_umfang) || '','';
  END LOOP;
  RETURN list;
END;
' LANGUAGE 'plpgsql';

View that is not working :

SELECT rotation.r_code, rotation.r_name, rotation.r_z_typ,
(SELECT zylinder_typen.z_laenge FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_laenge,
(SELECT zylinder_typen.z_blaenge FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_blaenge,
(SELECT zylinder_typen.z_alaenge_l FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_alaenge_l,
(SELECT zylinder_typen.z_alaenge_r FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_alaenge_r,
(SELECT rtrim(buildstring(rotation.r_z_typ), ','::text) AS rtrim) AS
r_z_umfang FROM rotation;

View that is working :

SELECT rotation.r_code, rotation.r_name, rotation.r_z_typ,
(SELECT zylinder_typen.z_laenge FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_laenge,
(SELECT zylinder_typen.z_blaenge FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_blaenge,
(SELECT zylinder_typen.z_alaenge_l FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_alaenge_l,
(SELECT zylinder_typen.z_alaenge_r FROM zylinder_typen WHERE
(zylinder_typen.z_typ = rotation.r_z_typ)) AS r_z_alaenge_r,
FROM rotation;

Thanks for any help ... jr

====
PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to [EMAIL PROTECTED] so that your
message can get through to the mailing list cleanly



[SQL] how to add an new record from part of an old one

2001-05-17 Thread juerg . rietmann

Hi there

I need to half copy and insert new data in a new record. Please see the SQL
statement, that is not working, but i think is shows what I'd like to do.
The fields a_nr and a_kurzbez will get the values from a form and a_bez
needs to be copied from an existing auftrag.

Thanks for any help ... jr


insert into auftrag (a_nr, a_kurzbez) values (123456789, 'testtext')
(select a_bez from auftrag where a_nr='200113672732')



PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



[SQL] select only the first record

2001-07-10 Thread juerg . rietmann

Hello there

Is it possible to do a query and selecting only the first record in ad
table ?

e.g. select FIRST * from cars

Tx in advance ... jr


PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

phone: +4141 790 4040
fax: +4141 790 2545
mobile: +4179 211 0315



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] Function not running after upgrade 7.03 to 7.2

2002-06-14 Thread juerg . rietmann

I have three functions running under 7.03, Now, after the Upgrade to 7.2
these functions are not working.
What has changed in version 7.2 that causes this problem.

Function :

CREATE FUNCTION "buildUmfang"("bpchar") RETURNS "text" AS 'DECLARE
  list   text;
  rec  record;
BEGIN
list := '''';
FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE z_u_typ = $1
LOOP
  list := list || text(rec.z_u_umfang) || '','';
END LOOP;
RETURN list;
END;

' LANGUAGE 'plpgsql';
COMMENT ON FUNCTION "buildUmfang"("bpchar") IS 'Diese Funktion generiert
einen String mit allen Umfängen zum übergebenen Zylindertyp\n\n';


Query :

SELECT *,
(SELECT rtrim(buildUmfang(zylinder.z_typ), ','::text) AS rtrim) AS umfang
FROM zylinder;

Thank's in advance for any help  jr


__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] function not running after upgrade from 7.03 to 7.2

2002-06-14 Thread juerg . rietmann

Hello

I have three functions running under 7.03, Now, after the Upgrade to 7.2
these functions are not working.
What has changed in version 7.2 that causes this problem.

Function :

CREATE FUNCTION "buildUmfang"("bpchar") RETURNS "text" AS 'DECLARE
  list   text;
  rec  record;
BEGIN
list := '''';
FOR rec IN SELECT z_u_umfang FROM zylinder_umfang WHERE z_u_typ = $1
LOOP
  list := list || text(rec.z_u_umfang) || '','';
END LOOP;
RETURN list;
END;

' LANGUAGE 'plpgsql';
COMMENT ON FUNCTION "buildUmfang"("bpchar") IS 'Diese Funktion generiert
einen String mit allen Umfängen zum übergebenen Zylindertyp\n\n';


Query :

SELECT *,
(SELECT rtrim(buildUmfang(zylinder.z_typ), ','::text) AS rtrim) AS umfang
FROM zylinder;

Thank's in advance for any help  jr

__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__



---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] function text_ge(text, text), how to use on version 7.2

2002-06-18 Thread juerg . rietmann

Hello there

I use the function text_ge(text, text) under version 7.03 and it was just
fine. After upgrading to version 7.2 this function doesn't work anymore.

this statement shows all the records even if the greatest year is 2002 in
ul_datum :
select * from userlog where text_ge(ul_datum, '01.01.2004')

Thanks in advance ... Juerg Rietmann



__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] date_ge and time_ge

2002-06-21 Thread juerg . rietmann

Hello

I have a question regarding date_ge() and time_ge().

This statement works :

select * from userlog where date_ge(ul_timestamp, '20.06.2002')


This statement doesn't work :

select * from userlog where time_ge(ul_timestamp, '08:00:00')


Here are some records from userlog :

(See attached file: userlog.htm)

__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__

Title: Query Results



  Query Results
  Executed: 21.06.2002 11:34:29
  Query: select * from userlog limit 10
  

  pk_userlog ul_timestamp ul_benutzer ul_access ul_ipadr ul_bereich ul_auftrag ul_zylinder ul_text 


  1001 19.06.2002 08:53:26 basler   10 172.16.30.7 OrderActionAdd 70045291     /IKE/0017/4/00/40/800/02/s1   /5/ 


  1002 19.06.2002 09:33:26 basler   10 172.16.30.7 Logout   User logged out ! 


  1003 19.06.2002 09:33:36 basler   10 172.16.30.7 Login    User logged in ! 


  1004 19.06.2002 09:33:53 basler   10 172.16.30.7 OrderCylinderAction     8828    Cylinder removed from order ! 


  1005 19.06.2002 09:33:55 basler   10 172.16.30.7 OrderCylinderAction     8804    Cylinder removed from order ! 


  1006 19.06.2002 09:33:56 basler   10 172.16.30.7 OrderCylinderAction     8805    Cylinder removed from order ! 


  1007 19.06.2002 09:33:57 basler   10 172.16.30.7 OrderCylinderAction     8806    Cylinder removed from order ! 


  1008 19.06.2002 09:33:59 basler   10 172.16.30.7 OrderCylinderAction     8822    Cylinder removed from order ! 


  1009 19.06.2002 09:34:00 basler   10 172.16.30.7 OrderCylinderAction     8808    Cylinder removed from order ! 


  1010 19.06.2002 09:34:01 basler   10 172.16.30.7 OrderCylinderAction     8817    Cylinder removed from order ! 

  




---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



[SQL] how to use nextval()

2002-07-05 Thread juerg . rietmann

Hello there

I have an idea how to solve my problem on copy a record to a new one in the
same table. To do so I need the next value for the primary key.

Using :

select nextval('pk_auftrag') as nextkey from auftrag;

I get an error like : Relation pk_auftrag does not exist !

Thanks for any help ... jr

__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__





---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster





[SQL] how to cast this ?

2002-09-12 Thread juerg . rietmann

Hello there

I have a db table with two char fields :

log_date char(10)
log_time char(8)

I added a new field log_timestamp of type timestamptz

How do I take the data from log_date and log_time and put it into
log_timestamp ?

update log set log_timestamp = cast (log_date as timestamp) || cast
(log_time as timestamp)

is not working.

Thank's in  advance ... jr

__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster



[SQL] still sorting and casting problems

2002-09-12 Thread juerg . rietmann


Hello there

Unfortunately, I can't change the fieldtype that easy because other
applications use the date as char(10) field as well.

I need to sort the query by the log_date desc (log_date is char(10)). I
tried the following without success :

select id, log_date from userlog order by cast (log_date as date) desc

select id, log_date from userlog order by date(log_date) desc

Please help and thank's in advance ... jr

__

PFISTER + PARTNER, SYSTEM - ENGINEERING AG
Juerg Rietmann
Grundstrasse 22a
6343 Rotkreuz
Switzerland

internet  :  www.pup.ch
phone   : +4141 790 4040
fax : +4141 790 2545
mobile: +4179 211 0315
__



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html