Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to insert record into sql using macro in qlikview

Hi all,

     i have a qlikview document where i need to insert record into sql db from qlikview document by using macro or any other process .

please share me the way you know. and if you know using macro please share the code .

Thanks,

Narasimhak.

rwunderlich techvarunstalwar1 swuehl kenphamvn

10 Replies
ariel_klien
Specialist
Specialist

Hi,

you can use the script to insert to DB...

Connect to sql;

sql insert into DB.table (a,b,c) values (a,b,c);

BR

Ariel

Anil_Babu_Samineni

This is working for me and tested

CUSTOM CONNECT TO "Provider=MyPackage.exe;driver=Personal;host=Anil_Connection;port=9999;db=DB_Name;FetchTSWTZasTimestamp=1;MaxVarcharSize=262144;XUserId=abc;XPassword=123;";

[Sample1]:

SELECT "col1"

FROM "public"."Sample1";

SQL INSERT INTO public."Sample1"(col1) VALUES ('1234');

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

I need the script on button click but your code will work on reload i think

Anonymous
Not applicable
Author

Can i have it in macro for button click

Anil_Babu_Samineni

I never work .. May be tamilarasu‌ has some inputs

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

hi tamilarasu‌ can you explain me on how to write macro on button qlik

tamilarasu
Champion
Champion

Hello Narasimha,

I haven't tried to write back into SQL server before. marcus_sommermight have some ideas.  

marcus_sommer

I think it should be look like this one: Re: Writing to SQL DB from Macro

- Marcus

its_anandrjs

Dear marcus_sommer

Can you provide any sample for this or will it required any third party in between.

Regards,

Anand