Conversion into Oracle [message #369813] |
Tue, 17 October 2000 21:26 |
merw
Messages: 2 Registered: October 2000
|
Junior Member |
|
|
I want to convert the following tsql procedure into an Oracle procedure.Can U help me?
SET QUOTED_IDENTIFIER OFF
SET ANSI_NULLS ON
GO
CREATE PROCEDURE sp_GetSpaceValueCount
(
@column varchar(10),
@table varchar(40),
@size integer = 1
)
AS
DECLARE @spaces varchar(100)
SELECT @spaces = SPACE(@size)
EXEC('SELECT COUNT(' + @column + ') FROM ' + @table + ' WHERE ' + @column + ' = ''' + @spaces + ''' ')
GO
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO
|
|
|
|
Re: Conversion into Oracle [message #369831 is a reply to message #369813] |
Thu, 19 October 2000 08:29 |
Christian Boulet
Messages: 9 Registered: April 2000
|
Junior Member |
|
|
Why not use Migration WorkBench??
AND of course you can do it that way:
v2_Str:='SELECT '||column||' FROM '||table||' where '||column||' = '||value;
OPEN CURSOR1 FOR V2_STR
LOOP
FETCH CURSOR1 INTO V2_RESULT;
EXIT WHEN CURSOR1%NOTFOUND
BLABLABLA...
END LOOP;
HOPE THAT HELPS!
|
|
|