Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Problem z zapytaniej do bazy Oracle...
Forum PHP.pl > Forum > Bazy danych > Oracle
loozaque
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....
SongoQ
W where wstaw nazwy tabel, brakuje Ci w where zlaczen tabel.
loozaque
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
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.