Tdolphin Subselects
Posted: Fri Nov 18, 2011 4:27 am
Cuando hago una consulta con subselects en tdolphin esta funciona bien, pero cuando quiero cambiar la condicion con SetWhere, no cambia la condicion del query principal sin o la del subquery lo cual me produce un error.
Slds
Code: Select all
SELECT cl.nomcla AS clase,c.codbuq as buque,c.codbuq,c.certif, c.certif AS codigo,
m.nomcer AS certificado, c.expedi AS expide, c.vencim AS vence ,c.vencim,
c.id ,m.tven,m.aplicav,diasven,m.tiempoven,
( select fechaven from ventanas v where c.codbuq=v.codbuq and c.certif=v.codcer and ejecutada = 0 order by v.fechaven limit 1 ) as fventana
FROM certifi c
INNER JOIN macerti m ON m.codcer = c.certif
INNER JOIN clascert cl ON cl.codcla = m.grupo
WHERE [b]c.codbuq ='000016' and c.tipo='B'[/b] ORDER BY c.certif,id
Application
===========
Path and name: C:\ProyectosFW\Buques\bin\Sistema_Buques.exe (32 bits)
Size: 4,346,368 bytes
Time from start: 0 hours 0 mins 18 secs
Error occurred at: 2011.11.17, 23:14:15
Error description: Error MYSQL/1054 Unknown column 'c.codbuq' in 'where clause'
Stack Calls
===========
Called from: .\source\prg\tdolpsrv.prg => DOLPHIN_DEFERROR(2592)
Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:CHECKERROR(700)
Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:SQLQUERY(1814)
Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:LOADQUERY(1101)
Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:SETNEWFILTER(1533)
Called from: .\source\prg\tdolpqry.prg => (b)TDOLPHINQRY(232)
Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:SETWHERE(0)
Called from: flota.prg => TFLOTA:CARGAR(216)
Called from: flota.prg => (b)TFLOTA_EDITAR(546)
Called from: flota.prg => (b)TFLOTA_EDITAR(556)
Called from: Recursosn.prg => (b)_BARRACOM_MENU(1781)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(466)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(663)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONDOWN(603)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1517)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1458)
Called from: .\source\classes\WINDOW.PRG => _FWH(3418)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(275)
Called from: flota.prg => TFLOTA:EDITAR(591)
Called from: buques.prg => (b)MAIN(57)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(466)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(663)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONDOWN(603)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1517)
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1458)
Called from: .\source\classes\WINDOW.PRG => _FWH(3418)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(993)
Called from: buques.prg => MAIN(90)
System
======
CPU type: Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz 2533 Mhz
Hardware memory: -200 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Compiler version: Harbour 3.1.0dev (Rev. 17025)
Windows version: 6.1, Build 7601 Service Pack 1
Variables in use
================
Procedure Type Value
==========================
DOLPHIN_DEFERROR
Param 1: O Class: ERROR
TDOLPHINSRV:CHECKERROR
Param 1: O Class: TDOLPHINSRV
Param 2: N 1054
Param 3: L .F.
Param 4: C ""
Local 1: C ""
Local 2: O Class: ERROR
TDOLPHINSRV:SQLQUERY
Local 1: N 1054
Local 2: U
Local 3: L .F.
TDOLPHINQRY:LOADQUERY
Param 1: C "SELECT fechaven FROM ventanas v WHERE [b]c.codbuq ='000016' and c.tipo='B' ORDER BY [/b]v.fechaven"
Local 1: N 93
Local 2: N 1
TDOLPHINQRY:SETNEWFILTER
Param 1: L .F.
Local 1: O Class: TDOLPHINSRV
Local 2: C "SELECT fechaven FROM ventanas v WHERE [b]c.codbuq ='000016' and c.tipo='B' [/b]ORDER BY v.fechaven"
Local 3: U
Local 4: U
Local 5: L .F.
(b)TDOLPHINQRY
Param 1: N 1
Param 2: C " c.codbuq ='000016' and c.tipo='B' "
Param 3: L .T.
Local 1: C "c.codbuq = v.codbuq and c.certif = v.codcer and ejecutada = 0"
Local 2: L .T.
TDOLPHINQRY:SETWHERE
Param 1: O Class: TDOLPHINQRY
Param 2: C " c.codbuq ='000016' and c.tipo='B' "
Local 1: U
TFLOTA:CARGAR
Param 1: C " c.codbuq ='000016' and c.tipo='B' "
(b)TFLOTA_EDITAR
(b)TFLOTA_EDITAR
(b)_BARRACOM_MENU
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TBTNBMP:LBUTTONDOWN
Param 1: N 8
Param 2: N 25
Local 1: U
Local 2: L .T.
TCONTROL:HANDLEEVENT
Param 1: N 8
Param 2: N 25
Param 3: N 1
TBTNBMP:HANDLEEVENT
Param 1: N 513
Param 2: N 1
Param 3: N 524313
Local 1: U
_FWH
Param 1: N 513
Param 2: N 1
Param 3: N 524313
DIALOGBOX
Param 1: N 524313
Param 2: N 513
Param 3: N 1
Param 4: N 524313
Param 5: N 114
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "FOLDBUQ2"
Param 3: N 2885662
Param 4: O Class: TDIALOG
TFLOTA:EDITAR
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: B {|| ... }
Param 8: U
Param 9: U
Param 10: L .F.
Param 11: L .F.
Local 1: N 2885662
Local 2: S
Local 3: O Class: TDIALOG
(b)MAIN
Local 1: L .F.
Local 2: U
Local 3: O Class: TFLOTA
Local 4: O Class: TDIALOG
Local 5: O Class: TXBROWSE
Local 6: A Len: 70
Local 7: O Class: TMENU
Local 8: O Class: TFLOTA
Local 9: B {|| ... }
Local 10: B {|| ... }
Local 11: B {|| ... }
Local 12: B {|| ... }
Local 13: B {|| ... }
Local 14: B {|| ... }
Local 15: B {|| ... }
Local 16: B {|| ... }
Local 17: B {|| ... }
Local 18: B {|| ... }
Local 19: O Class: TBAR
Local 20: A Len: 3
Local 21: A Len: 10
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TBTNBMP:LBUTTONDOWN
Param 1: N 39
Param 2: N 26
Local 1: U
Local 2: L .T.
TCONTROL:HANDLEEVENT
Param 1: N 39
Param 2: N 26
Param 3: N 1
TBTNBMP:HANDLEEVENT
Param 1: N 513
Param 2: N 1
Param 3: N 2555930
Local 1: U
_FWH
Param 1: N 513
Param 2: N 1
Param 3: N 2555930
WINRUN
Param 1: N 2555930
Param 2: N 513
Param 3: N 1
Param 4: N 2555930
Param 5: N 4
Local 1: O Class: TBTNBMP
TMDIFRAME:ACTIVATE
Param 1: N 2885662
MAIN
Param 1: C "MAXIMIZED"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: B {|| ... }
Param 7: U
Param 8: B {|| ... }
Param 9: U
Param 10: U
Param 11: U
Param 12: U
Param 13: U
Param 14: U
Param 15: U
Param 16: U
Param 17: B {|| ... }
Param 18: U
Param 19: U
Local 1: O Class: TMDIFRAME
Local 2: U
Local 3: U
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX
DataBases in use
================
Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TBRUSH
5 TWINDOW
6 TMDIFRAME
7 TMENU
8 TMENUITEM
9 TCONTROL
10 TICON
11 TMDICLIENT
12 TFONT
13 TBAR
14 TRECT
15 TBTNBMP
16 TMSGBAR
17 TMSGITEM
18 TTIMER
19 TBITMAP
20 TDIALOG
21 TDOLPHINSRV
22 TDOLPHINQRY
23 TGET
24 GET
25 TCLIPGET
26 TBUTTON
27 TDOLPHINROW
28 TTRAYICON
29 TSTRUCT
30 TFLOTA
31 TFOLDEREX
32 TCOMBOBOX
33 TMULTIGET
34 TIMAGE
35 TXBROWSE
36 TXBRWCOLUMN
37 TBUTTONBMP
38 TSCROLLBAR
39 TCURSOR
40 TWBROWSE
41 TCBROWSE
42 TCCOLUMN
43 TREG32
Memory Analysis
===============
375 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
Slds