From: stunaz on
Hello everyone,
how could i translate this code to pl-sql.

update DM_RE_JOB_POSTING
set publishedI = (
select CASE WHEN rjp.internal_external in ('B','I')
and
COALESCE(rjpd.start_date,'17530101' )
<= CURRENT_TIMESTAMP
and COALESCE(rjpd.end_date ,'99991231
23:59:59.997')
>= CURRENT_TIMESTAMP

THEN 'I' ELSE 'N' END
from re_job_posting rjp
join re_job_posting_details rjpd on rjpd.re_job_posting_id =
rjp.id
where rjp.id = DM_RE_JOB_POSTING.ref_re_job_posting_id
and rjpd.internal = 1
), publishedE = (
select CASE WHEN rjp.internal_external in ('B','E')
and COALESCE(rjpd.start_date,'17530101'
groups.google.caTAMP
and COALESCE(rjpd.end_date ,'99991231
23:59:59.997')
>= CURRENT_TIMESTAMP

THEN 'E' ELSE 'N' END
from re_job_posting rjp
join re_job_posting_details rjpd on rjpd.re_job_posting_id =
rjp.id
where rjp.id = DM_RE_JOB_POSTING.ref_re_job_posting_id
and rjpd.internal = 0
)
From: John Hurley on
Stu:

> Hello everyone,
> how could i translate this code to pl-sql.
>
>   update DM_RE_JOB_POSTING
>   set    publishedI = (
>     select CASE WHEN rjp.internal_external in ('B','I')
>                  and
> COALESCE(rjpd.start_date,'17530101'             )
> <= CURRENT_TIMESTAMP
>                  and COALESCE(rjpd.end_date  ,'99991231
> 23:59:59.997')
>
> >= CURRENT_TIMESTAMP
>
>                 THEN 'I' ELSE 'N' END
>     from re_job_posting rjp
>     join re_job_posting_details rjpd on rjpd.re_job_posting_id =
> rjp.id
>     where rjp.id        = DM_RE_JOB_POSTING.ref_re_job_posting_id
>     and   rjpd.internal = 1
>   ),     publishedE = (
>     select CASE WHEN rjp.internal_external in ('B','E')
>                  and
> COALESCE(rjpd.start_date,'17530101'             )
> <= CURRENT_TIMESTAMP
>                  and COALESCE(rjpd.end_date  ,'99991231
> 23:59:59.997')
>
> >= CURRENT_TIMESTAMP
>
>                 THEN 'E' ELSE 'N' END
>     from re_job_posting rjp
>     join re_job_posting_details rjpd on rjpd.re_job_posting_id =
> rjp.id
>     where rjp.id = DM_RE_JOB_POSTING.ref_re_job_posting_id
>     and   rjpd.internal = 0
>   )

I don't see any T-SQL in what you supplied. Looks like 1 SQL
statement to me.

How would you rewrite 1 SQL statement to another SQL statement?

This looks suspiciously like homework to me.

Oracle supports CASE statement. Why don't you post what you come up
with as an equivalent?
From: Mladen Gogala on
On Mon, 26 Apr 2010 07:48:27 -0700, stunaz wrote:

> Hello everyone,
> how could i translate this code to pl-sql.

There is migration workshop in the SQL*Developer which will help you
migrate any SQL Server or Sybase DB to Oracle. It's a great tool and does
a really great job, even with rewriting the procedures.



--
http://mgogala.byethost5.com
From: John Hurley on
Mladen:

> > Hello everyone,
> > how could i translate this code to pl-sql.
>
> There is migration workshop in the SQL*Developer which will help you
> migrate any SQL Server or Sybase DB to Oracle. It's a great tool and does
> a really great job, even with rewriting the procedures.

Never tried it ... ( thank god I don't have to work with T-SQL ). I
have a feeling that your sarcastic side is showing on this reply.

From: BoyerG on
John Hurley <hurleyjohnb(a)yahoo.com> writes:

> Mladen:
>
>> > Hello everyone,
>> > how could i translate this code to pl-sql.
>>
>> There is migration workshop in the SQL*Developer which will help you
>> migrate any SQL Server or Sybase DB to Oracle. It's a great tool and does
>> a really great job, even with rewriting the procedures.
>
> Never tried it ... ( thank god I don't have to work with T-SQL ). I
> have a feeling that your sarcastic side is showing on this reply.

I don't think he is. I've used it and it does quite a good job.

--
Galen Boyer

--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
 |  Next  |  Last
Pages: 1 2
Prev: T-SQL to PL-SQL
Next: T-SQL to PL-SQL