Home » SQL & PL/SQL » SQL & PL/SQL » why it doesnt save in table
why it doesnt save in table [message #599776] Mon, 28 October 2013 17:42 Go to next message
nataliafoster26
Messages: 64
Registered: October 2013
Member
why doesnt it not save in my table s_sales_center

vCurrCode S_SALES_CENTER.inf_src_db%TYPE;--32276

IF pvGlobalReg = 'AUS' THEN --32276
vCurrCode := 'USD';
ELSIF pvGlobalReg = 'AEU' THEN
vCurrCode := 'BPS';
ELSIF pvGlobalReg = 'NULL' THEN
vCurrCode := 'BPS';
END IF;

**************************************
<TR>

<TD class="tablelabel">Base Currency:</TD>
<TD CLASS="tablelabel">
<INPUT TYPE="TEXT" MAXLENGTH="35" SIZE="35" disabled="true" tabindex="19" CLASS="reqinput1" value="'||Util_Pkg.pv(Get_Currency_Desc(vCurrCode))||'" >
</TD>
</TR>

here is get_currency_code
CREATE OR REPLACE FUNCTION RVELAZQUES.Get_Currency_Desc(pvCurrCd VARCHAR2) RETURN VARCHAR2 AS

   CURSOR c_val IS
      SELECT des1 AS ddesc
     FROM   sqltime.sy_curr_code
     WHERE  currency_code = pvCurrCd;
    --
    vret sqltime.sy_curr_code.des1%TYPE;
BEGIN
   BEGIN
     --
     OPEN c_val;
     FETCH c_val INTO vret;
     CLOSE c_val;
     --
   EXCEPTION
     WHEN OTHERS THEN
      vret := NULL;
   END;
  RETURN vret;
   --
END Get_Currency_Desc;
/


the problem is it saves in the input text but not in the table s_sales_center(collumn currency_code)
when i click save it saves it and im able to see the changes on the frontend,but on the table
it goes blank
Re: why it doesnt save in table [message #599777 is a reply to message #599776] Mon, 28 October 2013 17:51 Go to previous messageGo to next message
BlackSwan
Messages: 22789
Registered: January 2009
Senior Member
Do you realize that we are NOT standing behind you & can see what you do or see?

BTW, the posted code never references S_SALES_CENTER table

I suggest that you delete, remove, eliminate & omit any & all EXCEPTION handler code including the lines below
EXCEPTION
     WHEN OTHERS THEN
      vret := NULL;


just initialize VRET := NULL;
Re: why it doesnt save in table [message #599778 is a reply to message #599777] Mon, 28 October 2013 18:03 Go to previous messageGo to next message
nataliafoster26
Messages: 64
Registered: October 2013
Member
yes i totally know that
what im trying to do is get
to default to the Sales Center's base currency
b) If INF_SRC_DB = AUS, will default to USD, otherwise default to BPS
and to save it when clicking on save on the table.
this is talbe sy_curr_code
CREATE TABLE SQLTIME.SY_CURR_CODE
(
CURRENCY_CODE VARCHAR2(3 BYTE) NOT NULL,
DES1 VARCHAR2(30 BYTE) NOT NULL,
CURRENCY_SYMBOL VARCHAR2(3 BYTE) NOT NULL
)
and talbe s_sales_center
CREATE TABLE PREMIER.S_SALES_CENTER
(
SALES_CENTER_ID NUMBER(12) NOT NULL,
CURRENCY_CODE VARCHAR2(3 BYTE),
MASTER_SALES_CENTER_ID NUMBER(12),
DISPATCH_PHONE_NUM VARCHAR2(20 BYTE),
INF_SRC_DB VARCHAR2(3 BYTE) NOT NULL,
COLLECT_RDP VARCHAR2(1 BYTE) DEFAULT 'Y',
)
Re: why it doesnt save in table [message #599779 is a reply to message #599778] Mon, 28 October 2013 18:12 Go to previous messageGo to next message
BlackSwan
Messages: 22789
Registered: January 2009
Senior Member
different day, same problem as before

http://www.orafaq.com/forum/m/599215/#msg_599215

  1  CREATE TABLE S_SALES_CENTER
  2  (
  3  SALES_CENTER_ID NUMBER(12) NOT NULL,
  4  CURRENCY_CODE VARCHAR2(3 BYTE),
  5  MASTER_SALES_CENTER_ID NUMBER(12),
  6  DISPATCH_PHONE_NUM VARCHAR2(20 BYTE),
  7  INF_SRC_DB VARCHAR2(3 BYTE) NOT NULL,
  8  COLLECT_RDP VARCHAR2(1 BYTE) DEFAULT 'Y',
  9* )
SQL> /
)
*
ERROR at line 9:
ORA-00904: : invalid identifier

Re: why it doesnt save in table [message #599780 is a reply to message #599779] Mon, 28 October 2013 18:17 Go to previous messageGo to next message
nataliafoster26
Messages: 64
Registered: October 2013
Member
the table i know is not the problem
Re: why it doesnt save in table [message #599781 is a reply to message #599780] Mon, 28 October 2013 18:19 Go to previous messageGo to next message
BlackSwan
Messages: 22789
Registered: January 2009
Senior Member
Problem Exists Between Keyboard And Chair.
Re: why it doesnt save in table [message #599805 is a reply to message #599781] Tue, 29 October 2013 02:27 Go to previous message
Littlefoot
Messages: 19610
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
nataliafoster26
the problem is it saves in the input text but not in the table s_sales_center.
when i click save it saves it and im able to see the changes on the frontend,but on the table it goes blank


What tool do you use? What is "input text"? Where do you click "Save"? What does that button exactly do? Did you COMMIT? If not, you should have.
Previous Topic: Query for the below requirement
Next Topic: Separate string based on Comma (merged 2)
Goto Forum:
  


Current Time: Thu Sep 18 17:45:48 CDT 2014

Total time taken to generate the page: 0.10462 seconds