About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Troubleshooting
Problem
This document explains how to insert a word that contains an apostrophe into a character field using SQL.
Resolving The Problem
How is a SQL statement coded to insert a character string that has an apostrophe in it?
The following shows how to insert an apostrophe using SQL:
INSERT INTO libname/filename VALUES('O''Hara')
This puts O'Hara in the first column in the file.
The following shows how to insert an apostrophe using SQL:
INSERT INTO libname/filename VALUES('O''Hara')
This puts O'Hara in the first column in the file.
[{"Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000001i4eAAA","label":"IBM i Db2-\u003ESQL Examples \/ DB Examples \/ Misc how to"}],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions","Type":"MASTER"}]
Historical Number
11790458
Was this topic helpful?
Document Information
More support for:
IBM i
Component:
IBM i Db2->SQL Examples / DB Examples / Misc how to
Software version:
All Versions
Operating system(s):
IBM i
Document number:
642671
Modified date:
05 December 2024
UID
nas8N1018365
Manage My Notification Subscriptions