Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z zapytaniej do bazy Oracle..., (column ambiguously defined)
loozaque
post 30.08.2006, 09:53:12
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 1
Dołączył: 12.02.2004

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


Witam,

Mam problem z zapytaniem do bazy oracle...

  1. $sql = "select a.ile_mam as ile_mam_0, b.ile_mam as ile_mam_1, c.ile_mam as ile_mam_3, d.ile_mam as ile_mam_4, e.ile_mam as ile_mam_8, f.ile_mam as ile_mam_40, g.ile_mam as ile_mam_50, h.ile_mam as ile_mam_100, i.ile_mam as ile_mam_150, j.ile_mam as ile_mam_200, k.ile_mam as ile_mam_400, l.ile_mam as ile_mam_450 FROM ht_rejna a, ht_rn001 b, ht_rn003 c, ht_rn004 d, ht_rn008 e, ht_rn040 f, ht_rn050 g, ht_rn100 h, ht_rn150 i, ht_rn200 j, ht_rn400 k, ht_rn450 l WHERE is_deleted='N' AND indeks='78000'";


przejrzyściej...

  1. $sql = "select a.ile_mam as ile_mam_0,
  2. b.ile_mam as ile_mam_1,
  3. c.ile_mam as ile_mam_3,
  4. d.ile_mam as ile_mam_4,
  5. e.ile_mam as ile_mam_8,
  6. f.ile_mam as ile_mam_40,
  7. g.ile_mam as ile_mam_50,
  8. h.ile_mam as ile_mam_100,
  9. i.ile_mam as ile_mam_150,
  10. j.ile_mam as ile_mam_200,
  11. k.ile_mam as ile_mam_400,
  12. l.ile_mam as ile_mam_450
  13. FROM ht_rejna a,
  14. ht_rn001 b,
  15. ht_rn003 c,
  16. ht_rn004 d,
  17. ht_rn008 e,
  18. ht_rn040 f,
  19. ht_rn050 g,
  20. ht_rn100 h,
  21. ht_rn150 i,
  22. ht_rn200 j,
  23. ht_rn400 k,
  24. ht_rn450 l WHERE is_deleted='N' AND indeks='78000'";


Zwracany komunikat:

  1. Warning:  ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-00918: column ambiguously defined
  2. in /home/webmaster/www/temp/oracle.php on line 56
  3.  
  4.  
  5. Warning:  ocifetchinto() [function.ocifetchinto]: OCIFetchInto: ORA-24374: define not done before fetch or execute and fetch
  6. in /home/webmaster/www/temp/oracle.php on line 57


Nie wiem co jest niejednoznacznego w tym blinksmiley.gif

* Jest to sprawdzanie stanów magazynowych na poszczególnych magazynach, stąd zmiana nazw kolum, aby się nie dublowały - nie wiem czy to dobrze zrobiłem sad.gif jestem początkującym....


--------------------
pozdr.
Tomek
Go to the top of the page
+Quote Post
SongoQ
post 30.08.2006, 11:54:47
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 923
Pomógł: 9
Dołączył: 25.10.2004
Skąd: Rzeszów - studia / Warszawa - praca

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


W where wstaw nazwy tabel, brakuje Ci w where zlaczen tabel.


--------------------
Go to the top of the page
+Quote Post
loozaque
post 30.08.2006, 12:22:54
Post #3





Grupa: Zarejestrowani
Postów: 17
Pomógł: 1
Dołączył: 12.02.2004

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


Cytat(SongoQ @ 30.08.2006, 12:54:47 ) *
W where wstaw nazwy tabel, brakuje Ci w where zlaczen tabel.


Dzięki wielkie, nie wiem jak to przeoczyłem, przecież to było oczywiste... angrysmiley.gif


--------------------
pozdr.
Tomek
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.07.2025 - 20:14