Como insertar datos de TXT en tabla de SQL
Publicado por Ray (2 intervenciones) el 27/08/2015 20:04:07
que tal amigos soy un completo novato en PB estoy utiizando PB9
lo que quiero es seleccionar un archivo txt y al aceptar insertarlo en una tabla
la tabla tiene los siguientes campos
tabla
idInterfaseIsom int
cuenta varchar(50)
referencia varchar(50)
EsAbono tinyint
Importe decimal(18, 2)
Concepto varchar(250)
idEstatus tinyint
Fecha smalldatetime
IdUsuario tinyint
FechaCaptura date
Nota: únicamente agrega los renglones que inicien con el codigo fijo = 'M'
Los campos en
idEstatus = por default el valor es 0
fecha = getdate()
idusuario = se refiere al usuario que captura
pantalla en la cual a partir de un archivo txt el cual anexo, cargues la información a la tabla 'InterfaseIngresosIsom' en la base de datos ContaIsom
y estos son los datos que tiene el archivo
P 20150826 1 1 0 ALGEBRAIX : 01/08/2015 - 26/08/2015 11 0 0
M 2008 0 20661.60 0 0.0 01/08/2015 : CAJA ISOM
M 21030001 ISOMF1 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100096 - Hernández Sandoval, David
M 21030001 ISOMF2 1 4500.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100088 - Díaz Santiago, Valeria Nadxieeli
M 21030001 ISOMF2 1 4500.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100089 - Díaz Santiago, Karol Jozef
M 21030001 ISOMF2 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100090 - Díaz Santiago, Oscar Daniel Michael
M 2102 ISOMV1 1 420.00 0 0.0 ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100089 - Díaz Santiago, Karol Jozef
M 11030001 ISOMV1 1 67.20 0 0.0 IVA : ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100089 - Díaz Santiago, Karol Jozef
M 2102 ISOMV1 1 420.00 0 0.0 ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100090 - Díaz Santiago, Oscar Daniel Michael
M 11030001 ISOMV1 1 67.20 0 0.0 IVA : ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100090 - Díaz Santiago, Oscar Daniel Michael
M 2102 ISOMV1 1 420.00 0 0.0 ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100088 - Díaz Santiago, Valeria Nadxieeli
M 11030001 ISOMV1 1 67.20 0 0.0 IVA : ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100088 - Díaz Santiago, Valeria Nadxieeli
M 2008 0 12000.00 0 0.0 03/08/2015 : CAJA ISOM
M 21030001 ISOMF20 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100069 - Portilla Amarillas, Diego
M 21030001 ISOMF20 1 5625.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100070 - Portilla Amarillas, Paulina
M 2008 0 17220.00 0 0.0 04/08/2015 : CAJA ISOM
M 21030001 ISOMF3 1 4125.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100125 - Ibarra González, Felipe Gael
M 21030001 ISOMF4 1 3360.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100099 - Millán Rodríguez, Catalina
M 21030001 ISOMF4 1 3360.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100100 - Millán Rodríguez, Natalia
M 21030001 ISOMF21 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100076 - López Esquer, Santiago
M 2008 0 39075.00 0 0.0 05/08/2015 : CAJA ISOM
M 21030001 ISOMF5 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100080 - Betancourt García, Annette Paulina
M 21030001 ISOMF6 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100079 - Betancourt García, Fernando
M 21030001 ISOMF7 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100074 - Romo Monroy, Luciana Isabella
M 21030001 ISOMF7 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100075 - Romo Monroy, Alan Michel
M 21030001 ISOMF8 1 5625.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100077 - Ruiz Guerra, Diego Rafael
M 21030001 ISOMF9 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100120 - Gibbs Alemán, Elsie Cecilia
M 21030001 ISOMF9 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100119 - Gibbs Aleman, Walton Oswaldo
M 2008 0 14235.00 0 0.0 06/08/2015 : CAJA ISOM
M 21030001 ISOMF22 1 3360.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100115 - Pérez Valdéz Robledo, Alan Iram
M 21030001 ISOMF23 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100071 - Olivieri di Vernier Zapata, Valentina
M 21030001 ISOMF23 1 5625.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100072 - Olivieri di Vernier Zapata, Gianluca
M 2008 0 16105.00 0 0.0 07/08/2015 : CAJA ISOM
M 21030001 ISOMF10 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100126 - Cuéllar Elizondo, Rubén Gerardo
M 21030001 ISOMF11 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100111 - Benavides Sánchez, Angela
M 21030001 ISOMF12 1 4480.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100073 - Gómez Arias, Noel Gustavo
M 2008 0 11200.00 0 0.0 10/08/2015 : CAJA ISOM
M 21030001 ISOMF13 1 5950.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100110 - Benavides Ríos, Andrea Sofía
M 21030001 ISOMF13 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100109 - Benavides Ríos, Diego Andrés
M 2008 0 6000.00 0 0.0 12/08/2015 : CAJA ISOM
M 21030001 ISOMF14 1 6000.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100123 - Favela Cantú, Sofía Carolina
M 2008 0 26325.00 0 0.0 14/08/2015 : CAJA ISOM
M 21030001 ISOMF15 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100131 - Flores Padilla, Edgar Alejandro
M 21030001 ISOMF16 1 6000.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100129 - Sánchez Dávila, Anna Victoria
M 21030001 ISOMF17 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100117 - Garza Martínez, Sandra Melissa
M 21030001 ISOMF18 1 4200.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100130 - Isida Estevané, Rogelio Benedicto
M 21030001 ISOMF19 1 4500.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100116 - Garza Martínez, Franco Humberto
M 2008 0 1100.00 0 0.0 18/08/2015 : CAJA ISOM
M ISOMV2 1 603.45 0 0.0 PLAN DE ALIMENTACION PREKINDER SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M 11030001 ISOMV2 1 96.55 0 0.0 IVA : PLAN DE ALIMENTACION PREKINDER SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M ISOMV2 1 142.24 0 0.0 PLAN DE ALIMENTACIÓN PRE-KINDER PROPORCIONAL AGOSTO SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M 11030001 ISOMV2 1 22.76 0 0.0 IVA : PLAN DE ALIMENTACIÓN PRE-KINDER PROPORCIONAL AGOSTO SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M ISOMV2 1 202.59 0 0.0 PLAN DE ALIMENTACION PREKINDER OCTUBRE 2015 - 100008 - Trigos Cantú, Mariana
M ISOMV2 1 32.41 0 0.0 IVA : PLAN DE ALIMENTACION PREKINDER OCTUBRE 2015 - 100008 - Trigos Cantú, Mariana
M 2008 0 5950.00 0 0.0 21/08/2015 : CAJA ISOM
M 21030001 ISOMF24 1 5950.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100143 - Flores González, Daniela
la verdad no se ni por donde empezar
espero puedan ayudarme
lo realizo en Tab y tabpg
lo que quiero es seleccionar un archivo txt y al aceptar insertarlo en una tabla
la tabla tiene los siguientes campos
tabla
idInterfaseIsom int
cuenta varchar(50)
referencia varchar(50)
EsAbono tinyint
Importe decimal(18, 2)
Concepto varchar(250)
idEstatus tinyint
Fecha smalldatetime
IdUsuario tinyint
FechaCaptura date
Nota: únicamente agrega los renglones que inicien con el codigo fijo = 'M'
Los campos en
idEstatus = por default el valor es 0
fecha = getdate()
idusuario = se refiere al usuario que captura
pantalla en la cual a partir de un archivo txt el cual anexo, cargues la información a la tabla 'InterfaseIngresosIsom' en la base de datos ContaIsom
y estos son los datos que tiene el archivo
P 20150826 1 1 0 ALGEBRAIX : 01/08/2015 - 26/08/2015 11 0 0
M 2008 0 20661.60 0 0.0 01/08/2015 : CAJA ISOM
M 21030001 ISOMF1 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100096 - Hernández Sandoval, David
M 21030001 ISOMF2 1 4500.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100088 - Díaz Santiago, Valeria Nadxieeli
M 21030001 ISOMF2 1 4500.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100089 - Díaz Santiago, Karol Jozef
M 21030001 ISOMF2 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100090 - Díaz Santiago, Oscar Daniel Michael
M 2102 ISOMV1 1 420.00 0 0.0 ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100089 - Díaz Santiago, Karol Jozef
M 11030001 ISOMV1 1 67.20 0 0.0 IVA : ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100089 - Díaz Santiago, Karol Jozef
M 2102 ISOMV1 1 420.00 0 0.0 ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100090 - Díaz Santiago, Oscar Daniel Michael
M 11030001 ISOMV1 1 67.20 0 0.0 IVA : ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100090 - Díaz Santiago, Oscar Daniel Michael
M 2102 ISOMV1 1 420.00 0 0.0 ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100088 - Díaz Santiago, Valeria Nadxieeli
M 11030001 ISOMV1 1 67.20 0 0.0 IVA : ESTANCIA MEDIO TIEMPO SEPTIEMBRE 2015 - 100088 - Díaz Santiago, Valeria Nadxieeli
M 2008 0 12000.00 0 0.0 03/08/2015 : CAJA ISOM
M 21030001 ISOMF20 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100069 - Portilla Amarillas, Diego
M 21030001 ISOMF20 1 5625.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100070 - Portilla Amarillas, Paulina
M 2008 0 17220.00 0 0.0 04/08/2015 : CAJA ISOM
M 21030001 ISOMF3 1 4125.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100125 - Ibarra González, Felipe Gael
M 21030001 ISOMF4 1 3360.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100099 - Millán Rodríguez, Catalina
M 21030001 ISOMF4 1 3360.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100100 - Millán Rodríguez, Natalia
M 21030001 ISOMF21 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100076 - López Esquer, Santiago
M 2008 0 39075.00 0 0.0 05/08/2015 : CAJA ISOM
M 21030001 ISOMF5 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100080 - Betancourt García, Annette Paulina
M 21030001 ISOMF6 1 5100.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100079 - Betancourt García, Fernando
M 21030001 ISOMF7 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100074 - Romo Monroy, Luciana Isabella
M 21030001 ISOMF7 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100075 - Romo Monroy, Alan Michel
M 21030001 ISOMF8 1 5625.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100077 - Ruiz Guerra, Diego Rafael
M 21030001 ISOMF9 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100120 - Gibbs Alemán, Elsie Cecilia
M 21030001 ISOMF9 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100119 - Gibbs Aleman, Walton Oswaldo
M 2008 0 14235.00 0 0.0 06/08/2015 : CAJA ISOM
M 21030001 ISOMF22 1 3360.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100115 - Pérez Valdéz Robledo, Alan Iram
M 21030001 ISOMF23 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100071 - Olivieri di Vernier Zapata, Valentina
M 21030001 ISOMF23 1 5625.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100072 - Olivieri di Vernier Zapata, Gianluca
M 2008 0 16105.00 0 0.0 07/08/2015 : CAJA ISOM
M 21030001 ISOMF10 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100126 - Cuéllar Elizondo, Rubén Gerardo
M 21030001 ISOMF11 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100111 - Benavides Sánchez, Angela
M 21030001 ISOMF12 1 4480.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100073 - Gómez Arias, Noel Gustavo
M 2008 0 11200.00 0 0.0 10/08/2015 : CAJA ISOM
M 21030001 ISOMF13 1 5950.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100110 - Benavides Ríos, Andrea Sofía
M 21030001 ISOMF13 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100109 - Benavides Ríos, Diego Andrés
M 2008 0 6000.00 0 0.0 12/08/2015 : CAJA ISOM
M 21030001 ISOMF14 1 6000.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100123 - Favela Cantú, Sofía Carolina
M 2008 0 26325.00 0 0.0 14/08/2015 : CAJA ISOM
M 21030001 ISOMF15 1 6375.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100131 - Flores Padilla, Edgar Alejandro
M 21030001 ISOMF16 1 6000.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100129 - Sánchez Dávila, Anna Victoria
M 21030001 ISOMF17 1 5250.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100117 - Garza Martínez, Sandra Melissa
M 21030001 ISOMF18 1 4200.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100130 - Isida Estevané, Rogelio Benedicto
M 21030001 ISOMF19 1 4500.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100116 - Garza Martínez, Franco Humberto
M 2008 0 1100.00 0 0.0 18/08/2015 : CAJA ISOM
M ISOMV2 1 603.45 0 0.0 PLAN DE ALIMENTACION PREKINDER SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M 11030001 ISOMV2 1 96.55 0 0.0 IVA : PLAN DE ALIMENTACION PREKINDER SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M ISOMV2 1 142.24 0 0.0 PLAN DE ALIMENTACIÓN PRE-KINDER PROPORCIONAL AGOSTO SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M 11030001 ISOMV2 1 22.76 0 0.0 IVA : PLAN DE ALIMENTACIÓN PRE-KINDER PROPORCIONAL AGOSTO SEPTIEMBRE 2015 - 100008 - Trigos Cantú, Mariana
M ISOMV2 1 202.59 0 0.0 PLAN DE ALIMENTACION PREKINDER OCTUBRE 2015 - 100008 - Trigos Cantú, Mariana
M ISOMV2 1 32.41 0 0.0 IVA : PLAN DE ALIMENTACION PREKINDER OCTUBRE 2015 - 100008 - Trigos Cantú, Mariana
M 2008 0 5950.00 0 0.0 21/08/2015 : CAJA ISOM
M 21030001 ISOMF24 1 5950.00 0 0.0 Colegiatura del periodo SEPTIEMBRE 2015 - 100143 - Flores González, Daniela
la verdad no se ni por donde empezar
espero puedan ayudarme
lo realizo en Tab y tabpg
Valora esta pregunta


0