mibuso.com

Microsoft Business Solutions online community
It is currently Sat May 25, 2013 4:11 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Passing a parameter from NAV into a SQL FUNCTION
PostPosted: Mon Mar 07, 2011 2:51 pm 
Offline

Joined: Wed Mar 02, 2011 12:48 pm
Posts: 2
Country: Germany (de)
Hello everyone,

first of all I want to apologize if this problem is already solved in another Thread. I couldn't find
any Posts neither discribing my problem nor giving a working answer for it.
Also I am sorry if this Thread is posted in a false area in the forum.

The situation:
In NAV I have a table which is linked to a view in Database1 of Server1. The view shows
a UNION of 2 tables of Database2 on Server2. The result of this UNION is displayed in 2 rows
("Name" and "Amount").

In NAV I do a filter on the row "Name" to get 1 record of the view corresponding to that filter. The
problem is that the view gets every record from Server2 first (it's about 1500 records at the moment)
and then filters those records with the passed filter. What I'm trying to do is to pass the filter
directly to the UNION in the SELECT-Statements on Server2 as a parameter so that the view only sums up 1 record
to increase its performance.

I already googled about passing parameters to a view and found out that a view can't get any
parameters. So I'm using a function with a parameter now which is called in the view.

The problem:
How can i pass a parameter from NAV into that function I created and is it possible to do that
in the view? I need the view to filter the table in NAV for statistical purposes.

Best regards,
Dirk


Top
 Profile E-mail  
 
 Post subject: Re: Passing a parameter from NAV into a SQL FUNCTION
PostPosted: Mon Mar 07, 2011 5:21 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8704
Location: 3rd rock from sun
Country: United States (us)
I suggest to use ADO instead and run your statement with parameters Waldo has a how to use ADO.

Once the record set is return, you can then show or process the data in temporary form/table.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject: Re: Passing a parameter from NAV into a SQL FUNCTION
PostPosted: Tue Mar 08, 2011 10:25 am 
Offline

Joined: Wed Mar 02, 2011 12:48 pm
Posts: 2
Country: Germany (de)
Thank you for the answer. ADO is a possible way, but is there still
any way I could solve that with a view? It's not that I don't want
to use ADO. We are trying to solve that

Do you (or anybody else) have any other suggestions?
I would be glad if there was a different way for that issue.


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: