# Problem using Lookup

**URL:** <https://community.cdata.com/t/problem-using-lookup/817>\
**Category:** CData Arc\
**Tags:** sql-lookup, question\
**Created:** [July 11, 2024, 10:33am UTC](https://community.cdata.com/t/problem-using-lookup/817 "2024-07-11T10:33:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![russell-jerseypost](https://avatars.discourse-cdn.com/v4/letter/r/439d5e/32.png) [@russell-jerseypost](https://community.cdata.com/u/russell-jerseypost)\
**Post date:** [July 11, 2024, 10:34am UTC](https://community.cdata.com/t/problem-using-lookup/817/1 "2024-07-11T10:34:03Z")

</div>

CData Arc™ 2023 - 23.4.8789.0

I’m trying to use a SQL Server Lookup to determine if a matching record exists or not

Here are my settings

 ![61d38a5a-34b7-4f2c-879d-c8d254ad12de.png](https://us1.discourse-cdn.com/cdata/original/1X/df72d82c9446778f0098a45c7734087e3cfa3af3.png)

 ![bd7bb4f1-57b7-415f-a2d1-688699bcec30.png](https://us1.discourse-cdn.com/cdata/original/1X/84b71df10dc47f912a0bb8c2fef578daa8d36cb2.png)

If I use “_Use NULL Value_” I do not get the **Lookup-consignmentno** header at all.

If I use “_Use Empty String_” I get&nbsp;an Error “Lookup: Field cannot be null”

In the logs I get

```auto
[2024-07-11T11:23:07.371] [Info] SQLCommand: SELECT `consignmentno` FROM `woodside`.`pallettrackduplicateprevention` WHERE (`consignmentno` = @p1); @p1='EPB0925'[2024-07-11T11:23:07.371] [Info] [DRIVER] 2024-07-11T11:23:07.371+01:00	2	[3553|Q-Id]	[EXEC|Parsed] Executing query: [SELECT [consignmentno] FROM [woodside].[pallettrackduplicateprevention] WHERE [consignmentno] = @p1][2024-07-11T11:23:07.371] [Info] [DRIVER] 2024-07-11T11:23:07.371+01:00	2	[3553|Q-Id]	[EXEC|Parsed] Parameter: p1 = EPB0925[2024-07-11T11:23:07.371] [Info] [DRIVER] 2024-07-11T11:23:07.371+01:00	3	[3553|Q-Id]	[TCP |Send] Send Begin - Length: 242[2024-07-11T11:23:07.371] [Info] [DRIVER] 2024-07-11T11:23:07.371+01:00	3	[3553|Q-Id]	[TCP |Send] Send End.[2024-07-11T11:23:07.371] [Info] [DRIVER] 2024-07-11T11:23:07.371+01:00	3	[3553|Q-Id]	[TCP |Receiv] DataIn, Length: 65[2024-07-11T11:23:07.371] [Info] [DRIVER] 2024-07-11T11:23:07.371+01:00	2	[3553|Q-Id]	[EXEC|Messag] Executed query: [SELECT [consignmentno] FROM [woodside].[pallettrackduplicateprevention] WHERE [consignmentno] = @p1] Success: (0 ms)[2024-07-11T11:23:07.371] [Info] -1 row(s) affected.[2024-07-11T11:23:07.371] [Debug] Result column(s): (consignmentno)[2024-07-11T11:23:07.371] [Debug] No record matched the query.[2024-07-11T11:23:07.371] [Error] Lookup: Field cannot be null.Stack Trace: at Arc234p.eks.XM(Message , String ) at Arc234p.eks.Xd(Message , String , String ) at Arc234p.eks.ATP(Message )Inner Exception: Field cannot be null.Inner Stack Trace: at Arc234p.TmU.Qb(String , String , Object[] ) at Arc234p.lam.AddMessageHeader(String , String , String ) at Arc234p.eks.XM(Message , String )[2024-07-11T11:23:07.371] [Info] Message FetchFileFromVigo-20240711-103014693-z39K_1V3A6Y03N5K5 is finalized. Name: EPB0925.xml, Type: Input, Status: Error, Message: Field cannot be null., Processing Time: 250ms.

```

The header \*is\* set

 ![bd50bdfe-6962-4bbf-a52e-16899b5ba714.png](https://us1.discourse-cdn.com/cdata/original/2X/6/673f1b742fcc6d19caca0fa579a84cbd29907ac3.png)

---

<div class="post-metadata">

**Author:** ![lohith](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/lohith/32/1848_2.png) [@lohith](https://community.cdata.com/u/lohith)\
**Post date:** [July 11, 2024, 11:54am UTC](https://community.cdata.com/t/problem-using-lookup/817/2 "2024-07-11T11:54:52Z")

</div>

Hi Russel,

It looks like there could be an issue when you select “Use Empty String” from the drop-down. Do you still need an empty string for `consignmentno` when no matching records are found?

Selecting “Use Null Value” can pass the file successfully when no matching records are found in the table.

Would you like to continue processing the file when no records are matched from the table?

---

<div class="post-metadata">

**Author:** ![James\_B](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/james_b/32/1688_2.png) [@James\_B](https://community.cdata.com/u/James_B)\
**Post date:** [July 11, 2024, 1:35pm UTC](https://community.cdata.com/t/problem-using-lookup/817/3 "2024-07-11T13:35:28Z")

</div>

To clarify, the behavior that you are seeing when you select “Use NULL value” is expected here - the headers that accompany the message are essentially strings, and the only way to use a null value here is the omission of the header.

It’s not expected that “Use empty string” return an error, however - this should return a header with an empty string value, and we have opened this with our development team to resolve in a future update.

---

<div class="post-metadata">

**Author:** ![lohith](https://sea3.discourse-cdn.com/cdata/user_avatar/community.cdata.com/lohith/32/1848_2.png) [@lohith](https://community.cdata.com/u/lohith)\
**Post date:** [July 25, 2024, 6:29am UTC](https://community.cdata.com/t/problem-using-lookup/817/4 "2024-07-25T06:29:59Z")

</div>

Hi Russel,

I am pleased to inform you that the issue has been resolved in the latest website release of application version 24.2.8965, available at [https://arc.cdata.com/support/builds/](https://arc.cdata.com/support/builds/). This version allows an empty string as the lookup header value when no matching records are found (When “Use Empty String” is selected).

I see you are still using version 23 of the application. To install version 24, you will need an upgraded key. You can obtain the upgraded key through our self-service portal at [https://portal.cdata.com/](https://portal.cdata.com/). Please register and get the key from there.

Let me know if you have any further questions.
