Thursday, June 12, 2008

Single Quote in Alphabetic Fields

To insert a name with a single quote, type two single quotes:
Insert Into Emp
(EmpNo, EName , DeptNo)
Values (7474 , 'O''MALLEY', 10 );
Commit;
To search for a name with a single quote in it, type two single quotes:
Select EmpNo, Ename, DeptNo
From Emp
Where EName Like '%''%';

No comments:

Post a Comment