This document provides an introduction to using embedded SQL for NonStop SQL/MX. It discusses the compilation process which involves preprocessing SQL statements, compiling the host language code, and compiling the SQL to generate an execution plan stored in a module file. It provides examples of simple compilation and controlling the module names and locations. The goal is to help new SQL/MX users get started quickly with embedded SQL.
REPORTES JASPERREPORT E IREPORT SIN CONEXIÓN A UNA BBDDSandra Campos
Este documento explica cómo crear informes JasperReports sin conexión a una base de datos, pasando parámetros desde Java. Se crea una clase con datos de ejemplo, luego un informe con campos vinculados a los atributos de la clase. Se implementa una clase DataSource que proporciona los datos y se compila e imprime el informe desde el método main, generando un PDF sin necesidad de base de datos.
Message Queue 가용성, 신뢰성을 위한 RabbitMQ Server, Client 구성Yoonjeong Kwon
RabbitMQ Concept & How to work
High Availability in RabbitMQ
- Clustering & Mirrored Queue
HAProxy
Spring Cloud Stream Sample & configuration: Spring Boot App with Rabbit
This document provides instructions for configuring logon groups in SAP systems to balance logon loads. It describes how to create and manage logon groups using transaction SMLG, including adding instances to groups and removing them. It also explains how to configure client PCs to use logon groups by adding entries to the services file and optionally creating a sapmsg.ini file.
This presentation covers the basics of dockers, its security related features and how certain misconfigurations can be used to escape from container to host
Docker merupakan teknologi container yang memungkinkan pengepakan dan menjalankan aplikasi beserta dependensinya. Docker menggunakan arsitektur client-server dimana client berkomunikasi dengan docker daemon. Docker memungkinkan penyimpanan docker image di docker registry dan membuat serta menjalankan container dari image tersebut. Volume digunakan untuk berbagi data antara container dan sistem file.
REPORTES JASPERREPORT E IREPORT SIN CONEXIÓN A UNA BBDDSandra Campos
Este documento explica cómo crear informes JasperReports sin conexión a una base de datos, pasando parámetros desde Java. Se crea una clase con datos de ejemplo, luego un informe con campos vinculados a los atributos de la clase. Se implementa una clase DataSource que proporciona los datos y se compila e imprime el informe desde el método main, generando un PDF sin necesidad de base de datos.
Message Queue 가용성, 신뢰성을 위한 RabbitMQ Server, Client 구성Yoonjeong Kwon
RabbitMQ Concept & How to work
High Availability in RabbitMQ
- Clustering & Mirrored Queue
HAProxy
Spring Cloud Stream Sample & configuration: Spring Boot App with Rabbit
This document provides instructions for configuring logon groups in SAP systems to balance logon loads. It describes how to create and manage logon groups using transaction SMLG, including adding instances to groups and removing them. It also explains how to configure client PCs to use logon groups by adding entries to the services file and optionally creating a sapmsg.ini file.
This presentation covers the basics of dockers, its security related features and how certain misconfigurations can be used to escape from container to host
Docker merupakan teknologi container yang memungkinkan pengepakan dan menjalankan aplikasi beserta dependensinya. Docker menggunakan arsitektur client-server dimana client berkomunikasi dengan docker daemon. Docker memungkinkan penyimpanan docker image di docker registry dan membuat serta menjalankan container dari image tersebut. Volume digunakan untuk berbagi data antara container dan sistem file.
Get hands-on with security features and best practices to protect your containerized services. Learn to push and verify signed images with Docker Content Trust, and collaborate with delegation roles. Intermediate to advanced level Docker experience recommended, participants will be building and pushing with Docker during the workshop.
Led By Docker Security Experts:
Riyaz Faizullabhoy
David Lawrence
Viktor Stanchev
Experience Level: Intermediate to advanced level Docker experience recommended
July OpenNTF Webinar - HCL Presents Keep, a new API for DominoHoward Greenberg
In 2019 the HCL Labs reimagined how a REST API for Domino should look like. The initial prototype was shared with selected customers and partner. Based on the feedback, Project KEEP will ship together with Domino.
KEEP allows applications to interact with Domino servers using simple HTTP calls directly from a browser, desktop or mobile app, or with a application server in the middle. To make this API accessible to a large audience open standards like OpenAPI or JWT were chosen over propriety implementations.
This session will introduce KEEP and the design principles and use cases. Data security and ease of use will be highlighted. Warm up your Postman clients and curl command lines and follow along!
The presenters for this session will be Stephan Wissel and Paul Withers from HCL.
This document provides an overview of Docker, including what it is, how it compares to virtual machines and containers, its architecture and features. It discusses that Docker virtualizes using lightweight Linux containers rather than full virtual machines, and how this provides benefits like smaller size and faster performance compared to VMs. It also covers Docker's components like the Docker Engine, Hub and images, and how Docker can be used to develop, ship and run applications on any infrastructure.
This document discusses ONOS's intent framework, including:
- Built-in intents like HostToHost and PointToPoint intents
- Intent compilers that compile intents into installable rules
- The intent service that manages intents by submitting, withdrawing, and purging them
- How to use intents in an ONOS application by creating an intent object and submitting it to the intent service
Writing native bindings to node.js in C++nsm.nikhil
The document provides an overview of how to build a C/C++ link to the V8 JavaScript engine and Node.js in order to use C/C++ libraries and functions in Node.js. It discusses topics like initializing V8, handling handles, injecting primitives, defining functions and objects, adding methods, asynchronous I/O, and linking external libraries. Code examples are provided for basic functions, objects, inheritance using ObjectWrap, and asynchronous functions.
This document discusses hacking and securing iOS applications. It begins by covering iOS security concepts and loopholes, then discusses how those loopholes can affect apps and allow easy theft of app data. The remainder of the document provides guidance on how to protect apps by securing local storage locations, runtime analysis, and transport security. Key recommendations include encrypting sensitive data, using data protection APIs, restricting access to private data, and properly validating SSL certificates.
This document discusses building a microservices system to handle 500,000 concurrent users (CCU). It outlines monitoring and distributed tracing using OpenCensus and Jaeger to understand performance. It also describes migrating an existing monolith application to microservices using gRPC and Protocol Buffers for inter-service communication. Finally, it discusses using Istio for service mesh capabilities like control plane, dynamic routing, and failure recovery in the distributed microservices architecture deployed on Kubernetes.
This document provides an overview of a hands-on workshop on the Constrained Application Protocol (CoAP). It outlines the agenda which includes introductions to CoAP, the Californium CoAP framework, and hands-on projects. Attendees will work through example CoAP client and server code using the Californium libraries and test their implementations. Advanced CoAP topics like security, proxies, and resource directories are also discussed.
Decoupling your application using Symfony Messenger and eventshmmonteiro
The document discusses decoupling applications using Symfony Messenger and events based on domain-driven design principles. It covers domain-driven design concepts like bounded contexts, aggregates, and domain events. It then explains how to implement domain events in Symfony using UUIDs, an outbox pattern for publishing events, and consuming events from other services. Symfony Messenger is presented as a way to decouple applications using a command bus and middleware while publishing events to transports like Redis.
This chapter on PL/SQL programming introduces PL/SQL language fundamentals and basics with brief knowledge about its evolution and advantages.Practitioners Guide contains examples on the PL/SQL concepts explained in the slides.
This document discusses a term paper on micro assemblers. It begins with an introduction that defines a micro assembler as a program that helps prepare microcode to control low-level computer operations, similar to how an assembler prepares code for a processor. It then discusses assembly language, assemblers, microassemblers, micro assembly language, applications and benefits of microassemblers in 3 paragraphs or less.
Get hands-on with security features and best practices to protect your containerized services. Learn to push and verify signed images with Docker Content Trust, and collaborate with delegation roles. Intermediate to advanced level Docker experience recommended, participants will be building and pushing with Docker during the workshop.
Led By Docker Security Experts:
Riyaz Faizullabhoy
David Lawrence
Viktor Stanchev
Experience Level: Intermediate to advanced level Docker experience recommended
July OpenNTF Webinar - HCL Presents Keep, a new API for DominoHoward Greenberg
In 2019 the HCL Labs reimagined how a REST API for Domino should look like. The initial prototype was shared with selected customers and partner. Based on the feedback, Project KEEP will ship together with Domino.
KEEP allows applications to interact with Domino servers using simple HTTP calls directly from a browser, desktop or mobile app, or with a application server in the middle. To make this API accessible to a large audience open standards like OpenAPI or JWT were chosen over propriety implementations.
This session will introduce KEEP and the design principles and use cases. Data security and ease of use will be highlighted. Warm up your Postman clients and curl command lines and follow along!
The presenters for this session will be Stephan Wissel and Paul Withers from HCL.
This document provides an overview of Docker, including what it is, how it compares to virtual machines and containers, its architecture and features. It discusses that Docker virtualizes using lightweight Linux containers rather than full virtual machines, and how this provides benefits like smaller size and faster performance compared to VMs. It also covers Docker's components like the Docker Engine, Hub and images, and how Docker can be used to develop, ship and run applications on any infrastructure.
This document discusses ONOS's intent framework, including:
- Built-in intents like HostToHost and PointToPoint intents
- Intent compilers that compile intents into installable rules
- The intent service that manages intents by submitting, withdrawing, and purging them
- How to use intents in an ONOS application by creating an intent object and submitting it to the intent service
Writing native bindings to node.js in C++nsm.nikhil
The document provides an overview of how to build a C/C++ link to the V8 JavaScript engine and Node.js in order to use C/C++ libraries and functions in Node.js. It discusses topics like initializing V8, handling handles, injecting primitives, defining functions and objects, adding methods, asynchronous I/O, and linking external libraries. Code examples are provided for basic functions, objects, inheritance using ObjectWrap, and asynchronous functions.
This document discusses hacking and securing iOS applications. It begins by covering iOS security concepts and loopholes, then discusses how those loopholes can affect apps and allow easy theft of app data. The remainder of the document provides guidance on how to protect apps by securing local storage locations, runtime analysis, and transport security. Key recommendations include encrypting sensitive data, using data protection APIs, restricting access to private data, and properly validating SSL certificates.
This document discusses building a microservices system to handle 500,000 concurrent users (CCU). It outlines monitoring and distributed tracing using OpenCensus and Jaeger to understand performance. It also describes migrating an existing monolith application to microservices using gRPC and Protocol Buffers for inter-service communication. Finally, it discusses using Istio for service mesh capabilities like control plane, dynamic routing, and failure recovery in the distributed microservices architecture deployed on Kubernetes.
This document provides an overview of a hands-on workshop on the Constrained Application Protocol (CoAP). It outlines the agenda which includes introductions to CoAP, the Californium CoAP framework, and hands-on projects. Attendees will work through example CoAP client and server code using the Californium libraries and test their implementations. Advanced CoAP topics like security, proxies, and resource directories are also discussed.
Decoupling your application using Symfony Messenger and eventshmmonteiro
The document discusses decoupling applications using Symfony Messenger and events based on domain-driven design principles. It covers domain-driven design concepts like bounded contexts, aggregates, and domain events. It then explains how to implement domain events in Symfony using UUIDs, an outbox pattern for publishing events, and consuming events from other services. Symfony Messenger is presented as a way to decouple applications using a command bus and middleware while publishing events to transports like Redis.
This chapter on PL/SQL programming introduces PL/SQL language fundamentals and basics with brief knowledge about its evolution and advantages.Practitioners Guide contains examples on the PL/SQL concepts explained in the slides.
This document discusses a term paper on micro assemblers. It begins with an introduction that defines a micro assembler as a program that helps prepare microcode to control low-level computer operations, similar to how an assembler prepares code for a processor. It then discusses assembly language, assemblers, microassemblers, micro assembly language, applications and benefits of microassemblers in 3 paragraphs or less.
This document is the developer's guide for CobolScript, a programming language for developing web-based systems and applications. It provides an overview of CobolScript features like internet commands for file transfers and email, file processing commands, and TCP/IP socket programming commands. The guide also covers installing CobolScript, which is available on Windows, Linux, SunOS and FreeBSD platforms. Programs developed in CobolScript can be ported across platforms.
This document provides an introduction to PL/SQL, including:
- What PL/SQL is and advantages over SQL such as programming capabilities and error handling
- Generic structure of a PL/SQL block with declare, begin, exception sections
- PL/SQL execution environment and how SQL statements are passed to Oracle engine
- Data types in PL/SQL including numbers, characters, dates, collections and LOB types
- Control structures like conditional (IF/THEN) and iterative (LOOP) statements
This document provides an introduction to creating a new language for a Service Creation Environment (SCE) using Sixlabs' Generador de Ambientes de Alta Productividad (GAAP). It discusses key concepts for building an SCE like properties, dialogs, entities and functional code. It also covers the tradeoff between productivity and flexibility in entity design. The document then demonstrates creating a new Logo language for an SCE, including defining entities, creating dialogs and generating functional code templates using XSLT.
This document provides release notes and supplementary information for Delphi 7. It notes that some components have been deprecated and recommends newer alternatives. It also describes changes made to string handling functions, warnings added by the compiler, and issues fixed in streaming of subcomponents. Finally, it provides notes on various other topics like Apache, UDDI, Windows XP input, and databases.
PL/SQL is Oracle's procedural language extension to SQL that allows users to use SQL statements to manipulate Oracle data and use control flow statements to process the data. PL/SQL code can be executed on the Oracle server or Oracle client. The code is made up of a declare, executable, and exception handling section. Variables, constants, cursors and other objects are declared in the declare section. Code to manipulate the declared objects is written in the executable section. Exception handling code is written in the exception handling section.
The document discusses Office Open XML, the file format used in Microsoft Office 2007. It provides an overview of OOXML, including its structure as a zip file containing XML files for different content types like documents, spreadsheets, presentations. It also discusses OpenOffice.org's implementation of an OOXML importer through a native filter being developed jointly with Novell. The filter uses a fast SAX parser and works within OpenOffice.org's data model to handle the different OOXML document types.
Oracle E-Business Suite Custom Library New LookDonald Ferreira
This document summarizes a presentation about restructuring and simplifying an Oracle E-Business Suite 11i custom library. The new structure would divide the custom library into modular libraries based on Oracle application areas like receivables, payables, and general ledger. It would also create common reusable libraries. This is intended to make the custom library easier to use, maintain, and develop while enforcing standards and sharing knowledge within the team.
This document provides an introduction to Cocoon 2, an open-source Java framework for dynamically publishing XML content using XSLT transformations. It discusses installing and configuring Cocoon 2 and the Tomcat servlet engine. The key points are:
- Cocoon 2 uses a sitemap configuration file to separate processing logic from content, improving flexibility.
- Installing Tomcat only requires extracting its distribution. Cocoon 2 can then be deployed by copying its WAR file to Tomcat's webapps directory.
- Alternatively, developers can check out Cocoon's source code from CVS to build it locally.
Watch Re-runs on your SQL Server with RML Utilitiesdpcobb
RML Utilities provide command line tools and interactive reports enabling you to:
Take SQL trace files (captured with SQL Profiler, sp_trace or extended events in SQL 2012+),
Process them into replayable RML files (using readtrace.exe),
Play them back in a different SQL environment (using ostress.exe),
And compare the performance at a granular level (using reporter.exe or custom queries).
Esbuild is an extremely fast JavaScript bundler. It works as both a compiler and transpiler, taking JavaScript source code as input and producing bundled output files. Traditionally, JavaScript modules had issues with installability, being scoped, and importability between modules. This led the JavaScript community to develop solutions like CommonJS, namespaces, module wrapping, and bundlers like Browserify, Webpack, Rollup, and Esbuild which address these issues by allowing code reuse through imports and exports. Esbuild is highlighted as a very fast bundler due to benchmark tests showing its faster performance compared to alternatives. The presentation demonstrates how to use Esbuild to bundle JavaScript code.
This presentation discusses the most neglected quality axis : code documentation. See good and bad examples, best practices on documenting code and why you should try not to ignore it :)
Presentation date: 2014-11-28
Place: Thessaloniki Java Meetup Group (SKG)
This document contains instructions for three labs using Intel MKL on an Intel Xeon Phi coprocessor. Lab 1 demonstrates matrix multiplication using MKL's SGEMM and automatic offload. Lab 2 uses MKL's FFT functions with offload pragmas. Lab 3 runs a LINPACK benchmark natively on the coprocessor. The labs exercise different usage modes of MKL and optimization techniques like affinity settings.
Code That Writes Code : Automatic Programming for NHibernateDeepak Sahu
This white paper explores the power of automatic programming and its application on NHibernate Technology, allowing human-programmers to write their code on a higher level of abstraction ensuring homogenous and Error-Free code.
Tracking down redundant code and implementing a generic algorithm that generates such code is the Key factor in Automatic-Programming.
It takes sole discretion and independent judgement of the Developer to trace similar code-patterns in their application and making all efforts in reducing the overall Project-Development-Time by automating such process.
This document discusses the Module File Cache (MFC) feature of NonStop SQL/MX, which provides a persistent cache for SQL statements beyond what is possible with the internal SQL/MX query cache. MFC caches compiled SQL statements on disk for reuse across connections and application instances. It works with the JDBC and ODBC drivers to improve performance by avoiding recompilation of statements that have already been compiled and cached in MFC modules on disk. The document covers how MFC is organized, best practices for its use, and some current limitations.
A user guide that introduces a new User Interface to HPE NonStop SQL/MX DBS.
SQL/MX DBS is a solution that provides a multi-tenant database environment where the databases are isolated from each other while still sharing common resources such as compute power, storage, and network capacity. However, while the databases share the storage, each database uses dedicated, unshared, devices which prevents them from encountering database bottlenecks such as database cache and lock-space. Cache and lock space are part of the NonStop SQL Data Access Managers which are dedicated to only one database and not shared with others.
Many customers of NonStop SQL/MP are using the SQL/MX engine to access the data that is stored in SQL/MP tables. They enjoy the features of ANSI DML and use the JDBC drivers in Java programs and ODBC drivers for off-platform applications written in other languages.
This document summarizes the advantages of using the NonStop SQL/MX native tables. It is intended for architects, designers, developers of applications written for or being ported to NonStop Servers as well as database administrators (DBAs) that manage SQL/MP or SQL/MX databases.
NonStop SQL/MX DBS demo with iTP WebserverFrans Jongma
This is a step-by-step overview of NonStop SQL/MX Database Services can be used to quickly provision a database and some additional functions. The demo was created using a few very simple HTML pages that invoke the DBS interface.
The eBITUG 2017 presentation that provides and overview of DBaaS capabilities delivered by NonStop SQL/MX. It also shows how DBS simplifies provision of databases and facilitates automation. It supports virtualized as well as regular NonStop X86-based systems.
Understanding NonStop SQLMX SDA and its impact on performanceFrans Jongma
This paper describes how the Session Data Area (SDA) is used and how its configuration affects performance. The
area is reserved on a session basis and query fragments of a session can only be reused by the same session. It differs in this from the database data cache in DP2, which is shared by all
clients. Because the area is a shared resource and the amount of data is limited, it is advised to track its usage and where possible, adjust the size of the area to the amount of sessions.
Many customers of NonStop SQL/MP are using the SQL/MX engine to access the data that is stored in SQL/MP tables. They enjoy the features of ANSI DML and use the JDBC drivers in Java programs and ODBC drivers for off-platform applications written in other languages.
This document summarizes the advantages of using the NonStop SQL/MX native tables. It is intended for architects, designers, developers of applications written for or being ported to NonStop Servers as well as database administrators (DBAs) that manage SQL/MP or SQL/MX databases.
Concepts of NonStop SQL/MX: Part 2 - Introduction to catalogs and other objectsFrans Jongma
Series of articles written for DBA’s and developers who know Oracle and want to learn about NonStop SQL/MX. Useful for people who know NonStop, and would like to know about similarities and differences between the two products.
Concepts of NonStop SQL/MX: Part 3 - Introduction to MetadataFrans Jongma
Series of articles written for DBA’s and developers who know Oracle and want to learn about NonStop SQL/MX. Useful for people who know NonStop, and would like to know about similarities and differences between the two products.
Liberarsi dai framework con i Web Component.pptxMassimo Artizzu
In Italian
Presentazione sulle feature e l'utilizzo dei Web Component nell sviluppo di pagine e applicazioni web. Racconto delle ragioni storiche dell'avvento dei Web Component. Evidenziazione dei vantaggi e delle sfide poste, indicazione delle best practices, con particolare accento sulla possibilità di usare web component per facilitare la migrazione delle proprie applicazioni verso nuovi stack tecnologici.
Measures in SQL (SIGMOD 2024, Santiago, Chile)Julian Hyde
SQL has attained widespread adoption, but Business Intelligence tools still use their own higher level languages based upon a multidimensional paradigm. Composable calculations are what is missing from SQL, and we propose a new kind of column, called a measure, that attaches a calculation to a table. Like regular tables, tables with measures are composable and closed when used in queries.
SQL-with-measures has the power, conciseness and reusability of multidimensional languages but retains SQL semantics. Measure invocations can be expanded in place to simple, clear SQL.
To define the evaluation semantics for measures, we introduce context-sensitive expressions (a way to evaluate multidimensional expressions that is consistent with existing SQL semantics), a concept called evaluation context, and several operations for setting and modifying the evaluation context.
A talk at SIGMOD, June 9–15, 2024, Santiago, Chile
Authors: Julian Hyde (Google) and John Fremlin (Google)
https://doi.org/10.1145/3626246.3653374
Superpower Your Apache Kafka Applications Development with Complementary Open...Paul Brebner
Kafka Summit talk (Bangalore, India, May 2, 2024, https://events.bizzabo.com/573863/agenda/session/1300469 )
Many Apache Kafka use cases take advantage of Kafka’s ability to integrate multiple heterogeneous systems for stream processing and real-time machine learning scenarios. But Kafka also exists in a rich ecosystem of related but complementary stream processing technologies and tools, particularly from the open-source community. In this talk, we’ll take you on a tour of a selection of complementary tools that can make Kafka even more powerful. We’ll focus on tools for stream processing and querying, streaming machine learning, stream visibility and observation, stream meta-data, stream visualisation, stream development including testing and the use of Generative AI and LLMs, and stream performance and scalability. By the end you will have a good idea of the types of Kafka “superhero” tools that exist, which are my favourites (and what superpowers they have), and how they combine to save your Kafka applications development universe from swamploads of data stagnation monsters!
14 th Edition of International conference on computer visionShulagnaSarkar2
About the event
14th Edition of International conference on computer vision
Computer conferences organized by ScienceFather group. ScienceFather takes the privilege to invite speakers participants students delegates and exhibitors from across the globe to its International Conference on computer conferences to be held in the Various Beautiful cites of the world. computer conferences are a discussion of common Inventions-related issues and additionally trade information share proof thoughts and insight into advanced developments in the science inventions service system. New technology may create many materials and devices with a vast range of applications such as in Science medicine electronics biomaterials energy production and consumer products.
Nomination are Open!! Don't Miss it
Visit: computer.scifat.com
Award Nomination: https://x-i.me/ishnom
Conference Submission: https://x-i.me/anicon
For Enquiry: Computer@scifat.com
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...XfilesPro
Wondering how X-Sign gained popularity in a quick time span? This eSign functionality of XfilesPro DocuPrime has many advancements to offer for Salesforce users. Explore them now!
Transforming Product Development using OnePlan To Boost Efficiency and Innova...OnePlan Solutions
Ready to overcome challenges and drive innovation in your organization? Join us in our upcoming webinar where we discuss how to combat resource limitations, scope creep, and the difficulties of aligning your projects with strategic goals. Discover how OnePlan can revolutionize your product development processes, helping your team to innovate faster, manage resources more effectively, and deliver exceptional results.
Orca: Nocode Graphical Editor for Container OrchestrationPedro J. Molina
Tool demo on CEDI/SISTEDES/JISBD2024 at A Coruña, Spain. 2024.06.18
"Orca: Nocode Graphical Editor for Container Orchestration"
by Pedro J. Molina PhD. from Metadev
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
React.js, a JavaScript library developed by Facebook, has gained immense popularity for building user interfaces, especially for single-page applications. Over the years, React has evolved and expanded its capabilities, becoming a preferred choice for mobile app development. This article will explore why React.js is an excellent choice for the Best Mobile App development company in Noida.
Visit Us For Information: https://www.linkedin.com/pulse/what-makes-reactjs-stand-out-mobile-app-development-rajesh-rai-pihvf/
Consistent toolbox talks are critical for maintaining workplace safety, as they provide regular opportunities to address specific hazards and reinforce safe practices.
These brief, focused sessions ensure that safety is a continual conversation rather than a one-time event, which helps keep safety protocols fresh in employees' minds. Studies have shown that shorter, more frequent training sessions are more effective for retention and behavior change compared to longer, infrequent sessions.
Engaging workers regularly, toolbox talks promote a culture of safety, empower employees to voice concerns, and ultimately reduce the likelihood of accidents and injuries on site.
The traditional method of conducting safety talks with paper documents and lengthy meetings is not only time-consuming but also less effective. Manual tracking of attendance and compliance is prone to errors and inconsistencies, leading to gaps in safety communication and potential non-compliance with OSHA regulations. Switching to a digital solution like Safelyio offers significant advantages.
Safelyio automates the delivery and documentation of safety talks, ensuring consistency and accessibility. The microlearning approach breaks down complex safety protocols into manageable, bite-sized pieces, making it easier for employees to absorb and retain information.
This method minimizes disruptions to work schedules, eliminates the hassle of paperwork, and ensures that all safety communications are tracked and recorded accurately. Ultimately, using a digital platform like Safelyio enhances engagement, compliance, and overall safety performance on site. https://safelyio.com/
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid
IBM watsonx Code Assistant for Z, our latest Generative AI-assisted mainframe application modernization solution. Mainframe (IBM Z) application modernization is a topic that every mainframe client is addressing to various degrees today, driven largely from digital transformation. With generative AI comes the opportunity to reimagine the mainframe application modernization experience. Infusing generative AI will enable speed and trust, help de-risk, and lower total costs associated with heavy-lifting application modernization initiatives. This document provides an overview of the IBM watsonx Code Assistant for Z which uses the power of generative AI to make it easier for developers to selectively modernize COBOL business services while maintaining mainframe qualities of service.
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Paul Brebner
Closing talk for the Performance Engineering track at Community Over Code EU (Bratislava, Slovakia, June 5 2024) https://eu.communityovercode.org/sessions/2024/why-apache-kafka-clusters-are-like-galaxies-and-other-cosmic-kafka-quandaries-explored/ Instaclustr (now part of NetApp) manages 100s of Apache Kafka clusters of many different sizes, for a variety of use cases and customers. For the last 7 years I’ve been focused outwardly on exploring Kafka application development challenges, but recently I decided to look inward and see what I could discover about the performance, scalability and resource characteristics of the Kafka clusters themselves. Using a suite of Performance Engineering techniques, I will reveal some surprising discoveries about cosmic Kafka mysteries in our data centres, related to: cluster sizes and distribution (using Zipf’s Law), horizontal vs. vertical scalability, and predicting Kafka performance using metrics, modelling and regression techniques. These insights are relevant to Kafka developers and operators.
WMF 2024 - Unlocking the Future of Data Powering Next-Gen AI with Vector Data...Luigi Fugaro
Vector databases are transforming how we handle data, allowing us to search through text, images, and audio by converting them into vectors. Today, we'll dive into the basics of this exciting technology and discuss its potential to revolutionize our next-generation AI applications. We'll examine typical uses for these databases and the essential tools
developers need. Plus, we'll zoom in on the advanced capabilities of vector search and semantic caching in Java, showcasing these through a live demo with Redis libraries. Get ready to see how these powerful tools can change the game!
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISTier1 app
Are you ready to unlock the secrets hidden within Java thread dumps? Join us for a hands-on session where we'll delve into effective troubleshooting patterns to swiftly identify the root causes of production problems. Discover the right tools, techniques, and best practices while exploring *real-world case studies of major outages* in Fortune 500 enterprises. Engage in interactive lab exercises where you'll have the opportunity to troubleshoot thread dumps and uncover performance issues firsthand. Join us and become a master of Java thread dump analysis!
WWDC 2024 Keynote Review: For CocoaCoders AustinPatrick Weigel
Overview of WWDC 2024 Keynote Address.
Covers: Apple Intelligence, iOS18, macOS Sequoia, iPadOS, watchOS, visionOS, and Apple TV+.
Understandable dialogue on Apple TV+
On-device app controlling AI.
Access to ChatGPT with a guest appearance by Chief Data Thief Sam Altman!
App Locking! iPhone Mirroring! And a Calculator!!
How Can Hiring A Mobile App Development Company Help Your Business Grow?ToXSL Technologies
ToXSL Technologies is an award-winning Mobile App Development Company in Dubai that helps businesses reshape their digital possibilities with custom app services. As a top app development company in Dubai, we offer highly engaging iOS & Android app solutions. https://rb.gy/necdnt
How Can Hiring A Mobile App Development Company Help Your Business Grow?
Introduction to embedded sql for NonStop SQL
1. An introduction to Embedded
SQL for NonStop SQL/MX
Frans Jongma,
Hewlett Packard Enterprise
Advanced Technology Center
NonStop Enterprise Division
Version 1.0
Date: October 11, 2019
Contents
Introduction................................................................................................................................ 2
Audience ................................................................................................................................ 2
Assumptions........................................................................................................................... 2
Best practice........................................................................................................................... 3
From source to executable......................................................................................................... 3
Preprocessing and compilation............................................................................................... 3
Example 1, simple...................................................................................................................... 3
Downside of simple example.................................................................................................. 4
Example 2, managed module location ....................................................................................... 4
Controlling the module names................................................................................................ 5
Controlling schema names ..................................................................................................... 6
Example 3, schema flexibility ..................................................................................................... 6
Example 4, combined module control and schema flexibility...................................................... 8
Examine execution plans ........................................................................................................... 9
Summary ..................................................................................................................................10
References............................................................................................................................10
Appendix...................................................................................................................................11
COBOL Compilation process flow .........................................................................................11
C C++ Compilation process flow............................................................................................12
Simple example verbose output.............................................................................................13
Example 1 COBOL source code............................................................................................14
2. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -2-
Introduction
3GL languages such as COBOL and C have a specific SQL syntax that is translated by a
preprocessor into native calls to the database before the language and SQL compilers execute
and produce an executable program. This method is referred to as embedded SQL or static
SQL and differs from the more dynamic ways that is used in ODBC or JDBC programs, where
the statements are compiled as needed when the program executes. The SQL execution plans
that are created by a post-compilation step (the SQL compile) are stored by SQL/MX in so-
called module files separated from the executable program.
There are many options in creating and managing programs and module files, all of them are
listed in the SQL/MX Programming Manual for C and COBOL. However, for a first time user,
this amount of information may be overwhelming and confusing. This document will provide an
introduction to give users a fast start.
Audience
The paper is written for users who are new to NonStop SQL/MX and need to develop programs
in C or COBOL. The audience includes NonStop users that are familiar with NonStop SQL/MP
and how SQL/MP supports embedded SQL.
Assumptions
I assume the natural environment for NonStop SQL/MX, operation in the OSS operating
environment. While SQL/MX supports the Guardian environment, for ease of use and
understanding, it is not my recommended environment.
The examples show examples in COBOL, however since the method to compile is the same
between COBOL and C, C/C++ developers will find it useful too. The difference in compilers is
listed in the table below. The process flows are listed in the sections COBOL Compilation
process flow and C C++ Compilation process flow in the Appendix.
COBOL C/C++
SQL/MX Host language
precompiler
mxsqlco mxsqlc
Host language compiler xcobol or ecobol for J-series
software releases
c89
SQL/MX SQL Compiler mxCompileUserModule mxCompileUserModule
3. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -3-
Best practice
Naming tables and views in the source programs may best be done without qualifying them to a
dedicated catalog and schema. It is a better option to set the catalog and schema at a central
place in the source program with a DECLARE CATALOG or DECLARE SCHEMA statement. It
is also possible to define the catalog or schema as compiler options for the ultimate flexibility.
From source to executable
Host language source code uses SQL with a specific syntax called embedded SQL. These
statements are identified by the begin and end tags EXEC SQL and END-EXEC.
Some examples of embedded SQL are shown below. They show definition of variables used by
the program in the DECLARE section of the programs and an example of a SQL DML
statement.
EXEC SQL BEGIN DECLARE SECTION.
EXEC SQL INVOKE PARTS END-EXEC.
EXEC SQL END DECLARE SECTION.
EXEC SQL SELECT * FROM PARTS WHERE …… END-EXEC.
The statements between these tags, are processed by a SQL/MX preprocessor and translated
into host language (COBOL or C) statements, and these will be translated into machine code by
the standard COBOL and C compilers.
Preprocessing and compilation
The SQL/MX preprocessor takes a source input file, and produces a language source file that is
in turn the input for the language processor which produces an object file. This object can be a
load module or an executable object, depending on the type of program.
The SQL statements are processed by the SQL compiler, which uses the database metadata
and table statistics to produce an execution plan. This execution plan is stored in a module file
on disk. The executable program includes references to this module file (generated by the
preprocessor), such that when a program is executed, the corresponding modules can be
loaded to obtain and execute the execution plan.
Example 1, simple
The simplest way to compile a program is by invoking the language compiler which uses
definitions in the program and some defaults to produce the executable and the module file.
4. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -4-
Let’s look at the following example, which compiles a COBOL source code1
sampl.ecob into
an executable called sampl. The xcobol compiler will invoke the necessary compiler programs,
based on the execution options
xcobol –Wsqlmx –Wmxcmp sampl.ecob –o sampl -Wverbose
The –Wsqlmx option tells the compiler that the program contains SQL/MX embedded SQL,
and so it will launch the SQ/MX COBOL preprocessor mxsqlco.
The –Wmxcmp option tells the compiler that the generated object (sampl) needs to be
processed by the SQL/MX compilers mxCompileUserModule and mxcmp.
The –Wverbose option causes the individual steps to be listed. It shows all the steps of the
compilation process and is listed in the appendix Simple example verbose output.
With this simple command, the generated modules will be stored in the default module directory,
/usr/tandem/sqlmx/USERMODULES. While it is nice to have a default place for all the
modules, the downside of the simple compilation is a single directory filled with many modules.
Downside of simple example
The SQL compiler will generate unique module files unless instructed by either compiler options
or an embedded SQL statement that defines the name of the module. An example of a default
module name is FRANS.PERF.SQLMX_DEFAULT_MODULE_259723530653478123. The
SQL preprocessor includes a catalog and schema name (in this case, FRANS.PERF) in the
name of the generated module. A subsequent compilation of the program will create a new
module, which means that the default USERMODULES directory will contain many modules
very quickly. There are ways to get a better control over the name of the module and the
location it is stored in as is shown in the next examples.
Example 2, managed module location
The simple one-step example will create all modules in the same location. A better option is to
co-locate the modules with the executables or to place them in separate directories. This can be
done by executing the SQL compile step as a separate one after the language compilation.
Such a 2-step compilation is shown below. Note, the –Wverbose option omitted in the
following examples.
xcobol -Wsqlmx sampl.ecob -o sampl
mxCompileUserModule -g moduleLocal sampl
1 The source code is listed in the appendix of this paper.
5. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -5-
The mxCompileUserModule program invokes the SQL/MX compiler and will now create a
module in the local directory due to the –g moduleLocal option. It is even possible to
specify a specific directory to place the modules. That is useful, however, it requires that this
directory needs to be defined in an environment variable when the program is executed or else
the module will not be found. The environment variable, called _MX_MODULE_SEARCH_PATH,
is used as a search path and needs to contain the names of the directories to search for
modules, similar to the PATH and CLASSPATH variables. This paper will use discuss co-
located modules, where program and module are placed in the same directory.
Controlling the module names
Automatically generated module names are easy for a developer, but it will burden a system
administrator with the task of removing stale modules2
. It may therefore be better to explicitly
name the modules and let SQL/MX add the catalog and schema names to the name, since it is
useful to know to which schema a module belongs.
With the simple 2-step example, the module name can be defined with a DECLARE MODULE
statement in the program source. The example also uses DECLARE statements to define the
catalog and schema that the program will use.
The name of the module is defined along with the other data fields, while the catalog and
schema are defined later in the PROCEDURE DIVISION of the program.
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
* The MODULE statement will cause a module created
* named <cat>.<sch>.SAMPL in the module directory
EXEC SQL MODULE "SAMPL" END-EXEC.
….. data definitions
…..
PROCEDURE DIVISION.
…..
EXEC SQL DECLARE CATALOG 'frans' END-EXEC.
EXEC SQL DECLARE SCHEMA 'perf' END-EXEC.
When this code is compiled, a module called FRANS.PERF.SAMPL is created, either in the
default (global) directory, or in the local directory if the moduleLocal option is used. When
2 Note: The mxci command DISPLAY USE OF SOURCE [‘module name’] will show the source file
belonging to this module. In case of stale modules, multiple modules will be referring to the same source
file. See the SQL/MX Reference Manual for information about the DISPLAY USE OF …. Command.
6. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -6-
the program is subsequently recompiled, this module will be replaced and no stale modules will
exist, unless the program is removed without removing the corresponding module.
Controlling schema names
The SQL/MX precompiler creates the name of the module, which includes the catalog and
schema name. The DECLARE MODULE statement contains only the part of the name without
catalog and schema. The desired catalog and schema name to name the module can be
passed to the language compiler with the –WmoduleSchema=<cat.schema> option.
xcobol -Wsqlmx -WmoduleSchema=frans.perf sampl.ecob -o sampl
mxCompileUserModule -g moduleLocal sampl
Catalog and schema are SQL identifiers and are used in uppercase by SQL/MX3
. After these
two steps, a module with the name FRANS.PERF.SAMPLE is created in the current directory
along with the sampl executable.
Example 3, schema flexibility
To further improve, the source program can be made independent of the schema4
that is used.
The next example shows how to compile the program with the possibility to create modules in a
different schema (for example when moving from development to test to production) without
having to recompile from scratch. This allows the compiled program to be moved from one
system to another, only SQL-compiling the module to the target database environment.
In the previous examples, we let the source program define the schema with a DECLARE
SCHEMA statement. To provide schema flexibility, omit the DECLARE CATALOG and
DECLARE SCHEMA statements. This however means that the precompiler must be executed
as a separate step, because it needs another parameter that the language compiler does not
pass. This parameter is invokeSchema, which is used when EXEC SQL INVOKE is used to
import the column definitions from the database, which is used to make sure that a program
uses the correct column definitions.
The program sampl3 uses the INVOKE statement to obtain the column definitions of the PARTS
table, but does not declare the schema.
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
EXEC SQL MODULE "SAMPL" END-EXEC.
3 It is possible to use mixed case and special characters in SQL/MX, by enclosing them in double quotes.
I consider it bad practice and will not discuss it here.
4 For readability, I use the term schema as the combination of catalog and schema.
7. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -7-
* Get the record layout of PARTS
EXEC SQL INVOKE PARTS END-EXEC.
….. data definitions
…..
PROCEDURE DIVISION.
…..
* In reality, these lines are not present in the source.
* EXEC SQL DECLARE CATALOG 'frans' END-EXEC.
* EXEC SQL DECLARE SCHEMA 'perf' END-EXEC.
…..
To compile the program we use three steps, the preprocessor, the language processor and the
SQL compiler. The precompiler for COBOL, mxsqlco, uses value of moduleSchema to
create the name of the module and the –Q invokeSchema value to retrieve the record
definition of the PARTS table. And produces the generated COBOL source in sampl3.cbl. This
is input to the language compiler.
mxsqlco -g moduleSchema=frans.perf -Q invokeSchema=frans.perf
sampl3.ecob
xcobol -Wsqlmx -o sampl3 sampl3.cbl
mxCompileUserModule -g moduleLocal –d schema=frans.perf sampl3
The final step, mxCompileUserModule, creates the modules locally (this means they are
not created I the SQL/MX USERMODULES directory), and uses the schema name to get the
information it needs to compile an execution plan.
The next sequence of events show how the program can be targeted to use a new schema. In
this example, a row will be inserted in the PERF.PARTS table, but it will fail on a duplicate key
exception. The program shows the full name of the table, which includes the schema it
accesses. Then the only the module is recompiled to use the HR schema and the program
outpur shows that the same business code in sampl3 will access the HR.PARTS table.
~/compile> ./sampl3
This example uses a static cursor.
Enter lowest part number to be retrieved:
11
sqlerrors: 23000, -000008102
Table : FRANS.PERF.PARTS
Column :
SQLSTATE: 23000
Message : *** ERROR[8102] The operation is prevented by a
primary key PARTS_564349585_9263 on table FRANS.PERF.PARTS.
8. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -8-
Create a module to use the frans.HR schema.
~/compile> mxCompileUserModule -g moduleLocal -d schema=frans.HR
sampl3
Run the same executable
~/compile> ./sampl3
This example uses a static cursor.
Enter lowest part number to be retrieved:
11
sqlerrors: 23000, -000008102
Table : FRANS.HR.PARTS
Column :
SQLSTATE: 23000
Message : *** ERROR[8102] The operation is prevented by a
primary key PARTS_118992335_3782 on table FRANS.HR.PARTS.
~/compile>
This example shows the method to move binary programs from one system to another and only
the module files need to be recompiled on the target database.
Note however, that this example uses a module called FRANS.PERF.SAMPL even though it
can access the PARTS table in schema PERF or HR. The first two parts of the module name
represent a catalog and schema, however, this is only a convention. The next example shows
how to control the complete module name.
Example 4, combined module control and schema flexibility
In this example, modules have names that do not include a catalog or schema, since the
application business code can run in different environments (for example development, test,
integration and production). Instead, in this example, the catalog and schema parts of the
module name are used for application name and version5
.
Important note: Do not use special characters (especially period) in the module name. While
the program may execute fine with such a module, the mxci DISPLAY USE OF commands
expect a three part name, with a “.” as separation character.
5 Including the version number in a module is used as an example of how one might organize modules.
Lifecycle version information might also be kept in source control systems such as git.
9. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -9-
The module directive in the source file (sampl4.ecob) is specified as follows:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
* The MODULE statement will cause a module created named
* MYAPP.V_0_1.SAMPL4 in the module directory
EXEC SQL MODULE "MYAPP"."V_0_1"."SAMPL4" END-EXEC.
To compile the program in three steps:
# Use 2 environment variables to keep things simple:
export P=sampl4
export SCHEMA=FRANS.PERF
# run the three steps
mxsqlco -Q invokeSchema=$SCHEMA $P.ecob
xcobol -Wsqlmx -o $P $P.cbl
mxCompileUserModule -g moduleLocal -d SCHEMA=$SCHEMA $P
SQL compile the module for use on a different schema, use:
mxCompileUserModule -g moduleLocal -d SCHEMA=frans.hr sampl4
Examine execution plans
An advantage of having meaningful names for modules is that they now can be used easily to
examine the generated SQL execution plans. The following EXPLAIN statement shows the
formatted execution plans used by program sampl3.
~/compile> mxci
Hewlett Packard Enterprise NonStop(TM) SQL/MX Conversational Interface 3.6.1
(c) Copyright 2003-2018 Hewlett Packard Enterprise Development LP.
>>EXPLAIN options 'f' '%' from '/home/hp/frans/compile/FRANS.PERF.SAMPL3' ;
Statement: GET_BY_PARTNUM
LC RC OP OPERATOR OPT DESCRIPTION CARD
---- ---- ---- -------------------- -------- -------------------- ---------
2 . 3 root 3.29E+001
1 . 2 partition_access 3.29E+001
. . 1 file_scan fr PARTS (s) 3.29E+001
…. ….
(Other statements omitted)
10. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -10-
Summary
Using a few simple examples we have seen how SQL/MX translates embedded SQL statement
into an executable program and a SQL module file. The examples have been kept very simple,
and do not discuss adding multiple object files that are linked together into an executable
program. The Programming Manual for C and COBOL has the details. This paper will help you
finding the right options for building larger programs.
The module file names can be defined by the user, which has system management advantages.
Using the default location and the default naming scheme will result in a large amount of, often
unused, modules in the /usr/tandem/sqlmx/USERMODULES directory. Decoupling the
program source code from the actually used catalog and schema allow an easy move of objects
between execution environments. In cases where application run on systems with differently
named catalogs or schemas, it is good practice to define module names based on a convention
that is not based on catalog and schema, but on something else, such as application name and
possibly version or subclass of the application.
References
The following manuals can be used to get more detailed information. They are accessible via
the HPE Support Center, for L-series software go to https://hpe.com/info/nonstop-ldocs, and for
J-series software use https://hpe.com/info/nonstop-jdocs.
Some manuals have the release number in the title and not shown in the titles below.
SQL/MX Programming Manual for C and COBOL.
SQL/MX Reference manual.
SQL/MP to SQL/MX Database and Application Migration Guide.
11. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -11-
Appendix
COBOL Compilation process flow
The following diagram shows the compilation steps. This figure was taken from the SQL/MX
Programming C and COBOL manual
12. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -12-
C C++ Compilation process flow
The following diagram shows the compilation steps. This figure was taken from the SQL/MX
Programming C and COBOL manual
14. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -14-
/tmp/AAAqaabWa197661ACICCH
(/usr/tandem/sqlmx/USERMODULES/FRANS.PERF.SQLMX_DEFAULT_MODULE_2597235
31183946022)
0 errors, 0 warnings, 0 statements affected; 17 statements total
1 modules found, 1 modules extracted.
1 mxcmp invocations: 1 succeeded, 0 failed.
xcobol: /usr/tandem/sqlmx/bin/mxCompileUserModule exited, returning 0.
xcobol: Exiting with status 0; 0 error(s).
~/compile>
Example 1 COBOL source code
This sample program is a slightly changed copy of the example from the SQL/MX 3.6
Programming Manual for C and COBOL. The change is the addition of the INSERT statement
right before the cursor is opened. Note that duplicate keys will cause an error, this error is used
to show that the examples can run the same code on different schemas.
* ---------------------------------------------------------------
* compile this program simply in OSS with:
* [x|e]cobol -Wsqlmx -Wmxcmp sampl.ecob -o sampl –Wverbose
*
* Description: Using a Static SQL Cursor
* Statements: Static DECLARE CURSOR
* BEGIN WORK
* OPEN
* FETCH
* Positioned UPDATE
* CLOSE
* COMMIT WORK
* WHENEVER
* GET DIAGNOSTICS
*---------------------------------------------------------------
* Table definition
* CREATE TABLE PARTS
* (
* PARTNUM NUMERIC(4, 0) UNSIGNED NO DEFAULT HEADING
* 'Part/Num' NOT NULL
* , PARTDESC CHAR(18) CHARACTER SET ISO88591 NO
* DEFAULT HEADING 'Part Description' NOT NULL
* , PRICE NUMERIC(8, 2) NO DEFAULT HEADING 'Price'
* NOT NULL
* , QTY_AVAILABLE NUMERIC(5, 0) DEFAULT 0 HEADING
* 'Qty/Avail' NOT NULL
* , ORDER_DATE DATE DEFAULT CURRENT_DATE
* , PRIMARY KEY (PARTNUM ASC)
* )
* ;
* --- SQL operation complete.
*
15. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -15-
IDENTIFICATION DIVISION.
PROGRAM-ID. Program-exF62.
DATA DIVISION.
WORKING-STORAGE SECTION.
* program uses the INVOKE HVs to insert the row
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
* The MODULE statement will cause a module created named
* MYAPP.V_0_1.SAMPL4 in the module directory
* Note that the three part name must follows the rules
* for SQL/MX Catalog,schema, and object, separated by a "."
EXEC SQL MODULE "MYAPP"."V_0_1"."SAMPL4" END-EXEC.
* GET THE CORRECT RECORD LAYOUT
* if the table name is not qualified with cat and schema,
* the preprocessor must be called
* with -Q invokeSchema=cat.sch
*
EXEC SQL INVOKE PARTS END-EXEC.
01 sqlstate pic x(5).
01 sqlcode pic s9(9) comp.
01 hv-partnum pic 9(4) comp.
01 hv-partdesc pic x(18).
01 hv-price pic s9(6)v9(2) comp.
01 hv-qty-available pic s9(7) comp.
* in SQL/MP the date column is declared as PIC X(10) ,
* and the insert uses the TYPE AS DATE clause when inserting a row
* SQL/MX however supports (and needs) the column defined as DATE,
* the INSERT statment does not require the non-ANSI TYPE AS construct.
01 hv-order-date DATE value "2019-09-12".
* hv-order-date for SQLMP definition
*01 hv-order-date pic x(10) value "2019-09-12".
01 hv-num pic s9(9) comp.
01 hv-sqlstate pic x(5).
01 hv-tabname pic x(128).
01 hv-colname pic x(128).
01 hv-msgtxt pic x(128).
01 in-partnum pic 9(4) comp.
01 i pic s9(9) comp.
EXEC SQL END DECLARE SECTION END-EXEC.
01 sqlstate-ok pic x(5) value "00000".
01 sqlstate-nodata pic x(5) value "02000".
01 sqlstate-save pic x(5).
01 sqlcode-save pic s9(9) comp.
PROCEDURE DIVISION.
START-LABEL.
DISPLAY "This example uses a fully qualified module name, but catalog and schema
names are independent".
EXEC SQL WHENEVER SQLERROR GOTO sqlerrors END-EXEC.
16. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -16-
* Declare static cursor.
EXEC SQL DECLARE get_by_partnum CURSOR FOR
SELECT partnum, partdesc, price, qty_available
FROM parts
WHERE partnum >= :in-partnum
FOR UPDATE OF partdesc, price, qty_available
END-EXEC.
* Read in-partnum from terminal.
DISPLAY "Enter lowest part number to be retrieved: ".
ACCEPT in-partnum.
* Begin the transaction.
move in-partnum to partnum
move "New part" to partdesc
move 120 to price
move 528 to qty-available
move "2019-09-13" to order-date.
EXEC SQL BEGIN WORK END-EXEC.
EXEC SQL INSERT INTO PARTS (
PARTNUM,
PARTDESC,
PRICE,
QTY_AVAILABLE,
ORDER_DATE ) VALUES
(
:partnum,
:partdesc,
:price,
:qty-available,
:order-date
)
END-EXEC.
* Open the cursor.
EXEC SQL OPEN get_by_partnum END-EXEC.
* Fetch the first row of the result from table.
EXEC SQL FETCH get_by_partnum
INTO :hv-partnum, :hv-partdesc,
:hv-price, :hv-qty-available
END-EXEC.
* Update qty_available if qty_available is less than 1000.
PERFORM UNTIL sqlstate = sqlstate-nodata
IF hv-qty-available < 1000
EXEC SQL UPDATE parts
SET qty_available = qty_available + 100
WHERE CURRENT OF get_by_partnum
END-EXEC.
DISPLAY "Update of part number: " hv-partnum
END-IF
EXEC SQL FETCH get_by_partnum
INTO :hv-partnum, :hv-partdesc,
:hv-price, :hv-qty-available
END-EXEC.
END-PERFORM.
* Close the cursor.
EXEC SQL CLOSE get_by_partnum END-EXEC.
17. NonStop Advanced Technology Center
An introduction to Embedded SQL for NonStop SQL/MX -17-
* Commit any changes.
EXEC SQL COMMIT WORK END-EXEC.
IF sqlstate = sqlstate-ok
DISPLAY "The program completed successfully.".
STOP RUN.
****************************************************************
sqlerrors SECTION.
****************************************************************
move sqlstate to sqlstate-save.
move sqlcode to sqlcode-save.
display "sqlerrors: " sqlstate ", " sqlcode.
EXEC SQL WHENEVER SQLERROR CONTINUE END-EXEC.
IF sqlstate not = sqlstate-ok
EXEC SQL GET DIAGNOSTICS
:hv-num = NUMBER
END-EXEC.
PERFORM VARYING i FROM 1 BY 1 UNTIL i > hv-num
MOVE SPACES TO hv-msgtxt
EXEC SQL GET DIAGNOSTICS EXCEPTION :i
:hv-tabname = TABLE_NAME,
:hv-colname = COLUMN_NAME,
:hv-sqlstate = RETURNED_SQLSTATE,
:hv-msgtxt = MESSAGE_TEXT
END-EXEC.
DISPLAY "Table : " hv-tabname
DISPLAY "Column : " hv-colname
DISPLAY "SQLSTATE: " hv-sqlstate
DISPLAY "Message : " hv-msgtxt
END-PERFORM
END-IF.
move sqlstate-save to sqlstate.
move sqlcode-save to sqlcode.
* STOP RUN.
****************************************************************
END PROGRAM Program-exF62.
****************************************************************