Error al grabar con tDolphin (Solucionado)

Post Reply
caducca
Posts: 106
Joined: Wed Mar 08, 2006 2:24 pm

Error al grabar con tDolphin (Solucionado)

Post by caducca »

Cuando quiero grabar en una tabla temporal me arroja el siguiente error:

[img]

[/img]
Como hago para subir imagenes?


Este es el código para crear la tabla temporal:

Code: Select all

  oServer:Execute("";
  + "CREATE TEMPORARY TABLE IF NOT EXISTS temp_item";
  +"( `id` int(11) NOT NULL AUTO_INCREMENT, ";
  +"`codarti` varchar(13) COLLATE latin1_spanish_ci DEFAULT NULL,";
  +"`detalle` varchar(40) COLLATE latin1_spanish_ci DEFAULT NULL,";
  +"`cantidad` decimal(10,2) DEFAULT '0.00',";
  +"`precio` decimal(10,2) DEFAULT '0.00',";
  +"`desc` decimal(8,2) DEFAULT '0.00',";
  +"`precio2` decimal(10,2) DEFAULT '0.00',";
  +"`pretotal` decimal(10,2) DEFAULT '0.00',";
  +"`precosto` decimal(10,2) DEFAULT '0.00',";
  +"`preusa` decimal(10,2) DEFAULT '0.00',";
  +"`linea` int(3) DEFAULT '0',";
  +"`codartp` varchar(20) COLLATE latin1_spanish_ci DEFAULT NULL,";
  +"PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci")
y aquí me da el error:

Code: Select all

FUNCTION GrabaLinea(lAp)

 If lAp
    oQryTemI:lAppend := .T.
 EndIf
 oQryTemI:Linea:=nLinea

 TRY
//    oQryTemI:lNuevo:=1
    nLinea+=1
    oQryTemI:Save()
    oQryTemI:Refresh()
    CATCH oError
       MsgStop("Error al grabar..."+CHR(10)+oError:description,"Error")
       lSave :=.F.
 END TRY

Return(.T.)
 
Last edited by caducca on Sun Aug 18, 2019 3:58 pm, edited 1 time in total.
User avatar
joseluisysturiz
Posts: 2024
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela
Contact:

Re: Error al grabar con tDolphin

Post by joseluisysturiz »

Saludos, cual error te esta dando.?, quita el TRY un momento para que te cree el LOG de error y asi puedas postearlo para tener idea de lo que pasa, gracias... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
caducca
Posts: 106
Joined: Wed Mar 08, 2006 2:24 pm

Re: Error al grabar con tDolphin

Post by caducca »

Este es el error:


Application
===========
Path and name: C:\DISCO-D\PROGRAMS\VENTASQL\VentaSQL.exe (32 bits)
Size: 4,299,776 bytes
Compiler version: Harbour 3.2.0dev (r1801051438)
FiveWin version: FWH 17.05
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows version: 6.2, Build 9200

Time from start: 0 hours 0 mins 14 secs
Error occurred at: 16/08/2019, 12:55:31
Error description: Error MYSQL/1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'desc=0.00,precio2=0.00,pretotal=0,precosto=0,preusa=0,linea=1,codartp=NULL' at line 1

Stack Calls
===========
Called from: .\source\prg\tdolpsrv.prg => DOLPHIN_DEFERROR( 2807 )
Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:CHECKERROR( 793 )
Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:SQLQUERY( 2024 )
Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:SAVE( 1456 )
Called from: c:\disco-d\programs\ventasql\prgh\Remitos.prg => GRABALINEA( 411 )
Called from: c:\disco-d\programs\ventasql\prgh\Remitos.prg => (b)EDITREMI( 371 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 683 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 919 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1866 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: c:\disco-d\programs\ventasql\prgh\Remitos.prg => EDITREMI( 378 )
Called from: c:\disco-d\programs\ventasql\prgh\Remitos.prg => (b)CARREMITOS( 269 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK( 683 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP( 919 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT( 1866 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => DIALOGBOX( 0 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 296 )
Called from: c:\disco-d\programs\ventasql\prgh\Remitos.prg => CARREMITOS( 303 )
Called from: c:\disco-d\programs\ventasql\prgh\Ventas.prg => (b)MAIN( 91 )
Called from: .\source\classes\MENU.PRG => TMENU:ACTIVATE( 1350 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 883 )
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1721 )
Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1575 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1036 )
Called from: c:\disco-d\programs\ventasql\prgh\Ventas.prg => MAIN( 356 )

System
======
CPU type: Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz 2400 Mhz
Hardware memory: 3991 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Windows total applications running: 6
1 ,
2 , C:\DISCO-D\PROGRAMS\VENTASQL\VentaSQL.exe
3 , C:\WINDOWS\System32\shcore.dll
4 , C:\WINDOWS\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.17134.950_none_42eadaf
5 DDE Server Window, C:\WINDOWS\System32\OLE32.DLL
6 G, C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.17134.950_none_73d5cde39f7876b

Variables in use
================
Procedure Type Value
==========================
DOLPHIN_DEFERROR
Param 1: O Class: ERROR
TDOLPHINSRV:CHECKERROR
Param 1: O Class: TDOLPHINSRV
Param 2: N 1064
Param 3: L .F.
Param 4: C ""
Local 1: C ""
Local 2: O Class: ERROR
TDOLPHINSRV:SQLQUERY
Local 1: N 1064
Local 2: U
Local 3: L .F.
TDOLPHINQRY:SAVE
Param 1: C "INSERT INTO temp_item SET id=0,codarti='010001007',detalle='BATERIA YB2.5L-C YUASA',cantidad=1.00,precio=0,desc=0.00,precio2=0.00,pretotal=0,precosto=0,preusa=0,linea=1,codartp=NULL"
Local 1: N 181
Local 2: N 1
GRABALINEA
Local 1: C "temp_item"
Local 2: U
Local 3: C "INSERT INTO temp_item SET id=0,codarti='010001007',detalle='BATERIA YB2.5L-C YUASA',cantidad=1.00,precio=0,desc=0.00,precio2=0.00,pretotal=0,precosto=0,preusa=0,linea=1,codartp=NULL"
Local 4: C " "
Local 5: U
Local 6: L .T.
Local 7: L .F.
Local 8: U
(b)EDITREMI
Param 1: L .T.
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 20
Param 2: N 26
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1310746
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 1310746
DIALOGBOX
Param 1: N 1310746
Param 2: N 514
Param 3: N 0
Param 4: N 1310746
Param 5: N 101
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "DATOSITEM2"
Param 3: N 1183684
Param 4: O Class: TDIALOG
EDITREMI
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Local 1: N 1183684
Local 2: S
Local 3: O Class: TDIALOG
(b)CARREMITOS
Param 1: L .T.
Param 2: C "E"
Param 3: L .T.
TBTNBMP:CLICK
Param 1: O Class: TBTNBMP
TBTNBMP:LBUTTONUP
TCONTROL:HANDLEEVENT
Param 1: N 30
Param 2: N 28
Param 3: N 0
Local 1: L .T.
Local 2: N 0
Local 3: S
TBTNBMP:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 1966108
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 1966108
DIALOGBOX
Param 1: N 1966108
Param 2: N 514
Param 3: N 0
Param 4: N 1966108
Param 5: N 86
Local 1: O Class: TBTNBMP
TDIALOG:ACTIVATE
Param 1: N 4194304
Param 2: C "CARGAREMI"
Param 3: N 658860
Param 4: O Class: TDIALOG
CARREMITOS
Param 1: U
Param 2: U
Param 3: U
Param 4: L .T.
Param 5: U
Param 6: L .T.
Param 7: U
Param 8: U
Param 9: U
Param 10: U
Param 11: U
Local 1: N 658860
Local 2: S
Local 3: O Class: TDIALOG
(b)MAIN
Param 1: C "E"
Local 1: L .F.
Local 2: L .F.
Local 3: L .T.
TMENU:ACTIVATE
Param 1: O Class: TMENUITEM
TRBTN:LBUTTONUP
Param 1: N 66
Param 2: N 145
Param 3: O Class: TRBGROUP
Param 4: L .F.
Local 1: N 0
Local 2: A Len: 2
TCONTROL:HANDLEEVENT
Param 1: N 8
Param 2: N 58
Param 3: N 0
Local 1: L .T.
Local 2: L .T.
Local 3: S
TRBTN:HANDLEEVENT
Param 1: N 514
Param 2: N 0
Param 3: N 524346
Local 1: U
_FWH
Param 1: N 514
Param 2: N 0
Param 3: N 524346
WINRUN
Param 1: N 524346
Param 2: N 514
Param 3: N 0
Param 4: N 524346
Param 5: N 16
Local 1: O Class: TRBTN
TMDIFRAME:ACTIVATE
Param 1: N 658860
MAIN
Param 1: C "MAXIMIZED"
Param 2: U
Param 3: U
Param 4: U
Param 5: U
Param 6: U
Param 7: U
Param 8: U
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: U
Param 18: U
Param 19: U
Param 20: L .F.
Local 1: O Class: TMDIFRAME
Local 2: U
Local 3: U

Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFCDX
DBFNTX

DataBases in use
================

Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TFONT
5 TDOLPHINSRV
6 TMENU
7 TREG32
8 TMENUITEM
9 TWINDOW
10 TMDIFRAME
11 TBRUSH
12 TMDICLIENT
13 TCONTROL
14 TRIBBONBAR
15 TRPANEL
16 TRBGROUP
17 TRBTN
18 TQUICKACCESS
19 TMSGBAR
20 TRECT
21 TMSGITEM
22 TTIMER
23 TDOLPHINQRY
24 TDIALOG
25 TXBROWSE
26 TXBRWCOLUMN
27 TSAY
28 TGET
29 GET
30 TCLIPGET
31 TCHECKBOX
32 TBTNBMP
33 TSCROLLBAR
34 TCLIPBOARD
35 TBUTTON
36 TBUTTONBMP
37 TBAR
38 TSTRUCT

Memory Analysis
===============
395 Static variables

Dynamic memory consume:
Actual Value: 2752512 bytes
Highest Value: 2752512 bytes
FiveWiDi
Posts: 910
Joined: Mon Oct 10, 2005 2:38 pm

Re: Error al grabar con tDolphin

Post by FiveWiDi »

caducca wrote:Cuando quiero grabar en una tabla temporal me arroja el siguiente error:

[img]

[/img]
Como hago para subir imagenes?


Este es el código para crear la tabla temporal:

Code: Select all

  oServer:Execute("";
  + "CREATE TEMPORARY TABLE IF NOT EXISTS temp_item";
  +"( `id` int(11) NOT NULL AUTO_INCREMENT, ";
  +"`codarti` varchar(13) COLLATE latin1_spanish_ci DEFAULT NULL,";
  +"`detalle` varchar(40) COLLATE latin1_spanish_ci DEFAULT NULL,";
  +"`cantidad` decimal(10,2) DEFAULT '0.00',";
  +"`precio` decimal(10,2) DEFAULT '0.00',";
  +"`desc` decimal(8,2) DEFAULT '0.00',";
  +"`precio2` decimal(10,2) DEFAULT '0.00',";
  +"`pretotal` decimal(10,2) DEFAULT '0.00',";
  +"`precosto` decimal(10,2) DEFAULT '0.00',";
  +"`preusa` decimal(10,2) DEFAULT '0.00',";
  +"`linea` int(3) DEFAULT '0',";
  +"`codartp` varchar(20) COLLATE latin1_spanish_ci DEFAULT NULL,";
  +"PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_spanish_ci")
 [/code]
Creo que el NULL no le gusta,

prueba con  "`codartp` varchar(20) COLLATE latin1_spanish_ci DEFAULT '0',";

o con "`codartp` varchar(20) COLLATE latin1_spanish_ci DEFAULT 'Hola,";
Un Saludo
Carlos G.

FiveWin 19.06 + Harbour 3.2, BCC 7 Windows 10
caducca
Posts: 106
Joined: Wed Mar 08, 2006 2:24 pm

Re: Error al grabar con tDolphin

Post by caducca »

Hola Carlos G gracias por contestar, probé como me dijiste y nada.
caducca
Posts: 106
Joined: Wed Mar 08, 2006 2:24 pm

Re: Error al grabar con tDolphin (Solucionado)

Post by caducca »

Error mio, usaba un campo desc para garbar el descuento pero es una palabra reservada.
Disculpen a los que hice perder el tiempo con esta consulta, pero por ahí llega un momento que te nublas y es preferible parar, recostarte y la almohada te tira algunas pistas.
Gracias
User avatar
jvtecheto
Posts: 357
Joined: Mon Mar 04, 2013 4:32 pm
Location: Spain

Re: Error al grabar con tDolphin (Solucionado)

Post by jvtecheto »

[quote="caducca"]Cuando quiero grabar en una tabla temporal me arroja el siguiente error:

[img]

[/img]
Como hago para subir imagenes?

Mira, aqui esta explicado.

http://forums.fivetechsupport.com/view ... 6#p223256

Saludos

Jose.
Fwh 19.06 32 bits + Harbour 3.2dev(r2011030937)+ Borland 7.4 + FivEdit
Post Reply