844-NOGALIS (844-664-2547)
Nogalis, Inc.
  • Link to Facebook
  • Link to X
  • Link to LinkedIn
  • Link to Mail
  • Company
    • News, Events and Articles
    • About Us
  • Products
    • Infor Lawson Data Archive
    • PeopleSoft Data Archive
    • Oracle Data Archive
  • Services
    • Infor Lawson Support
    • Infor Lawson / CloudSuite Consulting
  • Education & Training
  • Support
  • Contact Us
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

Archive for category: Articles

You are here: Home1 / News, Events and Articles2 / Articles

Connecting to MySQL in a Perl Script Using ODBC

Articles, Frontpage Article, News

When working with Perl and MySQL, one of the most reliable ways to establish a connection is through ODBC (Open Database Connectivity). This approach provides flexibility, as ODBC acts as a bridge between your Perl application and the MySQL database. In this post, we’ll walk through how to set up a simple Perl script that connects to a MySQL database using ODBC.


Prerequisites

Before we start coding, make sure the following are in place:

  1. Perl installed on your system.
  2. MySQL ODBC driver configured with a DSN (Data Source Name).
    • On Linux/Unix, you can configure this in /etc/odbc.ini.
    • On Windows, use the ODBC Data Source Administrator.
  3. Perl modules:
    • DBI — a generic Perl database interface.
    • DBD::ODBC — the ODBC driver for DBI.

You can install the modules via CPAN if they aren’t already installed:

cpan DBI

cpan DBD::ODBC


The Perl Script

Here’s a simple Perl script that demonstrates how to connect to a MySQL database using ODBC:

#!/usr/bin/perl

 

use strict;

use warnings;

use DBI;

 

# Define the DSN, username, and password

my $dsn = ‘DBI:ODBC:your_dsn_name’;

my $username = ‘your_username’;

my $password = ‘your_password’;

 

# Connect to the database

my $dbh = DBI->connect($dsn, $username, $password, {

RaiseError => 1,

PrintError => 0,

AutoCommit => 1,

}) or die “Failed to connect: ” . DBI->errstr;

 

print “Connected to the database successfully!\n”;

 

# Example query

my $sql = ‘SELECT * FROM your_table_name’;

my $sth = $dbh->prepare($sql);

$sth->execute();

 

# Fetch and display results

while (my @row = $sth->fetchrow_array) {

print join(“, “, @row), “\n”;

}

 

# Clean up

$sth->finish();

$dbh->disconnect();

 

print “Disconnected from the database.\n”;


Breaking It Down

  1. Connection String:
    The $dsn specifies the ODBC DSN you’ve configured, prefixed with DBI:ODBC:. Replace your_dsn_name with the DSN you set up for your MySQL database.
  2. Connection Attributes:
    • RaiseError => 1: Automatically die on errors.
    • PrintError => 0: Prevents warnings from being printed automatically.
    • AutoCommit => 1: Ensures changes are committed immediately.
  3. Query Execution:
    The script prepares a simple SELECT * query, executes it, and prints the results row by row.
  4. Cleanup:
    Always call $sth->finish() and $dbh->disconnect() to release resources properly.

Why Use ODBC?

Using ODBC adds a layer of portability to your applications. If your database backend changes in the future, you can update the DSN and driver without rewriting large portions of your Perl code. This is particularly useful in environments with multiple types of databases or when migrating systems.


Final Thoughts

With just a few lines of Perl code, you can connect to a MySQL database using ODBC and start running queries. While this example demonstrates a basic SELECT, the same connection can be used for inserts, updates, and more complex operations.

Whether you’re maintaining legacy Perl applications or building new scripts to interact with MySQL, ODBC gives you a stable, flexible way to manage database connectivity.

 

04/28/2026
https://www.nogalis.com/wp-content/uploads/2026/04/Connecting-to-MySQL-in-a-Perl-Script-Using-ODBC.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-28 09:34:502026-04-27 09:53:51Connecting to MySQL in a Perl Script Using ODBC

Weekly Patch Notification: April 25, 2026

Articles, Frontpage Article, Patches
Read more
04/25/2026
https://www.nogalis.com/wp-content/uploads/2026/05/Weekly-Patch-Notification-April-25-2026.jpg 427 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-25 20:10:402026-05-20 12:11:57Weekly Patch Notification: April 25, 2026

Lawson IPA Workflow email node – attachment failing on network path

Articles, Frontpage Article, News

Summary: You have an email node going out to users with an attachment from a network path, but it seems to be failing.

Here is the email node, notice the network path by \\

This same email node will fail when you try to add an attachment like this by saying the file “does not exist”

One way to properly attach a file to the email node is to use IPA FileAccess nodes to read and then write the file to Landmark so it could be attached locally.

  1. FileAccess Node 1 (read) will need to be set to the Main configuration so it can read the file from your LSF server (assuming that is where your file exists).
  2. FileAccess Node 2 (write) will need to be set to the System configuration so it can write it to your Landmark server. If your file will be on landmark automatically or by some other means, skip this step.
  3. Now simply remove your existing \\ attachment network path and add a local Landmark path like D:\lawson\fileAttachmentName.txt

Done! Now just run and test it to make sure it works.

04/24/2026
https://www.nogalis.com/wp-content/uploads/2026/04/Lawson-IPA-Workflow-email-node-attachment-failing-on-network-path.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-24 08:58:412026-04-22 10:02:42Lawson IPA Workflow email node – attachment failing on network path

Creating Favorites

Articles, Frontpage Article, News

To view and manage favorites in the Infor Lawson Portal, follow these steps below.

From the home page, select the hamburger icon beside Menu > User Options and select the Favorites tab to view the Favorites configuration.

 

URL / Token

 

The URL is a direct link to an external site, and the token is what’s available to your user, within a specified data area and system code

Click Save to add the new favorite item to your Favorites list. You can also click “Edit Favorites” directly on the home page, then click the Add icon to create new favorites, such as URLs, tokens, or custom forms.

04/21/2026
https://www.nogalis.com/wp-content/uploads/2026/04/Creating-Favorites.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-21 08:46:522026-04-21 08:46:52Creating Favorites

Weekly Patch Notification: April 18, 2026

Articles, Frontpage Article, Patches
Read more
04/18/2026
https://www.nogalis.com/wp-content/uploads/2026/05/Weekly-Patch-Notification-April-18-2026.jpg 427 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-18 19:09:142026-05-20 12:10:27Weekly Patch Notification: April 18, 2026

How the GEN job tables connect

Articles, Frontpage Article, News

The GEN job tables provide detailed information about job execution, allowing for tracking and troubleshooting. Each table serves a specific function in recording various aspects of the job lifecycle, from submission through execution to completion. This structure ensures clear mapping of relationships and dependencies among the tables, which is essential for monitoring and managing batch processes efficiently allowing admins to be able to trace job progress and diagnose issues at both macro and micro levels.

🔹 Job Table Relationships

JOBQUEUE (one row per submitted job)

|

|–< JOBSTEP (one or more steps per job)

|       |

|       |–< JOBSTEPLOG (messages for each step)

|

|–< JOBLOG (high-level messages/logs for the job)

|

|–< JOBPARM (parameters used when submitting job)

🔹 GEN tables related to jobs:

JOBQUEUE.JobQueue = primary key (ties everything together).

JOBSTEP.JobQueue → foreign key to JOBQUEUE.

JOBLOG.JobQueue → foreign key to JOBQUEUE.

JOBPARM.JobQueue → foreign key to JOBQUEUE.

Each job in the system is uniquely identified by the JobQueue value, which acts as the primary key and links related records across all main tables. By using foreign keys, the JOBSTEP, JOBLOG, and JOBPARM tables maintain referential integrity, allowing for efficient tracking and management of job execution details and associated parameters.

To retrieve comprehensive job execution data, a query can be constructed that joins the JOBQUEUE table with JOBSTEP, JOBLOG, and JOBPARM using the JobQueue field. This ensures all relevant information, such as job parameters, execution steps, and log messages, can be efficiently accessed and analyzed for each job instance.

Here is an example of a query to find who ran the GL199 with any messages found in the joblog. The results will show

  • Who ran it → UserName.
  • When it ran → StartDate + StartTime.
  • Job status → Status (Success, Error, etc.).
  • Parameters used → from JOBPARM.
  • Messages → from JOBLOG.

 

SELECT     JQ.JobName,    JQ.Program,    JQ.UserName,    JQ.StartDate,    JQ.StartTime,    JQ.EndDate,    JQ.EndTime,    JQ.Status,    JP.ParameterName,    JP.ParameterValue,    JL.Message

FROM GEN.dbo.JOBQUEUE JQ

LEFT JOIN GEN.dbo.JOBPARM JP ON JQ.JobQueue = JP.JobQueue

LEFT JOIN GEN.dbo.JOBLOG JL ON JQ.JobQueue = JL.JobQueue

WHERE JQ.Program = ‘GL199’

ORDER BY JQ.StartDate DESC, JQ.StartTime DESC;

 

04/17/2026
https://www.nogalis.com/wp-content/uploads/2026/04/How-the-GEN-job-tables-connect.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-17 08:44:332026-04-09 11:53:29How the GEN job tables connect

MySQL Formula to Convert Days to Years & Months

Articles, Frontpage Article, News

When working with date and time values in MySQL, it’s common to store durations in days. However, sometimes you need to present those days as a more human-readable format—like years and months. For example, showing “2 years, 3 months” instead of “825 days.”

Here’s a simple way to achieve this using a MySQL formula.


Converting Days to Years and Months

Since MySQL doesn’t have a built-in function to directly convert days into years and months, we can use arithmetic with division (/) and modulo (%) operators.

SELECT

FLOOR(days / 365) AS years,

FLOOR((days % 365) / 30) AS months

FROM

your_table;


How It Works

  • FLOOR(days / 365)
    Divides the total days by 365 to get whole years.
  • (days % 365)
    Gets the leftover days after subtracting the full years.
  • FLOOR((days % 365) / 30)
    Divides the leftover days by 30 to approximate months.

Example

Suppose your table looks like this:

CREATE TABLE durations (days INT);

INSERT INTO durations (days) VALUES (400), (825), (1200);

Running the query:

SELECT

days,

FLOOR(days / 365) AS years,

FLOOR((days % 365) / 30) AS months

FROM durations;

Would produce:

days years months
400 1 1
825 2 3
1200 3 3

Notes and Limitations

  • This method assumes 365 days per year and 30 days per month. It’s an approximation, not a precise calendar conversion.
  • If you need exact calendar-aware calculations (e.g., accounting for leap years or exact month lengths), you’ll need to work with MySQL date functions and actual date values instead of raw day counts.

Final Thoughts

Converting days to years and months in MySQL can be done easily with simple math functions. While the above approach works well for approximations, consider whether you need exact date-based calculations before choosing the method.

If you often store durations in days, this formula provides a quick way to present data in a more user-friendly format.

04/14/2026
https://www.nogalis.com/wp-content/uploads/2026/04/MySQL-Formula-to-Convert-Days-to-Years-Months.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-14 08:41:432026-04-09 11:54:26MySQL Formula to Convert Days to Years & Months

Weekly Patch Notification: April 11, 2026

Articles, Frontpage Article, Patches
Read more
04/11/2026
https://www.nogalis.com/wp-content/uploads/2026/05/Weekly-Patch-Notification-April-11-2026.jpg 427 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-11 20:07:392026-05-20 12:09:03Weekly Patch Notification: April 11, 2026

Lawson Security – Cannot get Productline List error

Articles, Frontpage Article, News

Most Lawson v10 systems has moved to Infor Security Service web portal to manage user provisioning etc.

 

However, Lawson Security Administration is still necessary for security reports, identity information, among other tasks.

 

When logging into Lawson Security Admin, you may receive this error and wonder why all of a sudden?

In order to resolve this, stop and start IBM and Lawson services in the proper order (your server names will differ from below but be similar under Windows Services.

STOP – Lawson and Websphere Services

  1. IBM WebSphere Application Server V8.5 – Infor10Prod-Appserver
  2. IBM WebSphere Application Server V8.5 – lsfappCellManager01
  3. IBM WebSphere Application Server V8.5 – Node Agent-Infor10Prod
  4. insight Environment “Prod”

 

Verify JAVA processes are down.

START – Lawson and Websphere Services

  1. insight Environment “Prod”
  2. IBM WebSphere Application Server V8.5 – Node Agent-Infor10Prod
  3. IBM WebSphere Application Server V8.5 – lsfappCellManager01
  4. IBM WebSphere Application Server V8.5 – Infor10Prod-Appserver

 

04/10/2026
https://www.nogalis.com/wp-content/uploads/2026/04/Lawson-Security-Cannot-get-Productline-List-error.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-10 08:17:282026-04-02 11:12:22Lawson Security – Cannot get Productline List error

V10 Portal Bookmarks

Articles, Frontpage Article, News

Follow this quick guide to re-label portal bookmarks in Lawson:

To change the Lawson v10 bookmark button label, locate and edit the file at %LAWDIR%\persistdata\lawson\portal\data\msgs\en-us\portal.xml, which controls how the label is displayed in the portal. Open the file in a text editor and search for “lbl_BOOKMARKS.”

Update the associated value to reflect your preferred naming convention, then save your changes. After updating, refresh the portal to confirm the new label appears correctly.

Keep in mind that this file may be overwritten during Portal or S3 Workspace patches and upgrades, so you will need to reapply your changes after each update to maintain the custom label.

04/07/2026
https://www.nogalis.com/wp-content/uploads/2026/04/V10-portal-bookmarks.jpg 470 470 Angeli Menta https://www.nogalis.com/wp-content/uploads/2013/04/logo-with-slogan-good.png Angeli Menta2026-04-07 10:03:482026-04-07 10:22:15V10 Portal Bookmarks
Page 4 of 117«‹23456›»

LEGACY ERP DATA ARCHIVE SOLUTION



Discover how our clients are leveraging AWS services to archive their Legacy ERP data and provide ubiquitous access to users via a light-weight, secure, and read-only web interface. Secure, Fast, Reliable, and Cost Effective. That is the promise of APIX. Follow the link below to find out more and book a discovery call with our data archive specialist.

BOOK DEMO

© Copyright - Nogalis, Inc. 2024
  • Legal
  • Privacy
  • Contact Us
Scroll to top Scroll to top Scroll to top