Re: [SQL]

2003-03-21 Thread Stephan Szabo
On Fri, 21 Mar 2003, Mario Alberto Soto Cordones wrote: > CREATE or replace FUNCTION get_nombre(numeric,numeric,text) RETURNS setof > cumaalu AS ' > SELECT cunomalu,cuappalu,cuapmalu FROM cumaalu > WHERE siempalu = $1 and > cusesalu = $2 and > curutalu = $3; > ' LANGUAGE SQL; >

Re: [SQL] Diffcult query

2003-03-21 Thread Josh Berkus
Dan, > Hi folks. This is giving me fits. I feel like it oughta be simple, but > apparantly its not...I think. > I need a ( preferably single ) query that will sum the costs for all unique > pairs of codes, without regard to column order. That is, for summing > purposes, rows 1 and 3 are identical

[SQL]

2003-03-21 Thread Mario Alberto Soto Cordones
HI, i have a following function., but not work. CREATE or replace FUNCTION get_nombre(numeric,numeric,text) RETURNS setof cumaalu AS ' SELECT cunomalu,cuappalu,cuapmalu FROM cumaalu WHERE siempalu = $1 and cusesalu = $2 and curutalu = $3; ' LANGUAGE SQL; the error say Postgr

[SQL] Diffcult query

2003-03-21 Thread Dan Winslow
Hi folks. This is giving me fits. I feel like it oughta be simple, but apparantly its not...I think. Given a table : create table tablea ( code1 varchar(32), code2 varchar(32), costint ); and the rows code1code2cost -- "aaa""bbb"2 "d

[SQL] SQL

2003-03-21 Thread Sethi Tarun-ETS017
In SQL, how can I remove the newline characters from the value of a column? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])

[SQL] newline character in SQL

2003-03-21 Thread Sethi Tarun-ETS017
How can I remove the newline character from the value of a column. For Example: Select name, comments from table where comment like '%Fine%'; Results: NAMECOMMENTS John M. This was a Fine piece of work. Above, I'd like the Results to appear: NAME

[SQL] Rule for updating through a view.

2003-03-21 Thread Mike Meyer
Ok, I found the documentation on using views to udpate the underlying database. But I can't seem to get my head around making it actually work, because updates may change only a few columns, and the columns in my views come from multiple tables. Could someone provide an example (CC'ing me, please,

[SQL] query 2 database

2003-03-21 Thread betty
hi... Can anybody help me, can't i make "query > 1 table in different database (but not schema)" in postgre 7.3? thanks betty ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command

[SQL] FUNCTIONS PROBLEM

2003-03-21 Thread Mario Alberto Soto Cordones
Hi. i have a function and i need to return 4 fields but not work, any idea , please thank mario ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Seeking help with a query....

2003-03-21 Thread Dan Winslow
Hi folks, seeking help with a query that I thought was simple, but apparantly isn't, at least for someone with my knowledge level. Given a table : create table atable ( code1 char, code2 char, costint ); And the rows code1code2cost - ab

Re: [SQL] cast of integer to bool doesn't work (anymore?)

2003-03-21 Thread Achilleus Mantzios
On Fri, 21 Mar 2003, Eric Veldhuyzen wrote: > On Fri, Mar 21, 2003 at 04:46:17PM -0200, Achilleus Mantzios wrote: > > > > Currently (7.3) all input can be handled if fed as text. > > So what you can do is simply: > > > > my $sth = $dbh->prepare( > > "INSERT INTO object_def (name, meant_as_

Re: [SQL] cast of integer to bool doesn't work (anymore?)

2003-03-21 Thread Eric Veldhuyzen
On Fri, Mar 21, 2003 at 04:46:17PM -0200, Achilleus Mantzios wrote: > > Currently (7.3) all input can be handled if fed as text. > So what you can do is simply: > > my $sth = $dbh->prepare( > "INSERT INTO object_def (name, meant_as_subobject) VALUES (?,?)"); > $sth->execute('test', '0');

Re: [SQL] explain

2003-03-21 Thread Rajesh Kumar Mallah
Dear Marian, in postgresql 7.3 explain commands retruns as set of rows. The result of EXPLAIN can just be fecthed as result of any other SELECT query and manipulated further. i hope it helps. sorry if i did not get ur problem rite. regds mallah. On Friday 21 Mar 2003 11:51 am, Popeanga