If you can tell me what this tsql does, then I can tell you have to do the
same thing with Oracle. Oracle has complete xml processing including an XML
datatype.
On Mon, Sep 22, 2008 at 4:15 AM, Vlad <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I have the following function that i am trying to convert to Oracle
> but need a few pointers. Is there an oracle equivalent of the XML
> data type which you can use in the same way:-
>
> ALTER FUNCTION dbo.CntLines(@Str VARCHAR(8000),@LineBreakSting
> varchar(2),@ColWidth decimal)
> RETURNS INT
> BEGIN
> declare @NbrLines INT,@x xml
>
> set @NbrLines = 0
> SET @x = '<i>' + REPLACE( replace(@Str, char(9), ' '),
> @LineBreakSting, '</i><i>') + '</i>'
> SELECT @NbrLines =
> sum(case when len(x.i.value('.', 'VARCHAR(8000)')) > @ColWidth then
> ceiling(len(x.i.value('.', 'VARCHAR(8000)'))/@ColWidth) else 1 end)
> FROM @x.nodes('//i') x(i)
> where x.i.value('.', 'VARCHAR(8000)') > ''
>
> RETURN @NbrLines
>
> END
>
> TIA
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---