CAN YOU?? [message #599186] |
Tue, 22 October 2013 18:40 |
|
nataliafoster26
Messages: 64 Registered: October 2013
|
Member |
|
|
can you have a have a variable for example 'CODE_EX'
where you can
CODE_EX varchar2 := 'CASE TABLE_COLLUMN.TABLE_NAME ||
' WHEN ....;
FOR EXAMPLE THIS BELOW WORKS
vSalesCenterId2 VARCHAR2(300) := 'SELECT sc_name vDesc, sales_center_id vCode '||
' FROM s_sales_center '||
' ORDER BY sales_center_id';
IF NOT WHAT CAN I DO?this may sound like a dumb question
or maybe have a decode
[Updated on: Tue, 22 October 2013 18:42] Report message to a moderator
|
|
|
|
Re: CAN YOU?? [message #599188 is a reply to message #599186] |
Tue, 22 October 2013 19:06 |
|
nataliafoster26
Messages: 64 Registered: October 2013
|
Member |
|
|
this is what i have created right now, comes from s_sales_center table
CREATE TABLE PREMIER.S_SALES_CENTER
(
SALES_CENTER_ID NUMBER(12) NOT NULL,
CURRENCY_CODE VARCHAR2(3 BYTE),
MASTER_SALES_CENTER_ID NUMBER(12),
INF_SRC_DB VARCHAR2(3 BYTE) NOT NULL,
)
if inf_src_db =AUS" THEN CURRENCY CODE WOULD EQUL USD OTHERWISE BPS
I dont see any mistakes but still a long time ultil i try it
vcode varchar2 := select inf_src_dd infdb, currency_code ocode
from s_sales_center
if infdb='AUS'
THEN UPDATE S_SALES_CENTER
set currency_code = case inf_src_db when 'AUS' then 'USD' else 'BPS' end
i would think from this it would return me either usd or bps
[Updated on: Tue, 22 October 2013 19:07] Report message to a moderator
|
|
|
|
|