Discussion Board for collaboration on QlikView Scripting.
dim strServer, strConexion, oConn,oRS
strConexion="provider=sqloledb;data source=" & strServer & ";initial catalog=dbMain"
Set oConn = CreateObject("ADODB.Connection")
oConn.Open strConexion, "sa", "password"
Set oRS =CreateObject("ADODB.Recordset")
sSQL="insert into tbUsuarios (intEmpresa,intSucursal,strUsuario,strConstrasena) values (0,0,'Field?','123')"
ors.open sSQL, oconn
How can I put a field or variable in an SQL sentence?.
It is possible?
Or read an QVD and store it into an sql database?.
Help and Thanks!!
Hi the best method is create the txt file or csv file by using STORE command.
Create the shell script to insert the data into DB.
Here are the steps.
1. Create the shell script to insert the data from txt file into database.
2. Create the batch file to execute the shell script.
3. Write your Qlikview script in qvw
4. create the txt file by using STORE command
5. Execute the batch file to insert the data from txt file to DB by using EXECUTE command.
Sorry for my english, and my probelm resides in the procces to save the csv into a sql database.
1.I already create an qvw, this one transforms my qvd into a csv.
2.A .bat reload this qvw to transforms the data into csv
3.Then i need to store this csv into an sql database, but here i dont know how to do it by code.
Im using a .bat to do the all the thigs, but the third one is still wrong.
So many thanks!
I mostly do it in script.
So if you read your data in a QVD, you can read your QVD and generate an SQL-Statement for each row
cmpcode, code, text(BIC) as BIC, iban,
'update oas_elmbanklist set iban=#'&iban&'#,swift=#'&BIC&'# where cmpcode=#'&cmpcode&'# and elmcode=#'&code&'#'
drop table Liste;
All modern databases provides a cmd line util to import data.
SQL Server - bcp
Oracle - sqlplus
Use your qlikview script to generate a csv file, or even better a text flat file with your inserts and then
Hope this help you