# Infor LN Table Name Builder (Logical to Physical SQL Name)

> Source: https://netray.co/tools/infor-ln-table-name-builder
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Turn an LN logical table such as tcibd001 into the physical SQL table name with company suffix and a ready SELECT statement.

## Category

infor-ln

## Erp

Infor LN

## Audience

- LN developer
- BI developer
- Database administrator

## Tool

**Kind:** template

**Output:** code

**Language:** sql

**Fields:**

#### Package (2 letters)

**Key:** pkg

**Type:** text

**Default:** tc

#### Module (3 letters)

**Key:** mod

**Type:** text

**Default:** ibd

#### Table number (3 digits)

**Key:** tbl

**Type:** text

**Default:** 001

#### Company number

**Key:** cmp

**Type:** text

**Default:** 100

#### Database schema or owner

**Key:** schema

**Type:** text

**Default:** baandb

#### First column

**Key:** col1

**Type:** text

**Default:** item

#### Second column

**Key:** col2

**Type:** text

**Default:** dsca

**Blocks:**

#### Name parts

**Body:** -- Logical table : {{pkg}}{{mod}}{{tbl}}
-- Package       : {{pkg}}
-- Module        : {{mod}}
-- Table number  : {{tbl}}
-- Company       : {{cmp}}
-- Physical table: t{{pkg}}{{mod}}{{tbl}}{{cmp}}
-- Column pattern: t_<fieldname>

#### Sample read-only SELECT

**Body:** SELECT t_{{col1}}, t_{{col2}}
FROM {{schema}}.t{{pkg}}{{mod}}{{tbl}}{{cmp}}
ORDER BY t_{{col1}};

#### Row count check

**Body:** SELECT COUNT(*) AS row_count
FROM {{schema}}.t{{pkg}}{{mod}}{{tbl}}{{cmp}};

**Notes:** LN physical tables are the logical name prefixed with t and suffixed with the three digit company number, and fields are prefixed t_. Defaults use tcibd001 (items) as an example, so check column names such as item and dsca in your data dictionary. Case, schema name and quoting depend on your RDBMS and driver. Run read-only queries against a reporting copy rather than production, and never write to LN tables directly, use the DAL or BDE.

## Content

**Intro:** Infor LN and Baan show tables as logical names such as tcibd001, but the database stores them with a prefix and a company suffix. This builder converts a package, module, table number and company into the physical table name and gives you ready read-only SQL to start from.

**Sections:**

#### How to use the builder

**Body:** Enter the package and module letters, the three digit table number and the company number, plus the schema name your DBA uses. The first block shows each part and the resulting physical name. The second and third blocks give a SELECT and a row count you can paste into your SQL client. Fill the column fields with the logical field names, without the t_ prefix, and the builder adds it for you.

#### The naming convention

**Body:** A logical LN table is five letters plus three digits: the first two letters are the package, the next three the module, and the digits the table within the module. In the database the name becomes a leading t, then the logical name, then the company number, so tcibd001 for company 100 is ttcibd001100. Fields are stored with a t_ prefix, for example t_item. LN tables also carry reference counter columns such as t_Refcntd and t_Refcntu that you normally ignore in reports.

**Bullets:**

- Package plus module equals the five letter module code
- Company number is part of the physical name
- Enumerated fields store numbers, not text, so map them in reports

#### Common mistakes

**Body:** People query the wrong company by forgetting the suffix, or assume enumerated fields hold text when they hold a numeric code that must be translated with the domain definition. Others run heavy reports on the production database during business hours or try to update LN tables directly, which bypasses business rules and the DAL and can corrupt data. Use a reporting copy, filter on indexed fields, and use supported interfaces for any write.

**Cta:** If your analysts keep translating LN table names and enums by hand, we can show how a natural-language layer over a read-only copy of LN answers it directly.

**Faq:**

#### What is the physical name of tcibd001 in the database?

**Answer:** It is t, then the logical name, then the company number. For company 100 that is ttcibd001100. The company suffix means each LN company has its own copy of the table.

#### Why do LN columns start with t_?

**Answer:** It is the database naming convention for LN fields. The logical field item in table tcibd001 is the column t_item in the physical table. Use the logical name in tools and add the prefix in SQL.

#### Can I update LN tables with SQL?

**Answer:** You should not. Direct updates skip the DAL, validations and reference counters and can leave inconsistent data. Use the supported interfaces such as DAL based sessions, BDE or integration objects, and keep SQL for reading.

#### Where do I find column names and enum values?

**Answer:** In the Tools data dictionary of your LN environment: table definitions list fields and domains, and domain definitions list enumerated values with their numeric codes. Check there rather than relying on generic documentation.

## Search terms

infor ln table naming convention, baan table name sql, ttcibd001100, infor ln physical table name, baan tcibd001 sql query, infor ln t_ column prefix, infor ln direct sql select

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
