Hello,
I have a little problem
I want to declare a type record for later use like that
create type record_structure1 as (id int2, nume text);
that is ok!
next in a function I want to use something like that:
select * from table as record_structure1 ?
instead of writing
select * from table as t1(id
Yo can do s.t. similar, if the order in which you select the columns
corresponds to the order your type is defined.
So you'd gonna use: select intcol, textcol from table;
-Original Message-
From: Din Adrian [mailto:[EMAIL PROTECTED]
Sent: Montag, 17. Jänner 2005 13:31
To:
Hi,
coming from imperative programming paradigma, I'm currently trying to
express something like that in _SQL_:
It should be atomic and like an API for a user. I'm therefore writing
functions:
CRETE FUNC...
c := SELECT x,y,z FROM table_a WHERE...
IF COUNT(c)=1 then
INSERT / DELETE ...
KÖPFERL Robert wrote:
Hi,
coming from imperative programming paradigma, I'm currently trying to
express something like that in _SQL_:
SQL is not an imperative language - each SQL statement is an expression
to be evaluated.
It should be atomic and like an API for a user. I'm therefore writing
I have a single column result that I want to loop through using an
index. I also want to jump ahead in the result using the index (below:
i:=i+cluster_cnt-1;) . However, I'm getting the following error.
ERROR: syntax error at or near SELECT at character 9
CONTEXT: PL/pgSQL function gets_nooky
We just changed the postgresql server and got some
problem with sql command
in our old server we can exexute this query:
SELECT * FROM product WHERE prdtnumber =
''
field prdtnumberdata type
isintegerand the empty quote somehow
can be assumed into 0 (zero)
Now, if I use the same query
Yudie [EMAIL PROTECTED] writes:
Now, if I use the same query it return an error:
invalid input syntax for integer:
Anyone know what's the problem??
None. That's an intentional change. The fact that it ever accepted
'' as meaning 0 was a bug.
regards, tom lane
On Sat, 15 Jan 2005, Ari Kahn wrote:
CREATE FUNCTION gets_nooky() returns numeric AS
'
DECLARE
i integer;
gt1cnt record;
gt1 record;
cluster record;
cluster_cnt integer;
slocus integer;
minmax record;
BEGIN
SELECT INTO gt1 * FROM cgt1;
The problem is not stop there, I had a table that can't be updated since
then with this simply command:
update prdttable set webinclude = '0' where prdtnumber = '6002'
Again, the errors (invalid input syntax for integer: ) apears.
Then I found this temporary solution to make replica to this
Return only four rows beginning at second row:
SELECT count(*) AS count, name, year FROM a
GROUP BY name, year
ORDER BY count DESC, name ASC
LIMIT 4 OFFSET 1;
count name year
--- -- --
3 joe2004 s,e,e
2 bob2003 w,e
2 kim2003 s,s
2 sue
10 matches
Mail list logo