finance_teacher
asked on
Oracle -- easy variable setting ?
Below works when I commend out
P_WONUM VARCHAR2(32000) := '1' || SELECT MAX(WO_NO) FROM ACTIVE_WORK_ORDER_TAB;
How can I get the above to work, so P_WONUM gets set ?
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -
DECLARE
NULLS_ VARCHAR2(32000) := NULL;
--1, below fails
P_WONUM VARCHAR2(32000) := '1' || SELECT MAX(WO_NO) FROM ACTIVE_WORK_ORDER_TAB;
--2, below works
P_WONUM2 VARCHAR2(32000) := '22122';
DETAILS_ VARCHAR2(32000) := 'WO_NO'||CHR(31)||P_WONUM2 ||CHR(30)||'ROW_NO'||CHR(3 1)||'17'|| CHR(30)||' COMPANY'|| CHR(31)||' 10'||CHR(3 0)||'DESCR IPTION'||C HR(31)||'t est'||CHR( 30)||'SIGN '||CHR(31) ||''||CHR( 30)||'SIGN _ID'||CHR( 31)||''||C HR(30)||'O RG_CODE'|| CHR(31)||' PVL'||CHR( 30)||'CONT RACT'||CHR (31)||'PVL '||CHR(30) ||'ROLE_CO DE'||CHR(3 1)||''||CH R(30)||'PL AN_MEN'||C HR(31)||'1 '||CHR(30) ||'TEAM_CO NTRACT'||C HR(31)||'P VL'||CHR(3 0)||'CATAL OG_CONTRAC T'||CHR(31 )||'PVL'|| CHR(30)||' CATALOG_NO '||CHR(31) ||''||CHR( 30)||'SALE S_PRICE'|| CHR(31)||' '||CHR(30) ||'DISCOUN T'||CHR(31 )||''||CHR (30)||'DAT E_FROM'||C HR(31)||'' ||CHR(30)| |'DATE_TO' ||CHR(31)| |''||CHR(3 0)||'SALE_ UNIT_PRICE '||CHR(31) ||''||CHR( 30);
BEGIN
WORK_ORDER_ROLE_API.NEW__( NULLS_, NULLS_, NULLS_, DETAILS_, 'DO' );
END;
P_WONUM VARCHAR2(32000) := '1' || SELECT MAX(WO_NO) FROM ACTIVE_WORK_ORDER_TAB;
How can I get the above to work, so P_WONUM gets set ?
--------------------------
DECLARE
NULLS_ VARCHAR2(32000) := NULL;
--1, below fails
P_WONUM VARCHAR2(32000) := '1' || SELECT MAX(WO_NO) FROM ACTIVE_WORK_ORDER_TAB;
--2, below works
P_WONUM2 VARCHAR2(32000) := '22122';
DETAILS_ VARCHAR2(32000) := 'WO_NO'||CHR(31)||P_WONUM2
BEGIN
WORK_ORDER_ROLE_API.NEW__(
END;
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.