Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> zwracanie typu record, dwa pytania o record
zalew
post
Post #1





Grupa: Zarejestrowani
Postów: 407
Pomógł: 0
Dołączył: 24.10.2002
Skąd: warszawa

Ostrzeżenie: (0%)
-----


  1. CREATE OR REPLACE FUNCTION "public"."test_recordu" () RETURNS "pg_catalog"."record" AS'
  2. select * from users where id=''1''
  3. 'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;

  1. SELECT * FROM test_recordu()

Cytat
ERROR:  a column definition list is required for functions returning "record"


1.
co mam zrobic zeby mi zwrocilo poprawny rekord?

2.
dlaczego w 'ems postgres manager' nie mam na liscie typpow typu RECORD tylko dopiero gdzies na liscie dalej pg_calagog.rozne_takietam i w nich record?

na oba pytania szukalem oczywiscie odp po sieci z marnym skutkiem..

Ten post edytował zalew 23.06.2004, 23:21:49
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
zalew
post
Post #2





Grupa: Zarejestrowani
Postów: 407
Pomógł: 0
Dołączył: 24.10.2002
Skąd: warszawa

Ostrzeżenie: (0%)
-----


hmm dokladnie to co wyzje napisalem czyli komunikat
Cytat
ERROR:  a column definition list is required for functions returning "record"

i nic nie zwraca.. sam error

oczywiscie dodam na wszleki wypadek, ze w tabeli jest kilka rekorodw, nazwa sie zgadza itp, coby nie bylo (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

z tresci bledu mozna wnioskowac, ze baza chca aby rekord mial zdefiniowane kolumny, ale
a. nie wiem jak to zrobic
b. nigdzie w dokumentacjach tego nie moge znalezc ani w sieci
c. zaden z przykladow jakie widzialem w sieci nic takiego nie mial
tzn probowalem "into rec.login, rec.pass" bo takie cos tez widzailem w przykladach ale nici z tego :/ to samo :/



///edit
cholerka.. chyba mam :/

7.4 docs
http://www.postgresql.org/docs/7.4/interac...clarations.html
Cytat
One should also realize that when a PL/pgSQL function is declared to return type record, this is not quite the same concept as a record variable, even though such a function may well use a record variable to hold its result. In both cases the actual row structure is unknown when the function is written, but for a function returning record the actual structure is determined when the calling query is parsed, whereas a record variable can change its row structure on-the-fly.


7.2 docs
http://www.postgresql.org/docs/7.2/interac...clarations.html
Cytat
Thus, for example, one cannot declare a function returning RECORD.


czyli po prostu nie moge zwrocic rekordu w 7.2 podczas gdy 7.4 robi tak jak powinno czyli w locie zapisuje record tak jak myslalem... :/

Ten post edytował zalew 24.06.2004, 17:28:12
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 12.10.2025 - 13:08