Unix Programming - to transform .vbs to .ksh

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2004 > to transform .vbs to .ksh





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author to transform .vbs to .ksh
Israel Moreno

2004-11-25, 7:50 am

hi everybody,

i have a problem. i need to transform a VisualBasicScript to
KornShellScript and i don't know nothing about ksh. this is the
script.

'On Error Resume Next

PAMEP = "Provider=MSDAORA; Data Source=pamep.world; User
ID=Portabilidad; Password=APOR2000;"
GESTSAPR = "Provider=MSDAORA; Data Source=apnetp.world; User
ID=aserser_prd; Password=aserser_prd;"

'MsgBox("Empiezo")

Function fct_concero(variable)

if variable < 9 then variable = "0" & variable
fct_concero = variable


end function

dim idref(5000),idref2(5000),cont(5000), altas(10) , bajas (10),
num_incidencias(500),desc_incidencias(50
0)
dim evento(50)
,tipoalta(10),tipobaja(10),fecha_inciden
cias(500),oper_incidencias(500)
dim num_alta(500),tipo_alta(500), fecha_alta(500),oper_alta(500),
num_baja(500),tipo_baja(500),fecha_baja(
500)
Dim fecha_alta_confirmada(500),altas_confirm
adas(500),
altas_portadas(500),tipo_flujo(500)
Dim fecha_bajas_confirmada(500),bajas_confir
madas(500),
bajas_portadas(500),bajas_tipo_flujo(500
)
Dim fecha_errores(500), errores_portabilidad(500),
errores_fventana(500), sgp_tipo_flujo(500), sgp_textoerror(500)
Dim fecha_erroresFV(500), errores_portabilidadFV(500),
errores_fventanaFV(500), sgp_tipo_flujoFV(500), sgp_textoerrorFV(500)
Dim fechaAltasFV(500),NumeroAltasFV(500), TipoAltasFV(500)
Dim fechaBajasFV(500),NumeroBajasFV(500), TipoBajasFV(500)
ret = "<br>"
Set con = WScript.CreateObject("ADODB.Connection")
con.Open PAMEP




' Consulta de Bajas realizadas

sql3= " select to_date(tpa_cab.FCHVCOR,'dd/mm/yy') as fecha,
count(TPA_DATNUM.MSISDN) as numero, "
sql3=sql3 & " decode(tpa_cab.TIPABO, '0', 'POSTPAGO', '1', 'PREPAGO')
as tipo "
sql3=sql3 & " from tpa_cab , TPA_DATNUM "
sql3=sql3 & " where tpa_cab.IDESTSOL = 'APOR' "
sql3=sql3 & " and to_date (tpa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy') "
sql3=sql3 & " and tpa_cab.IDTPA_CAB=tpa_datnum.IDTPA_CAB "
sql3=sql3 & " and to_char(tpa_cab.FCHEST, 'HH24') <= '05' "
sql3=sql3 & " group by to_date(tpa_cab.FCHVCOR,'dd/mm/yy'), "
sql3=sql3 & " decode( tpa_cab.TIPABO, '0', 'POSTPAGO', '1',
'PREPAGO') "

' Consulta de Altas confirmadas-finalizadas

sql4 = " Select to_date(sysdate,'dd/mm/yy')as fecha ,
count(tsa_cab.IDTSA_CAB) as numero, "
sql4 = sql4 & " DECODE(tsa_cab.modpago, '0', 'POSTPAGO', '1',
'PREPAGO') as tipo "
sql4 = sql4 & " from tsa_cab , TSA_DATNUM"
sql4 = sql4 & " where tsa_cab.IDESTSOLPRI in ('APOR', 'ACON')"
sql4 = sql4 & " and to_date (tsa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy')"
sql4 = sql4 & " and tsa_cab.IDTSA_CAB=tsa_datnum.IDTSA_CAB"
sql4 = sql4 & " and to_date (tsa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy')"
sql4 = sql4 & " group by DECODE(tsa_cab.modpago, '0',
'POSTPAGO', '1', 'PREPAGO')"




' Consulta de Bajas confirmadas-finalizadas

sql5 = " select to_date(tpa_cab.FCHVCOR,'dd/mm/yy') as
fecha, count(TPA_DATNUM.MSISDN) as numero,"
sql5 = sql5 & " decode(tpa_cab.TIPABO, '0', 'POSTPAGO', '1',
'PREPAGO') as tipo"
sql5 = sql5 & " from tpa_cab , TPA_DATNUM"
sql5 = sql5 & " where tpa_cab.IDESTSOL in ('APOR', 'ACON')"
sql5 = sql5 & " and to_date (tpa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy')"
sql5 = sql5 & " and tpa_cab.IDTPA_CAB=tpa_datnum.IDTPA_CAB"
sql5 = sql5 & " group by to_date(tpa_cab.FCHVCOR,'dd/mm/yy'),"
sql5 = sql5 & " decode( tpa_cab.TIPABO, '0', 'POSTPAGO', '1',
'PREPAGO')"


'Consulta de Altas portadas

sql6 = " select to_date(sysdate,'dd/mm/yy')as fecha ,
count(tsa_cab.IDTSA_CAB) as numero,"
sql6 = sql6 & " DECODE(tsa_cab.modpago, '0', 'POSTPAGO', '1',
'PREPAGO') as tipo"
sql6 = sql6 & " from tsa_cab , TSA_DATNUM"
sql6 = sql6 & " where tsa_cab.IDESTSOLPRI = 'APOR'"
sql6 = sql6 & " and to_date (tsa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy')"
sql6 = sql6 & " and tsa_cab.IDTSA_CAB=tsa_datnum.IDTSA_CAB"
sql6 = sql6 & " and to_char(tsa_cab.FCHEST, 'HH24') <= '05' "
sql6 = sql6 & " and to_date (tsa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy')"
sql6 = sql6 & " group by DECODE(tsa_cab.modpago, '0',
'POSTPAGO', '1', 'PREPAGO')"



'Consulta de Errores

sql7 = " select to_date(anom.FECHAHORA,'dd/mm/yy') as fecha, "
sql7 = sql7 & " refe.REFERENCIA as operacion, "
sql7 = sql7 & " substr(anom.textoerror,0,200)as textoerror, "
sql7 = sql7 & " count(*) numero "
sql7 = sql7 & " from t_anomalias anom , table_x_mid_eventos
event , table_x_mid_refeventos refe "
sql7 = sql7 & " where "
sql7 = sql7 & " to_date(anom.FECHAHORA,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy') and anom.idreferencia=event.REFERENCIA"
sql7 = sql7 & " and event.X_MID_EVENT2X_MID_REFEVENT=refe.OBJID
"
sql7 = sql7 & " group by to_date(anom.FECHAHORA,'dd/mm/yy'), "
sql7 = sql7 & " refe.REFERENCIA, "
sql7 = sql7 & " substr(anom.textoerror,0,200) order by
substr(anom.textoerror,0,200)"


'Consulta para sacar las portabilidades que se han procesado Fuera
de Ventana de Altas

sql8 = " select to_date(sysdate,'dd/mm/yy')as fecha ,
count(tsa_cab.IDTSA_CAB) as numero, "
sql8 = sql8 & " DECODE(tsa_cab.modpago, '0', 'POSTPAGO', '1',
'PREPAGO') as tipo "
sql8 = sql8 & " from tsa_cab , TSA_DATNUM , toperadoras "
sql8 = sql8 & " where tsa_cab.IDESTSOLPRI = 'APOR' "
sql8 = sql8 & " and tsa_cab.IDTSA_CAB=tsa_datnum.IDTSA_CAB "
sql8 = sql8 & " and tsa_cab.idoperadora =
toperadoras.idoperadora "
sql8 = sql8 & " and to_date (tsa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate,'dd/mm/yy') "
sql8 = sql8 & " and to_char(tsa_cab.FCHEST, 'HH24') >= '06' "
sql8 = sql8 & " group by DECODE(tsa_cab.modpago, '0',
'POSTPAGO', '1', 'PREPAGO') "




'Consulta para sacar las portabilidades procesadas Fuera de Ventana
de Bajas


sql9 = " select to_date(tpa_cab.FCHVCOR,'dd/mm/yy') as fecha,
count(TPA_DATNUM.MSISDN) as numero, "
sql9 = sql9 & " decode(tpa_cab.TIPABO, '0', 'POSTPAGO', '1',
'PREPAGO') as tipo "
sql9 = sql9 & " from tpa_cab , TPA_DATNUM "
sql9 = sql9 & " where tpa_cab.IDESTSOL = 'APOR' "
sql9 = sql9 & " and to_date (tpa_cab.FCHVCOR,'dd/mm/yy') =
to_date(sysdate ,'dd/mm/yy') "
sql9 = sql9 & " and to_char(tpa_cab.FCHEST, 'HH24') >= '06' "
sql9 = sql9 & " and tpa_cab.IDTPA_CAB=tpa_datnum.IDTPA_CAB "
sql9 = sql9 & " group by to_date(tpa_cab.FCHVCOR,'dd/mm/yy'), "
sql9 = sql9 & " decode( tpa_cab.TIPABO, '0', 'POSTPAGO', '1',
'PREPAGO') "



''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
'''''''''''''

''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''





set rs_ref2 = con.execute(sql3)




i=1

if not rs_ref2.eof then



do while not rs_ref2.eof


num_baja(i) = rs_ref2.fields("numero")
tipo_baja(i) = rs_ref2.fields("tipo")
fecha_baja(i) = rs_ref2.fields("fecha")


i= i + 1

rs_ref2.movenext
loop
regb = i - 1

else
regb = 1
fecha_baja(1) = date
num_baja(1) = 0
tipo_baja(1) = "Sin bajas"

end If

' Se ejecuta la query de Altas Confirmadas

Set RS_CONFIRMADAS = con.execute(sql4)
Set RS_PORTADAS = con.execute(sql6)
i=1

if not RS_CONFIRMADAS.eof then

do while not RS_CONFIRMADAS.eof

fecha_alta_confirmada(i) = RS_CONFIRMADAS.fields("FECHA")
altas_confirmadas(i) = RS_CONFIRMADAS.fields("numero")

If not rs_portadas.eof Then
altas_portadas(i) = RS_PORTADAS.fields("numero")
RS_PORTADAS.movenext
Else
altas_portadas(i) =0
End If

tipo_flujo(i) = RS_CONFIRMADAS.fields("TIPO")
i= i + 1
RS_CONFIRMADAS.movenext

loop
regacon = i - 1
else
regb = 1
fecha_alta_confirmada(1) = date
altas_confirmadas(1) = 0
altas_portadas(1) = 0
ripo_flujo(1) = 0
End If


' Se ejecuta la query de bajas confirmadas


set RSBAJAS_CONFIRMADAS = con.execute(sql5)

i=1

if not RSBAJAS_CONFIRMADAS.eof then

do while not RSBAJAS_CONFIRMADAS.eof
fecha_bajas_confirmada(i) = RSBAJAS_CONFIRMADAS.fields("FECHA")
bajas_confirmadas(i) = RSBAJAS_CONFIRMADAS.fields("numero")
sgp_tipo_flujo(i) = RSBAJAS_CONFIRMADAS.fields("TIPO")
i=i+1
RSBAJAS_CONFIRMADAS.movenext
loop
regbcon = i-1
else
regbcon = 1
fechas_bajas_confirmadas (1) = Date
bajas_confirmadas(1)= 0
sgp_tipo_flujo(1) = 0
End If




set rs_errores = con.execute(sql7)

i=1

if not rs_errores.eof then

do while not rs_errores.eof
fecha_errores(i) = rs_errores.fields("FECHA")

If rs_errores.fields("TEXTOERROR") = "Error de Notificacion 0 La
Portabilidad se encuentra en Proceso" Then
errores_portabilidad(i) = 0
errores_fventana(i) = rs_errores.fields("numero")
sgp_tipo_flujo(i) = rs_errores.fields("operacion")
sgp_textoerror(i) = rs_errores.fields("TEXTOERROR")

ElseIf rs_errores.fields("TEXTOERROR") = "Portabilidad Error de
Timeout en SOG" Then
errores_portabilidad(i) = rs_errores.fields("numero")
errores_fventana(i) = 0
sgp_tipo_flujo(i) = rs_errores.fields("operacion")
sgp_textoerror(i) = "Timeout en el SOG"

ElseIf rs_errores.fields("TEXTOERROR") = "Portabilidad Error de
Timeout en Activacion de CAS" Then
errores_portabilidad(i) = rs_errores.fields("numero")
errores_fventana(i) = 0
sgp_tipo_flujo(i) = rs_errores.fields("operacion")
sgp_textoerror(i) = "Timeout en el CAS"

ElseIf rs_errores.fields("TEXTOERROR") = "Portabilidad Error de
Timeout en OPSC" Then
errores_portabilidad(i) = rs_errores.fields("numero")
errores_fventana(i) = 0
sgp_tipo_flujo(i) = rs_errores.fields("operacion")
sgp_textoerror(i) = "Timeout en OPSC"

Else
errores_portabilidad(i) = rs_errores.fields("numero")
errores_fventana(i) = 0
sgp_tipo_flujo(i) = rs_errores.fields("operacion")
sgp_textoerror(i) = rs_errores.fields("TEXTOERROR")
End If


i=i+1
rs_errores.movenext
loop
regerr = i-1
else
regerr = 1
fechas_bajas_confirmadas (1) = Date
bajas_confirmadas(1)= 0
sgp_tipo_flujo(1) = 0
End If


set rs_erroresAltasFV = con.execute(sql8)

i=1

If not rs_erroresAltasFV.eof then

do while not rs_erroresAltasFV.eof
FechaAltasFV(i) = rs_erroresAltasFV.fields("fecha")
NumeroAltasFV(i) = rs_erroresAltasFV.fields("numero")
TipoAltasFV(i) = rs_erroresAltasFV.fields("tipo")
i=i+1
rs_erroresAltasFV.movenext
loop
regerrFValta = i-1
else
regerrFValta = 0


End If


set rs_erroresBajasFV = con.execute(sql9)

i=1

if not rs_erroresBajasFV.eof then

do while not rs_erroresBajasFV.eof
FechaBajasFV(i) = rs_erroresBajasFV.fields("fecha")
NumeroBajasFV(i) = rs_erroresBajasFV.fields("numero")
TipoBajasFV(i) = rs_erroresBajasFV.fields("tipo")
i=i+1
rs_erroresBajasFV.movenext
loop
regerrFVBajas = i-1
else
regerrFVBajas = 0


End If


con.close

Set con = WScript.CreateObject("ADODB.Connection")

con.Open GESTSAPR

' Inserta en BBDD MOVE

''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
'''''''''''''''Comprobar si hay datos del dia de hoy si los hubiera
primero se borran y despues de añaden los datos
actualizados''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''



set rs_ComprobarAltas = con.execute("Select * from
aserser_own.sgp_altas where to_date(fecha,'dd/mm/yyyy') =
to_date(sysdate, 'dd/mm/yyyy')")
set rs_ComprobarBajas = con.execute("Select * from
aserser_own.sgp_bajas where to_date(fecha,'dd/mm/yyyy') =
to_date(sysdate, 'dd/mm/yyyy')")
set rs_ComprobarErrores= con.execute("Select * from
aserser_own.sgp_errores where to_date(fecha,'dd/mm/yyyy') =
to_date(sysdate, 'dd/mm/yyyy')")

If not rs_ComprobarAltas.eof Then
Set rs = con.Execute("delete from aserser_own.sgp_altas where
to_date(fecha,'dd/mm/yyyy') = to_date(sysdate, 'dd/mm/yyyy')")
End If

If not rs_ComprobarBajas.eof Then
Set rs = con.Execute("delete from aserser_own.sgp_bajas where
to_date(fecha,'dd/mm/yyyy') = to_date(sysdate, 'dd/mm/yyyy')")
End If

If not rs_ComprobarErrores.eof Then
Set rs = con.Execute("delete from aserser_own.sgp_errores where
to_date(fecha,'dd/mm/yyyy') = to_date(sysdate, 'dd/mm/yyyy')")
End If

''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''

for t = 1 to regacon
If tipo_flujo(t) = "PREPAGO" Then
SQL41 = "INSERT INTO aserser_own.SGP_ALTAS ( FECHA, ALTAS_CONFIRMADAS,
ALTAS_PORTADAS, TIPO_FLUJO) VALUES ('"&fecha_alta_confirmada(t)&"',
'"&altas_confirmadas(t)&"','"&altas_portadas(t)&"', '27002')"
Else
SQL41 = "INSERT INTO aserser_own.SGP_ALTAS ( FECHA, ALTAS_CONFIRMADAS,
ALTAS_PORTADAS, TIPO_FLUJO) VALUES ('"&fecha_alta_confirmada(t)&"',
'"&altas_confirmadas(t)&"','"&altas_portadas(t)&"', '27001')"
End If
set rs = con.execute(SQL41)
Next

for t = 1 to regbcon
If tipo_flujo(t) = "PREPAGO" Then
SQL51 = "INSERT INTO aserser_own.SGP_BAJAS( FECHA, BAJAS_CONFIRMADAS,
BAJAS_PORTADAS, TIPO_FLUJO) VALUES ('"&fecha_bajas_confirmada(t)&"',
'"&bajas_confirmadas(t)&"','"&num_baja(t)&"', '27008')"
Else
SQL51 = "INSERT INTO aserser_own.SGP_BAJAS ( FECHA, BAJAS_CONFIRMADAS,
BAJAS_PORTADAS, TIPO_FLUJO) VALUES ('"&fecha_bajas_confirmada(t)&"',
'"&bajas_confirmadas(t)&"','"&num_baja(t)&"', '27007')"
End If
set rs = con.execute(SQL51)
Next


For t=1 to regerr

sql61 = "insert into aserser_own.sgp_errores (FECHA,
ERRORES_PORTABILIDAD, ERRORES_FUERA_VENTANA, TIPO_FLUJO, TEXTOERROR)
values ( '" & fecha_errores(t) & "', '"&errores_portabilidad(t)&"',
'"&errores_fventana(t)&"', '"&sgp_tipo_flujo(t)&"',
'"&sgp_textoerror(t)&"')"
set rs = con.execute(SQL61)

Next

For t=1 to regerrFValta

If tipoAltasFV(t) = "PREPAGO" Then
sql81 = "insert into aserser_own.sgp_errores (FECHA,
ERRORES_PORTABILIDAD, ERRORES_FUERA_VENTANA, TIPO_FLUJO, TEXTOERROR)
values ( '" & fechaAltasFV(t) & "', '0', '"&NumeroAltasFV(t)&"',
'27002', 'Error en Alta Prepago FV')"
Else
sql81 = "insert into aserser_own.sgp_errores (FECHA,
ERRORES_PORTABILIDAD, ERRORES_FUERA_VENTANA, TIPO_FLUJO, TEXTOERROR)
values ( '" & fechaAltasFV(t) & "', '0', '"&NumeroAltasFV(t)&"',
'27001', 'Error en Alta Postpago FV')"
End If

set rs = con.execute(SQL81)

Next


For t=1 to regerrFVBajas

If tipoBajasFV(t) = "PREPAGO" Then
sql91 = "insert into aserser_own.sgp_errores (FECHA,
ERRORES_PORTABILIDAD, ERRORES_FUERA_VENTANA, TIPO_FLUJO, TEXTOERROR)
values ( '" & fechaBajasFV(t) & "', '0', '"&NumeroBajasFV(t)&"',
'27008', 'Error en Baja Prepago FV')"
Else
sql91 = "insert into aserser_own.sgp_errores (FECHA,
ERRORES_PORTABILIDAD, ERRORES_FUERA_VENTANA, TIPO_FLUJO, TEXTOERROR)
values ( '" & fechaBajasFV(t) & "', '0','"&NumeroBajasFV(t)&"',
'27007', 'Error en Baja Postpago FV')"
End If

set rs = con.execute(SQL91)

Next


MsgBox("He Terminado OK")


If Err <> 0 Then
'MsgBox("Error!")
Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Run "cmd /c echo " & Date & " " & Time & " - ERROR - " &
Err.description & " >> bn_portabilidad.log"

Set Mail = WScript.CreateObject("Persits.MailSender")

Mail.Host = "muli82smtp01.amena.es"

Mail.From = "move@amena.es"
Mail.FromName = "MOVE"
Mail.AddAddress "gc_internet@amena.es"

Mail.Subject = "ERROR al realizar el proceso de altas y bajas en
Portabilidad."
Mail.Body = ""

Mail.Send


Else
Dim oMail

'WshShell.Run "cmd /c echo " & Date & " " & Time & " - ERROR - " &
Err.description & " >> bn_portabilidad.log"
'Set oMail = WScript.CreateObject("CDONTS.NewMail")

'Dirección de destino
'oMail.To = "aseguramiento.servicio@amena.es"
'oMail.From = "aseguramiento.servicio@amena.es"

'Tema del mensaje
'oMail.Subject = "Ejecucion correcta del script"

'El cuerpo del mensaje
'oMail.Body = "La Ejecución del script bn_portabilidad.vbs ha sido
correcta"
'oMail.Send
'Set oMail = nothing
End If



Please help me. Thanks
Jens.Toerring@physik.fu-berlin.de

2004-11-25, 7:50 am

Israel Moreno <ismope83@hotmail.com> wrote:
> i have a problem. i need to transform a VisualBasicScript to
> KornShellScript and i don't know nothing about ksh. this is the
> script.


I have never used VisualBasic but after a short look at the script
I would guess that Korn shell scripts are rather unsuitable for
doing the things you're doing there. Extensive string handling and
database accesses aren't really something shells were made for. I
would think that a better choice would be a "real" language like
Perl, Phyton etc.
Regards, Jens
--
\ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Chuck Dillon

2004-11-26, 5:50 pm

Israel Moreno wrote:

> hi everybody,
>
> i have a problem. i need to transform a VisualBasicScript to
> KornShellScript and i don't know nothing about ksh. this is the
> script.
>
> <snipped vbscript that used ADO+SQL synchronize one database with another>


Although this could be done with ksh using an external database
interface (i.e. the sql commandline), it would far more straightforward
to do it in PERL (or another language with rdb interface capability).

With ksh, your script would be structured something like this:
a) Call the sql commandline to run your queries and either direct the
output to files or load them into in-memory string arrays.
b) Iterate through the data and generate the insert/update sql as text
to a file.
c) Call the sql commandline and have it execute the sql to do
the inserts/updates.

Although it's similar to your vbscript structure it involves a lot more
I/O overhead since the data has to pass through the DB connection and
then through an I/O stream in both directions.

With PERL you can use the DBI module to replace ADO and functionally do
exactly the same thing the vbscript does. PERL is cross platform so
once you've implemented the script you could use it on a Winders box
instead of vbscript and only have to maintain one script.

As for learning how, that's up to you and worth the effort. I suggest
you start with googling (or whatever search engine) for "perl DBI SQL
tutorial OR primer OR examples" to get started. There's lots of
information on PERL (and Python and others) on the WWW and books a
plenty.

Note: If you go with PERL there is absolutely nothing specific to UNIX
in this problem so if you need more help go to a PERL specific forum.

HTH,

-- ced



--
Chuck Dillon
Senior Software Engineer
NimbleGen Systems Inc.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com