473,790 Members | 3,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DLookup uses twice the SEQUENCE numbers

DFS
FYI,

Using DLookup("Result sField","Pass-thru query") consumes 2 SEQUENCE numbers
each time it's called.

Anyone know why?

Nov 13 '05 #1
3 2502
DFS wrote:
FYI,

Using DLookup("Result sField","Pass-thru query") consumes 2 SEQUENCE numbers
each time it's called.

Anyone know why?


Without seeing what "pass-thru query" contains, no, but I would suspect
it's something in there since DLookup is as it's name suggests just
something to look up, it doesn't write to tables.

(comp.databases .oracle dropped as my ISP doesn't carry the group)

--
This sig left intentionally blank
Nov 13 '05 #2
DFS
Trevor Best wrote:
DFS wrote:
FYI,

Using DLookup("Result sField","Pass-thru query") consumes 2 SEQUENCE
numbers each time it's called.

Anyone know why?
Without seeing what "pass-thru query" contains, no, but I would
suspect it's something in there since DLookup is as it's name
suggests just something to look up, it doesn't write to tables.

"Pass-thru query" contains a SQL call to an Oracle nextVal function that
increments a SEQUENCE: SELECT SEQuenceName.ne xtVal AS ResultsField FROM
DUAL;

If I use a recordset with the same SELECT statement, it uses only one
SEQUENCE number.

It's just a little strange. There's no need to waste half the ID numbers,
so I'm going with the recordset method.

Thanks
(comp.databases .oracle dropped as my ISP doesn't carry the group)

Nov 13 '05 #3
DFS wrote:
Trevor Best wrote:
DFS wrote:
FYI,

Using DLookup("Result sField","Pass-thru query") consumes 2 SEQUENCE
numbers each time it's called.

Anyone know why?
Without seeing what "pass-thru query" contains, no, but I would
suspect it's something in there since DLookup is as it's name
suggests just something to look up, it doesn't write to tables.


"Pass-thru query" contains a SQL call to an Oracle nextVal function that
increments a SEQUENCE: SELECT SEQuenceName.ne xtVal AS ResultsField FROM
DUAL;


I know almost nothing about Oracle itself (apart from the bits that are
common to all db engines) so the above is a bit foreign to me and I
don't know how it works.
If I use a recordset with the same SELECT statement, it uses only one
SEQUENCE number.
That's interesting.
It's just a little strange. There's no need to waste half the ID numbers,
so I'm going with the recordset method.


Very interesting (I sound like Captain Jack Sparrow). I just tested
this, did a DLookup (Dlookup("FileN ame","dbo_tblFi le","FileID=5") ) on a
SQL Server table while running a trace in Profiler, I got one hit in the
trace.

For my next trick I made a pass-through query, a simple "select Filename
from tblFile where FileId=5" then did a DLookup
(DLookup("FileN ame","xxx")) (I named the query xxx), having restarted
the trace just to make sure I got two selects on that table (and I'm the
only one logged in). If I open the query there is one select in the
trace so it would appear that DLookup() on a passthrough query will
execute the query twice.

I also tested this with my own tLookup() (see
http://easyweb.easynet.co.uk/~trevor.../baslookup.zip) and this
gets just the one select so you could revert back to your original code
and use tLookup() instead :-)

--
This sig left intentionally blank
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2308
by: DFS | last post by:
FYI, Using DLookup("ResultsField","Pass-thru query") consumes 2 SEQUENCE numbers each time it's called. Anyone know why?
1
2992
by: Michel | last post by:
Hi all, This is my first post, so I am very new at this. I am trying to use page-number-citation twice in my code, but the second time it just shows '0'. The output is in pdf format and I am using Antenna XSL formatter V3. This is what I have sofar: <fo:page-sequence master-reference="frame-pages" force-page- count="even"> <fo:flow flow-name="xsl-region-body">
4
3341
by: Joe | last post by:
I have a table with an sequence (PK) and 2 fields, employee id and status id. Each employee can have multiple records in this table due to multiple status ids assigned. I have a multi-list box on a form which displays all possible statuses. I want to write code to highlight all the statuses associated with the employees id. I currently have tried dlookup but cannot get it to work correctly.
5
3299
by: Eric E | last post by:
Hi, I have a question about sequences. I need a field to have values with no holes in the sequence. However, the values do not need to be in order. My users will draw a number or numbers from the sequence and write to the field. Sometimes, however, these sequence numbers will be discarded (after a transaction is complete), and thus available for use. During the transaction, however, any drawn numbers need to be unavailable. I would...
13
2969
by: nzyui | last post by:
Trying to lookup a field from a table called condition this is a separate table not linked to anything: setup as shown Code S M L DG 1 2 3 RI 2 4 5 need a dlookup to give me a single code as in number 1 2 3 all from a form thats entered by user ie: condition code DG severity L nedd to return 5 cheers
2
1714
by: steph | last post by:
Hi all, I have an Access2002 form in in datasheet view. Column "CMP" is locked to user input, instead it is filled automatically by this function: === Private Sub Form_BeforeInsert(Cancel As Integer) On Error GoTo Form_BeforeInsert_Err Dim db As Database Dim rst As Recordset
3
2931
by: ECUweb | last post by:
Hi, I've got this instruction in a column of a query: DLookUp("","qryPuntospORPescador","APELLIDO='" & & "' AND NOMBREPESCADOR ='" & & "'") I need to sort out the records of the column in "numerical" ascending order. However, the results of the DLookUp function are converted into text. The records in the field "SumaDePUNTOS" in the query "qryPuntosPorPescador" are "numbers" and I need the DLookUp function to return "numbers" Is...
2
1795
by: John | last post by:
To prevent the null-error from showing up when dlookup returns false I created the code beneath which doesn't seem very elegant. How can I code this without having to use the dlookup twice? If Not IsNull(DLookup("", "tbSoortVerzoek", " = """ & Forms!!Soort_verzoek & """")) Then strForm = DLookup("", "tbSoortVerzoek", " = """ & Forms!!Soort_verzoek & """") Else MsgBox ("There is no form available")
9
6634
by: | last post by:
In my database I have a 'control table' in which basic info is stored about the application, for instance the application's path and the name of the company that is using it. In all of the application's reports I have a page footer with an unbound field that retrieves and shows the name of the company. This is done by Dlookup. My question is: is Dlookup the best way to do this, performance wise, or is there a more efficient way? Thanks in...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.