Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Call a Stored Proc behind a button

Hi Guys,

I am working on a new QlikView requirement where I am working to make QlikView Report/Dashboard more intuitive by making some transactional control on it.

I have a requirement where I want to call a stored procedure by a Button on QlikView.

So when I click the button, I want to run the following command  EXEC sp_xx_yy

Please advice

Regards

Naveen


13 Replies
vikasmahajan

pfa

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

Thanks for Sharing this Vikas. However, the QVW attached doesn't have a button.

I want the Stoerd Proc to be called when the button is clicked.

Regards

Naveen

Not applicable
Author

In a macro use this :

For a query that won't return results:

DoCmd.RunSQL

For one that will:   

Dim dBase As Database dBase.OpenRecordset

Syntax

expression.OpenRecordset(Name, Type, Options, LockEdit) , only use the "Name"

NameRequiredStringThe source of the records for the new Recordset. The source can be a table name, a query name, or an SQL statement that returns records. For table-typeRecordset objects in Microsoft Access database engine databases, the source can only be a table name.

Hope this helps

Regards!

Clever_Anjos
Employee
Employee

What do you want to do with proc results? Refresh your data?

Not applicable
Author

Hi Clever,

No - I will just set a value on the database with this stored procedure. I don't want to refresh any data or bring this data to the front.

Cheers

Naveen

Not applicable
Author

Rau`l,


Thanks - I'll check this and get back to you.

Regards

Naveen

Not applicable
Author

Update

I am thinking of the following approach :

1) Create a Button in Qlikview

2) Add a action on the button (External > Macro)

3) Write a VB program on on that Macro and call the SQL Stored Proc

I am not sure on what impact this could have on the performance etc, but I'll try this and keep you posted

Regards

Naveen

Not applicable
Author

Yep, thats the point off my recently post, maybe you need to use the "System Acces Mode" in the Macro , and let "Alloe System Acces". Good luck!

Clever_Anjos
Employee
Employee

Naveen Vyas, set the direction, you can execute using macros (vbScript)

you macro code should be like this

sp = "YOUR STORED PROCEDURE"

Set cmd = CreateObject("ADODB.Command")
With cmd
.ActiveConnection = "YOUR CONNECTION STRING"
.CommandType = 4
.CommandText = sp
.Execute
End With
Set cmd = Nothing