Home » Developer & Programmer » Forms » how to concatenate value in procedure name using parameter at runtime (D2K6i Oracle 10g)
how to concatenate value in procedure name using parameter at runtime [message #632966] Mon, 09 February 2015 04:07 Go to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

I have a form. below are the details
Block Name= B1
Text_Item Name=Offer_id
LOV Button :- for populating list of offer_ids for ex. 111,222,333 etc and storing values in text item.
Program Units :- contains few procedures for ex. GEN_EXCEL_111,GEN_EXCEL_222,
GEN_EXCEL_333 etc
Push Button:= To generate ouput in .csv file.

My requirement is when button get pressed and offer id is 111 then procedure gen_excel_111 should run , if offer id is 222 then procedure gen_excel_222 should run and so on.

Right now i am using following code on push button:-
IF :B1.OFFER_ID=111 THEN
          GEN_EXCEL_111;
ELSIF :B1.OFFER_ID=222 THEN
          GEN_EXCEL_222;
ELSIF :B1.OFFER_ID=333 THEN
          GEN_EXCEL_333
END IF;


But i do not want to use this , i want to concatenate value of offer_id in procedure name at runtime but it is not working for me.
I tried:-
'GEN_EXCEL_'||:B1.OFFER_ID;


Please provide the solution.
Re: how to concatenate value in procedure name using parameter at runtime [message #632967 is a reply to message #632966] Mon, 09 February 2015 04:13 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
If the procedures are in the DB you can use execute immediate.
If they're not then I'm pretty sure you have no choice but to hard code.
Re: how to concatenate value in procedure name using parameter at runtime [message #632968 is a reply to message #632967] Mon, 09 February 2015 04:14 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I would say FORMS_DDL (instead of EXECUTE IMMEDIATE).
Re: how to concatenate value in procedure name using parameter at runtime [message #632970 is a reply to message #632968] Mon, 09 February 2015 04:22 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Good point, to be clear though it can only be used in the same cases as execute immediate.
Re: how to concatenate value in procedure name using parameter at runtime [message #632971 is a reply to message #632970] Mon, 09 February 2015 04:32 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

@lf @cm
but how because below codes are not working , how will it take value at runtime if i am putting code in FORMS_DDL AND enclosing code between ('') .

FORMS_DDL('GEN_EXCEL_')||:MAIN.OFFER_ID;


FORMS_DDL('GEN_EXCEL_'||:MAIN.OFFER_ID);


FORMS_DDL('''GEN_EXCEL_'||:MAIN.OFFER_ID||'''');

[Updated on: Mon, 09 February 2015 04:36]

Report message to a moderator

Re: how to concatenate value in procedure name using parameter at runtime [message #632972 is a reply to message #632971] Mon, 09 February 2015 04:39 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
Do the procedures exist in the DB?
Re: how to concatenate value in procedure name using parameter at runtime [message #632973 is a reply to message #632972] Mon, 09 February 2015 04:42 Go to previous messageGo to next message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

nope these are not database procedures,
i have made these procedure in forms inside program units.
Re: how to concatenate value in procedure name using parameter at runtime [message #632974 is a reply to message #632967] Mon, 09 February 2015 04:45 Go to previous messageGo to next message
cookiemonster
Messages: 13920
Registered: September 2008
Location: Rainy Manchester
Senior Member
cookiemonster wrote on Mon, 09 February 2015 10:13
If the procedures are in the DB you can use execute immediate.
If they're not then I'm pretty sure you have no choice but to hard code.

Re: how to concatenate value in procedure name using parameter at runtime [message #632975 is a reply to message #632974] Mon, 09 February 2015 04:49 Go to previous message
jgjeetu
Messages: 373
Registered: July 2013
Location: www.Orafaq.com/Forum
Senior Member

ok , thanks for telling @cf @lf
Previous Topic: executing the code only one time every day
Next Topic: Need a unique Serial on basis of matching records values
Goto Forum:
  


Current Time: Fri Apr 19 10:58:28 CDT 2024