FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour MySQL Tablas Temporales
Posts: 344
Joined: Sat Jul 22, 2006 09:04 PM
MySQL Tablas Temporales
Posted: Fri Apr 23, 2021 08:34 PM
Hola buenas tardes foro, tengo funcionando hace bastante este código para crear las tablas temporales a través de Dolphin, hace unos dias me empezo a dar error

Code (fw): Select all Collapse
Application
===========
   Path and name: H:\DolphinCli\UOMCentroMedico\menu.exe (32 bits)
   Size: ********* bytes
   Compiler version: Harbour 3.2.0dev (r1801051438)
   FiveWin  version: FWH 21.01
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 5 secs 
   Error occurred at: 23/04/2021, 17:21:21
   Error description: Error TDOLPHIN/9012  Internal Error:Invalid Field name "tipo_parentescotitular"


Stack Calls
===========
   Called from: .\source\prg\tdolpsrv.prg => DOLPHIN_DEFERROR( 2807 )
   Called from: .\source\prg\tdolpsrv.prg => TDOLPHINSRV:CHECKERROR( 793 )
   Called from: .\source\prg\tdolpqry.prg => (b)TDOLPHINQRY( 133 )
   Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:CHECKERROR( 0 )
   Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:FIELDPOS( 628 )
   Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:FIELDTONUM( 708 )
   Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:FIELDGET( 552 )
   Called from: .\source\prg\tdolpqry.prg => TDOLPHINQRY:TIPO_PARENTESCOTITULAR( 1779 )
   Called from: .\classPacientes.prg => (b)TPACIENTES_INTERFASE( 2351 )


adjunto parte del prg

Code (fw): Select all Collapse
            cQuery := [CREATE TEMPORARY TABLE ]+cTable+[ ]+;
                              [ ( id                                    int(11) NOT NULL auto_increment, ] +;
                              [   id_gf                                 int(11),              ] +;
                              [   id_paciente                           int(11),              ] +;
                              [   documento_tipo                        bigint(1),            ] +;
                              [   documento_numero                      DECIMAL(11),          ] +;
                              [   s_exo                                  bigint(1),            ] +;
                              [   apellidoynombre                       VARCHAR(100),         ] +;
                              [   fecha_nacimiento                      DATE,                 ] +;
                              [   tipo_parentescoTitular                bigint(2),            ] +;
                              [   Plan_Materno_Embarazo                 tinyint(1),           ] +;
                              [   Plan_Materno_Embarazo_FecInicio       date,                 ] +;
                              [   Plan_Materno_Embarazo_FecFin          date,                 ] +;
                              [   Plan_Materno_Recien_Nacido            tinyint(1),           ] +;
                              [   Plan_Materno_Recien_Nacido_FecInicio  date,                 ] +;
                              [   Plan_Materno_Recien_Nacido_FecFin     date,                 ] +;
                              [   Discapacidad_FecInicio                date,                 ] +;
                              [   Discapacidad_FecFin                   date,                 ] +;
                              [   estado                                VARCHAR(10),          ] +;
                              [   motivo_baja                           VARCHAR(100),         ] +;
                              [   abm                                   VARCHAR(1),           ] +;
                              [ PRIMARY KEY  (`id`),                                          ] +;
                              [ UNIQUE KEY `id` (`id`) )                                      ]

            oServer:Execute( "DROP TEMPORARY TABLE IF EXISTS " + cTable )
            if ( oServer:lError )
               RETURN NIL
            Endif
            oServer:Execute( cQuery )
            if ( oServer:lError )
               RETURN NIL
            Endif
            // CREO TABLA TEMPORAL DEL TICKET
            cQryGF:="SELECT * FROM " + cTable
            DEFINE QUERY oSelf:oQryGF cQryGF


Agradezco cualquier ayuda.
FWH - Harbour - BCC7 - PellesC
Posts: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: MySQL Tablas Temporales
Posted: Fri Apr 23, 2021 11:18 PM

Bueno me auto respondo, he vuelto a un a copia del prg anterior ya que si antes funcionaba porque no ahora.
Lo único que tuve que limitar el largo del nombre de la tabla temporal.
Saludos

FWH - Harbour - BCC7 - PellesC
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: MySQL Tablas Temporales
Posted: Tue Apr 27, 2021 08:08 PM
Not correct
Code (fw): Select all Collapse
[CREATE TEMPORARY TABLE ]+cTable


Correct:
Code (fw): Select all Collapse
[CREATE TEMPORARY ]+cTable


Note:
Maximum length of field name is 64
Regards



G. N. Rao.

Hyderabad, India
Posts: 344
Joined: Sat Jul 22, 2006 09:04 PM
Re: MySQL Tablas Temporales
Posted: Tue Apr 27, 2021 08:44 PM

Muchas gracias Mr. Rao por la corrección.
Saludos desde Argentina.

FWH - Harbour - BCC7 - PellesC

Continue the discussion