Home » SQL & PL/SQL » SQL & PL/SQL » Very Good Doubt in PL/SQL
Very Good Doubt in PL/SQL [message #233607] Thu, 26 April 2007 19:53 Go to next message
kdastageerbasha
Messages: 6
Registered: April 2007
Location: Singapore
Junior Member
Dear All,

Please i need the full PL/SQL program for the following conditions sample below


IF {A_BENCHMARK.BENCHMARK} = {@Benchmark Cash} THEN
(
IF BenchmarkCashReferenceAsset = '' THEN
BenchmarkCashReferenceAsset := {A_SECS.SEC_SHORT_NAME}
ELSE
(
IF InStr(BenchmarkCashReferenceAsset,{A_SECS.SEC_SHORT_NAME}) = 0 THEN
BenchmarkCashReferenceAsset := BenchmarkCashReferenceAsset + ',' + {A_SECS.SEC_SHORT_NAME};
)
)
ELSE
(
IF BenchmarkSecuritiesReferenceAsset = '' THEN
BenchmarkSecuritiesReferenceAsset := {A_SECS.SEC_SHORT_NAME}
ELSE
(
IF InStr(BenchmarkSecuritiesReferenceAsset,{A_SECS.SEC_SHORT_NAME}) = 0 THEN
BenchmarkSecuritiesReferenceAsset := BenchmarkSecuritiesReferenceAsset + ',' + {A_SECS.SEC_SHORT_NAME};
)
)

------------------
Then pls tell me the how to test and execute in toad with steps of the above example.
Please in detail i am quite new in PL/SQL

by
DAS
Re: Very Good Doubt in PL/SQL [message #233638 is a reply to message #233607] Fri, 27 April 2007 01:07 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please I need a brand new car.

Well, maybe you have to read: PL/SQL User's Guide and Reference.

Regards
Michel
Re: Very Good Doubt in PL/SQL [message #233701 is a reply to message #233638] Fri, 27 April 2007 03:34 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Be generous - the OP's trying to convert code from SQL Server T-SQL, and migrating away from that to Oracle is a process I'm willing to encourage (particularly on a slow friday).

1) You need to loose the { and } - I assume they some sort of marker to indicate that you're looking at a row from the Db

2) Replace " ='' " with " IS NULL "

3) Pl/Sql uses || rather than + for string concatenation

4) I presume that the @ is a marker for a bind variable - replace it with :

5) Is this going to be a stored procedure, or a stand alone piece of code. Assuming the latter, you need to wrap the whole block in a DECLARE... BEGIN... END structure, with the code between the BEGIN and END markers, and your variables declared between the DECLARE and BEGIN markers.

You code that up and post it here and we'll see what needs tweaking to get it working
Re: Very Good Doubt in PL/SQL [message #233704 is a reply to message #233701] Fri, 27 April 2007 03:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You forgot the semi-colon at the end of statements.

What can I expect if I post an article in french and ask you to translate it into english?

Regards
Michel
Re: Very Good Doubt in PL/SQL [message #233707 is a reply to message #233704] Fri, 27 April 2007 03:48 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Si le texte était simple, j'aurais un coup de couteau moi-même, mais autrement j'utiliserais un traducteur en ligne qui en ferait un hachis total pour moi (comme cela).

T-Sql is pretty similar to Pl/Sql - it just uses some different symbols.
Re: Very Good Doubt in PL/SQL [message #233714 is a reply to message #233707] Fri, 27 April 2007 04:04 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Is this what you wrote?
If the text were simple, I would have a blow of knife myself, but otherwise I would use a translator in line which would make a total mince for me of them (like that).
Laughing

Regards
Michel
Re: Very Good Doubt in PL/SQL [message #233716 is a reply to message #233714] Fri, 27 April 2007 04:10 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Original text:
If the text was simple, I'd have a stab myself, but otherwise I'd use an online translator which would make a total hash of it for me (just like this).


That's not a great translation - sounds like dialogue from a bad chinese martial arts film
Previous Topic: Error in Order By SQL STMT
Next Topic: exception handling
Goto Forum:
  


Current Time: Sun Dec 04 18:50:24 CST 2016

Total time taken to generate the page: 0.11682 seconds