Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Administration & Installation

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 16th September 2014, 16:06
zymmon's Avatar
zymmon zymmon is offline
Junior Member
 
Join Date: Sep 2008
Posts: 6
zymmon is on a distinguished road
Baan: LN - DB: SQl Server - OS: Windows 2003
Hint "with(nolock)" on selects
Baan: ERP LN 6.1 FP2
DB: SQL Server 2005
OS: Windows 2003
C/S: Both

This post is related to a doubt I have regarding the use of the hint "with no lock" in my program scripts.

First of all, I want to clarify that the environment that I'm using uses MS SQL Server for the Database, where the "with nolock" hint becomes almost mandatory for the way the database manages the locking scheme.

Basically my doubt applies to the use of this hint on a query that includes more than one table. I'm not sure if the hint works at all or not, and if it works if it applies to all the tables in the join or just for the main table.

When I write that clause is ANSI SQL I use the hint in each table, but in LN I use the hint "with (nolock)" right before the Selectdo.

The example for this doubt should be the following:



select table1.field1
from table1,
table2
where table1._index1 = {:variable}
and table2._index1 = table1.otherfield
hint "with(nolock)"
selectdo
selectdo statements
endselect

Mi feeling (for what I have been able to try) is that the hint is not applying to all the tables in this case. On the other hand, when I use the hint for just one table it works perfectly.

That is why I'm posting this to know if someone can give me some feedback on your own experiences, and to know if you have ever found this problem and how to solve it.



Thanks!

Regards,

Simón
Reply With Quote
Sponsored Links
  #2  
Old 16th September 2014, 16:48
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,320
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,

I guess in this Thread, Vahdani already advised a way to do updates in Baan. Did you tried the method he has shown?

I have worked on SQL Server Query Optimizer's and what I feel is for complex queries i.e. having more than 1 table in its selection the optimizer's do not behave in a right way and get confused on applying the hints. Hints are basically for building paths and optimizing query, so in your case it might be applying the hint to your first open object/table and for the next table it is applying something else.

What you can try is, split your query into two parts:-
Code:
select table1.field1
from table1
where table1._index1 = {:variable}
and table2._index1 = table1.otherfield
hint "with(nolock)"
selectdo
    select table2.*
    from   table2
    where table2._index1 = :table1.otherfield
    hint "with(nolock)"
    selectdo
    endselect
endselect

I am not sure about the table's and the data, but you can try using refers to clause in your query as well.


You can also try using "on" keyword.

e.g

Code:
select a.cuno, b.cuno
from   tppdm740 a, tccom010 b
where  a.cuno refers to b
and    a._compnr = 812
hint   use index 1 on b
hint   use index 2 on a

Not sure if it works on not.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hint nolocks en select zymmon Forum español 2 15th September 2014 19:11
Indian Subsidiary of China Based Meita Group Selects Merino Services to Implement Inf pritivandana Pages and Stories 0 17th January 2011 08:55
Help regarding tools session rahul.kolhe22 Tools Development 4 22nd January 2010 14:31
Amount of selects in tdinv6230m000 makiju Tools Administration & Installation 3 20th June 2002 12:23
How to prevent passing of hints generated by Oracle Driver ? baaniac Performance & Tuning 6 24th May 2002 12:16


All times are GMT +2. The time now is 13:54.


©2001-2017 - Baanboard.com - Baanforums.com