oracle - how to declare a variable in pl sql the right way? -
here code
vjs varchar2(3500); --25065 gmaxdays s_criteria%rowtype := get_criteria_rec('max_days_booking'); begin if not sec_pkg.chk_sec('atlas_inv_overbook') -- exit procedure if security did not pass return; end if; -- vjs := ' gmaxdays;'||chr(10)|| 'function checkfields() {' ||chr(13) || ' // setting target here' ||chr(13) || ' document.frminvselect.target="_top"' ||chr(13) ||
i created gmaxdays,at first had hardcoded on table called s_criteria , max_days_booking part of s_criteria. im calling right way?
this how use , work
vjs varchar2(3500); --25065 begin if not sec_pkg.chk_sec('atlas_inv_overbook') -- exit procedure if security did not pass return; end if; -- vjs := 'var gmaxdays = 366;'||chr(10)|| 'function checkfields() {' ||chr(13) || ' // setting target here' ||chr(13) || ' document.frminvselect.target="_top"' ||chr(13) || [/code]
err ... saying that
you used have code snippet "worked":
vjs := 'var gmaxdays = 366;'||chr(10)|| 'function checkfields() {' ||chr(13) || ' // setting target here' ||chr(13) || ' document.frminvselect.target="_top"' ||chr(13) ||
when modified snippet be:
vjs := ' gmaxdays;'||chr(10)|| 'function checkfields() {' ||chr(13) || ' // setting target here' ||chr(13) || ' document.frminvselect.target="_top"' ||chr(13) ||
it "works" no more ?
i guess you're trying generate javascript code snippet. maybe you're looking for:
declare vjs varchar2(3500); gmaxdays s_criteria%rowtype := get_criteria_rec('max_days_booking'); begin -- here have call correct field record -- in example assume it's max_day vjs := 'var gmaxdays = ' || gmaxdays.max_day || ';' || chr(10)|| 'function checkfields() {' || chr(10) || ' // setting target here' || chr(10) || ' document.frminvselect.target="_top"' || chr(10) || ' // add here makes valid javascript.' end;
check documentation says pl/sql record variables.
Comments
Post a Comment