Home » RDBMS Server » Server Administration » Conversion into Oracle
Conversion into Oracle [message #369813] Tue, 17 October 2000 21:26 Go to next message
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
Any experts in dynamic sql ? [message #369827 is a reply to message #369813] Wed, 18 October 2000 22:06 Go to previous messageGo to next message
Shalini
Messages: 14
Registered: September 2000
Junior Member
This can be done using dynamic sql.
Any takers?
Re: Conversion into Oracle [message #369831 is a reply to message #369813] Thu, 19 October 2000 08:29 Go to previous message
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!
Previous Topic: Using INSTR to find any letter or any non number
Next Topic: Oracle Database
Goto Forum:
  


Current Time: Sun Dec 22 15:08:18 CST 2024