Table of ContentsPreviousNext

Ispirer             Ispirer


Ispirer SQLWays Database Migration Software

Conversions of Microsoft SQL Server CHARINDEX to Oracle

The CHARINDEX function is used in Microsoft SQL Server to retrieve the position of a substring in the specified string. Oracle uses with this purpose the INSTR function. These functions have a similar syntax and differ in the parameter order.

SQLWays converts the Microsoft SQL Server function CHARINDEX to the Oracle function INSTR.

TABLE 63. Examples of Conversions of Microsoft SQL Server CHARINDEX to Oracle
Microsoft SQL Server
Oracle
CREATE PROCEDURE sql_sp_charindex
as
begin
DECLARE @a VARCHAR(10)
DECLARE @b VARCHAR(10)
charindex (@a,@b)
end;
CREATE OR REPLACE PROCEDURE sql_sp_charindex
AS
v_a VARCHAR2(10);
v_b VARCHAR2(10);
BEGIN
INSTR(v_b,v_a);
end;
CREATE PROCEDURE sql_sp_charindex2
as
begin
DECLARE @a VARCHAR(10)
DECLARE @b VARCHAR(10)
charindex (@a,@b,1)
end;
CREATE OR REPLACE PROCEDURE sql_sp_charindex2
AS
v_a VARCHAR2(10);
v_b VARCHAR2(10);
BEGIN
INSTR(v_b,v_a,1);
end;
 


Table of ContentsPreviousNext
Ispirer             Ispirer
Copyright © 1999-2015 Ispirer Systems Ltd. Ispirer and SQLWays are trademarks of Ispirer Systems Ltd. All other product names may be trademarks of the respective companies. All rights reserved.