ITPub博客

首页 > 应用开发 > IT综合 > FRM-40654 Record has been updated,Requery Record to see change.

FRM-40654 Record has been updated,Requery Record to see change.

原创 IT综合 作者:heaven110 时间:2007-03-05 17:39:29 0 删除 编辑

When adding new asset item to an existing Asset, there is a warning message box display, show "FRM-40654 Record Has Been Updated".

1. Log into SQL*Plus as apps user
username = apps
password = apps
(or use your own defined SQL*Plus apps account)

2. To see if there are any VARCHAR columns that have trailing spaces, perform the following steps in order:
a. Run the script below to create a procedure entitled CHK_TRAIL_SPACE
- procedure will check all VARCHAR2 columns in the table
b. Issue the following command:
'set serveroutput on'
- this will allow output to be displayed on the screen
c. Run the procedure with:
'execute chk_trail_space('');

Script to create procedure
--------------------------
CREATE OR REPLACE PROCEDURE CHK_TRAIL_SPACE (p_table_name in varchar) IS

v_table_name varchar(30);
v_column_name varchar(30);
v_column_name_c char(30);
v_space_count number;
v_ret number; -- temp holder for above
v_initial_space_counter number;
dyn_cursor number;

CURSOR TABLE1 IS
SELECT table_name
FROM ALL_TABLES
WHERE table_name = p_table_name;

CURSOR COLUMN1 IS
SELECT column_name
FROM ALL_TAB_COLUMNS
WHERE table_name = v_table_name;

BEGIN

OPEN TABLE1;
LOOP
-- FOR crec1 in TABLE1 LOOP
fetch TABLE1 into v_table_name;

IF (TABLE1%NOTFOUND) THEN
exit;
END IF;

dbms_output.put_line(v_table_name);
dbms_output.put_line
('--------------------------------------------------');
v_initial_space_counter := 0;

OPEN COLUMN1;
LOOP
-- FOR crec2 in COLUMN1 LOOP
fetch COLUMN1 into v_column_name;

IF (COLUMN1%NOTFOUND) THEN
exit;
END IF;

dyn_cursor := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE
(dyn_cursor,
'SELECT COUNT(*) ' ||
'FROM ' || p_table_name ||
' WHERE ' || v_column_name || ' LIKE ''% ''',
DBMS_SQL.NATIVE);

DBMS_SQL.define_column (dyn_cursor, 1, v_space_count);
v_ret := DBMS_SQL.EXECUTE(dyn_cursor);
if DBMS_SQL.fetch_rows(dyn_cursor) > 0 then
DBMS_SQL.column_value (dyn_cursor, 1, v_space_count);
end if;

DBMS_SQL.CLOSE_CURSOR(dyn_cursor);

IF v_space_count > 0 THEN
v_initial_space_counter := v_initial_space_counter + 1;
END IF;

v_column_name_c := v_column_name;

IF v_space_count > 0 THEN
dbms_output.put_line(' ' || v_column_name_c ||
to_char(v_space_count));
END IF;

end loop;
close column1;

end loop;
close table1;

END CHK_TRAIL_SPACE;

3. Based on the results of the above script, to fix the trailing spaces issue, run RTRIM:

update


set = rtrim();

PS: Be sure : FA_MASS_ADDITION is in Upper module.

reference:Note:141616.1

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/647807/viewspace-902842/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: MassAllocation
请登录后发表评论 登录
全部评论
  • 博文量
    3
  • 访问量
    5237