Missing keyword error
Hi all,
I am getting missing keyword error when trying to execute the below function,it doesn't give an error while compiling though.Tried to debug but to vain,can't understand what i am missing.
FUNCTION reprint_file (p_format VARCHAR2,
p_printer_number VARCHAR2,
p_request_id VARCHAR2,
p_order_no_from VARCHAR2 DEFAULT NULL,
p_order_no_to VARCHAR2 DEFAULT NULL,
p_order_date_from VARCHAR2 DEFAULT NULL,
p_order_date_to VARCHAR2 DEFAULT NULL
RETURN VARCHAR2 IS
CURSOR c_format(p_format VARCHAR2) IS
SELECT *
FROM rgl_lookup_data
WHERE format_name = p_format;
TYPE c_ref IS REF CURSOR;
c_rec c_ref;
l_info VARCHAR2(32767);
l_stmt VARCHAR2(6000);
l_order_by VARCHAR2(200):='';
l_exec_stmt VARCHAR2(8000);
l_fp UTL_FILE.FILE_TYPE;
l_filename VARCHAR2(200);
--p_dir_name VARCHAR2(200) := '/usr/tmp';
p_dir_name VARCHAR2(200) := '/d02/oracle/edi/in';
l_order_by_clause VARCHAR2(240);
l_cursor PLS_INTEGER;
l_return NUMBER;
BEGIN
UPDATE rgl_mcy_line_data
SET printer_info = p_printer_number
WHERE header_id = p_request_id;
l_stmt := 'SELECT ''"''||printer_info||''"'''; -- ||''","''||printer_info ';
FOR curr_format IN c_format(p_format)
LOOP
IF curr_format.quantity IS NOT NULL THEN
l_stmt := l_stmt || ' ||'',''||DECODE(quantity, NULL, NULL,''"''||'||'quantity||''"'')';
END IF;
IF curr_format.field_25 IS NOT NULL THEN
l_stmt := l_stmt || ' ||'',''||DECODE(field_25, NULL, NULL,''"''||'||'field_25||''"'')';
END IF;
END LOOP curr_format;
l_exec_stmt := l_stmt
|| ' FROM rgl_lookup_data '
|| ' WHERE format_name = :format_b';
l_filename := 'Reprint_'||'ASP'||'_'||p_request_id||'_'||TO_CHAR(SYSDATE, '_DDMMYYYY_hh24MISS')||'.csv';
l_fp := UTL_FILE.FOPEN(p_dir_name, l_filename, 'w');
OPEN c_rec FOR l_exec_stmt USING p_format;
FETCH c_rec INTO l_info;
CLOSE c_rec;
write_line(l_fp, l_info);
l_exec_stmt := l_stmt
|| ' FROM rgl_mcy_line_data '
|| ' WHERE header_id = :header_id_b '
|| ' AND format = :format_b '
|| ' AND printer_info = :printer_number_b ';
IF p_order_no_from IS NOT NULL AND p_order_no_to IS NOT NULL THEN
l_exec_stmt := l_exec_stmt
|| ' AND order_number BETWEEN :order_no_from_b TO :order_no_from_to ';
ELSIF p_order_no_from IS NOT NULL THEN
l_exec_stmt := l_exec_stmt
|| ' AND order_number >= :order_no_from_b ';
ELSIF p_order_no_to IS NOT NULL THEN
l_exec_stmt := l_exec_stmt
|| ' AND order_number <= :order_no_from_to ';
END IF;
IF p_order_date_from IS NOT NULL AND p_order_date_to IS NOT NULL THEN
l_exec_stmt := l_exec_stmt
|| ' AND order_date BETWEEN :order_date_from_b TO :order_date_from_to ';
ELSIF p_order_date_from IS NOT NULL THEN
l_exec_stmt := l_exec_stmt
|| ' AND order_date >= :order_date_from_b ';
ELSIF p_order_date_to IS NOT NULL THEN
l_exec_stmt := l_exec_stmt
|| ' AND order_date <= :order_date_from_to ';
END IF;
--log_mesg(l_exec_stmt);
dbms_output.put_line('Entered');
l_cursor := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE(l_cursor, l_exec_stmt, DBMS_SQL.NATIVE); --Error is showing at this line
DBMS_SQL.DEFINE_COLUMN(l_cursor, 1, l_info, 32767);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'header_id_b', p_request_id);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'format_b', p_format);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'printer_number_b', p_printer_number);
dbms_output.put_line('Exit');
--log_mesg('req:'||p_request_id);
--log_mesg('for:'||p_format);
--log_mesg('pno:'||p_printer_number);
IF p_order_no_from IS NOT NULL THEN
--log_mesg('onf:'||p_order_no_from);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'order_no_from_b', p_order_no_from);
END IF;
IF p_order_no_to IS NOT NULL THEN
--log_mesg('ont:'||p_order_no_to);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'order_no_to_b', p_order_no_to);
END IF;
IF p_order_date_from IS NOT NULL THEN
--log_mesg('odf:'||p_order_date_from);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'order_date_from_b', p_order_date_from);
END IF;
IF p_order_date_to IS NOT NULL THEN
--log_mesg('odt:'||p_order_date_to);
DBMS_SQL.BIND_VARIABLE(l_cursor, 'order_date_to_b', p_order_date_to);
END IF;
l_return := DBMS_SQL.EXECUTE(l_cursor);
LOOP
--log_mesg('inside the loop')
EXIT WHEN DBMS_SQL.FETCH_ROWS(l_cursor) = 0; --curr_rec%NOTFOUND;
DBMS_SQL.COLUMN_VALUE(l_cursor, 1, l_info);
write_line(l_fp, l_info);
END LOOP;
DBMS_SQL.CLOSE_CURSOR(l_cursor);
UTL_FILE.FCLOSE(l_fp);
UPDATE rgl_header_data
SET last_print_date = SYSDATE,
reprint_count = NVL(reprint_count, 0) + 1
WHERE header_id = p_request_id;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
RETURN l_filename;
END rePrint_File;
Function Call
DECLARE
v_result VARCHAR2(1000);
BEGIN
v_result := REGAL_MCY_PRINT_PKG.reprint_file('Macys.lwl','hp4000','6473482927','1213049','1213049',NULL,NULL);
END;
DBMS Messages
Entered
An error was encountered - -905 -ERROR- ORA-00905: missing keyword
Any suggestions,
Thanks in advance!!
i didn't find anything wrong with this
DBMS Message before parsing
SELECT '"'||printer_info||'"' ||','||DECODE(quantity, NULL, NULL,'"'||quantity||'"') ||','||DECODE(format, NULL, NULL,'"'||format||'"') ||','||DECODE(duplicates, NULL,NULL,'"'||duplicates||'"') ||','||DECODE(field_1, NULL, NULL,'"'||field_1||'"') ||','||DECODE(field_2, NULL, NULL,'"'||field_2||'"') ||','||DECODE(field_3, NULL, NULL,'"'||field_3||'"') ||','||DECODE(field_4, NULL, NULL,'"'||field_4||'"') ||','||DECODE(field_5, NULL, NULL,'"'||field_5||'"') ||','||DECODE(field_6, NULL, NULL,'"'||field_6||'"') ||','||DECODE(field_7, NULL, NULL,'"'||field_7||'"') ||','||DECODE(field_8, NULL, NULL,'"'||field_8||'"') ||','||DECODE(field_9, NULL, NULL,'"'||field_9||'"') ||','||DECODE(field_10, NULL, NULL,'"'||field_10||'"') ||','||DECODE(field_11, NULL, NULL,'"'||field_11||'"') ||','||DECODE(field_12, NULL, NULL,'"'||field_12||'"') ||','||DECODE(field_13, NULL, NULL,'"'||field_13||'"') ||','||DECODE(field_14, NULL, NULL,'"'||field_14||'"') ||','||DECODE(field_15, NULL, NULL,'"'||field_15||'"') ||','||DECODE(field_16, NULL, NULL,'"'||field_16||'"') ||','||DECODE(field_17, NULL, NULL,'"'||field_17||'"') ||','||DECODE(field_18, NULL, NULL,'"'||field_18||'"') ||','||DECODE(field_19, NULL, NULL,'"'||field_19||'"') ||','||DECODE(field_20, NULL, NULL,'"'||field_20||'"') ||','||DECODE(field_21, NULL, NULL,'"'||field_21||'"') ||','||DECODE(field_22, NULL, NULL,'"'||field_22||'"') ||','||DECODE(field_23, NULL, NULL,'"'||field_23||'"') ||','||DECODE(field_24, NULL, NULL,'"'||field_24||'"') ||','||DECODE(field_25, NULL, NULL,'"'||field_25||'"') FROM rgl_mcy_line_data WHERE header_id = :header_id_b AND format = :format_b AND printer_info = :printer_number_b AND order_number BETWEEN :order_no_from_b TO :order_no_from_to
Similar Messages
-
ORA-00905: missing keyword error while creating a materialized view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.Ummm how about not posting the same question 4 times in 3 different forums?
Gints Plivna
http://www.gplivna.eu -
ORA-00905: missing keyword error while creating a materialised view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6002.htm#i2063793 gives you the syntax of the command.
I think the fact that you have two REFRESH clauses separated by a query rewrite clause is causing some confusion.
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
probably should be
REFRESH COMPLETE
ON DEMAND
START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
DISABLE QUERY REWRITE -
Alter database begin backup; missing keyword error
Hi all,
I am trying to put my database in backup mode using the command "alter database begin backup", but it is giving error shown below:
$ sqlplus '/as sysdba'
SQL*Plus: Release 9.2.0.5.0 - Production on Wed Nov 25 16:52:58 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.5.0 - Production
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
N05PCS07 READ WRITE
SQL> alter database begin backup;
alter database begin backup
ERROR at line 1:
ORA-00905: missing keyword
NE one can tell why the command is failing??
pls...
Thanks in advance.
SHAILESHHello,
All the former posts are right, alter database begin backup; doesn't exists in 9.2 althought
you already have in this release the alter database end backup;.
So as to put all the tablespaces in backup mode in one command I suggest you to create a
stored procedure as follows:
CREATE OR REPLACE PROCEDURE begin_backup IS
TYPE RefCurTyp IS REF CURSOR;
cv RefCurTyp;
sql_cv VARCHAR2(400);
tbs VARCHAR2(128);
sql_stmt VARCHAR2(200);
BEGIN
-- Mise en BEGIN BACKUP des TABLESPACES
sql_cv := 'SELECT distinct (A.name) FROM sys.v_$tablespace A, sys.v_$datafile B, sys.v_$backup C where A.TS# = B.TS# and B.FILE# = C.FILE# and C.STATUS = ''NOT ACTIVE''';
OPEN cv FOR sql_cv;
LOOP
FETCH cv INTO tbs;
EXIT WHEN cv%NOTFOUND;
sql_stmt := 'ALTER TABLESPACE '||tbs||' BEGIN BACKUP';
EXECUTE IMMEDIATE sql_stmt;
END LOOP;
CLOSE cv;
END;
Then, I just have to call the Procedure like that:
execute <schema>.begin_backup; and all the tablespaces are in backup mode.
This procedure must be created on a User/Schema with the following privileges:
alter tablespace
select on sys.v_$tablespace
select on sys.v_$datafile
select on sys.v_$backupHope it can help.
Best regards,
Jean-Valentin
Edited by: Lubiez Jean-Valentin on Nov 25, 2009 9:44 PM -
Ora-00905 missing keyword error
Hi ,
Whats wrong with the below query?
Pls help
select state_id ,
TO_CHAR(state_eff_date, 'dd-mon-yyyy hh24:mi:ss am'),
case
when station_id = null then state_id = lag(state_id) over (order by ash.station_id)
end "previous_state"
from vppstation.avi_state_history
where state_eff_date >= to_date('01/02/2010', 'dd/mm/yyyy')
and state_eff_date <= to_date('16/03/2010', 'dd/mm/yyyy')
and station_id = 61 ;Thanks.Consider this example:
1* SELECT * FROM emp ORDER BY hiredate
SQL> /
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7839 KING PRESIDENT 17-NOV-81 5000 10
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7934 MILLER CLERK 7782 23-JAN-82 1300 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
14 rows selected.
1 WITH c_set AS
2 (SELECT deptno, hiredate FROM emp WHERE hiredate BETWEEN DATE '1981-03-01' AND DATE '1981-03-30' AND deptno = 30)
3 SELECT * FROM c_set
4 UNION ALL
5 SELECT deptno, MAX(hiredate)
6 FROM emp
7 WHERE hiredate <= DATE '1981-03-30'
8 AND deptno = 30
9 AND 0 = (SELECT COUNT(*) FROM c_set WHERE hiredate BETWEEN DATE '1981-03-01' AND DATE '1981-03-30' AND deptno = 30)
10* GROUP BY deptno
SQL> /
DEPTNO HIREDATE
30 22-FEB-81
SQL> ed
Wrote file afiedt.buf
1 WITH c_set AS
2 (SELECT deptno, hiredate FROM emp WHERE hiredate BETWEEN DATE '1981-03-01' AND DATE '1981-05-30' AND deptno = 30)
3 SELECT * FROM c_set
4 UNION ALL
5 SELECT deptno, MAX(hiredate)
6 FROM emp
7 WHERE hiredate <= DATE '1981-05-30'
8 AND deptno = 30
9 AND 0 = (SELECT COUNT(*) FROM c_set WHERE hiredate BETWEEN DATE '1981-03-01' AND DATE '1981-05-30' AND deptno = 30)
10* GROUP BY deptno
SQL> /
DEPTNO HIREDATE
30 01-MAY-81 -
Error: ORA-00905:Missing keyword while creating Materialized view
Hi Gurus,
I am trying to create a materialized view as :
1 CREATE MATERIALIZED VIEW AMREG.ClientData
2 TABLESPACE AMREG_DATA
3 COMPRESS
4 PARALLEL
5 NOLOGGING
6 BUILD IMMEDIATE
7 REFRESH COMPLETE
8 ON DEMAND
9 DISABLE QUERY REWRITE
10 REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
11 AS
12 SELECT
13 CHILD.CLIENT_SGK "Child SGK",
14 CHILD.CLIENT_NAME "Child Name",
15 CHILD.ARC_ACCT_CD "Child ARC Acct Code",
16 ULTIMATE.CLIENT_SGK "Ultimate Parent SGK",
17 ULTIMATE.CLIENT_NAME "Ultimate Parent Name",
18 ULTIMATE.ARC_ACCT_CD "Ultimate ARC Acct Code",
19 HIER.LVL_FROM_ANCESTOR ,
20 FROM [email protected] CHILD,
21 [email protected] HIER,
22 [email protected] ULTIMATE
23 WHERE HIER.DESCENDANT_CLIENT_SGK = CHILD.CLIENT_SGK
24* AND ULTIMATE.CLIENT_SGK = HIER.ANCESTOR_CLIENT_SGK;
SQL> /
REFRESH START WITH TRUNC( SYSDATE + 1 ) + 3/24 NEXT TRUNC( SYSDATE + 1 ) + 3/24
ERROR at line 10:
ORA-00905: missing keyword
DBLink name is : DNYCPH60.WORLD
Please guide me on this and help to resolve the issue.I provided the answer over at the duplicate post ...
ORA-00905: missing keyword error while creating a materialised view
Please, please, please ... please do not duplicate posts. Pick one. If you don't get an answer in a reasonable time - close it (edit the title) and THEN open in a different forum. -
Missing keyword when try to use MERGE
I have COUNT_STATISTICS table that needs to be updated daily.
MODEL
NEW_COUNT
NEW_DATE
OLD_COUNT
OLD_DATE
PRNCT_CHANGE
XEDHRD
5206358
21-AUG-13
0
19-AUG-13
(null)
XLIMS
72669230
21-AUG-13
72669230
20-AUG-13
0
XEDHRD
5206358
22-AUG-13
5206358
21-AUG-13
0
XLIMS
72859644
22-AUG-13
72669230
21-AUG-13
0.262
so on and so forth...
Sometimes I have a new MODEL name coming in and I have to account for that and create a row in the table in that case.
Other times, all I have to do is INSERT new row in the table with new values.
Simple right?
Well, I was trying to use MERGE INTO but it is giving me problems...
This is what I did assuming I manually went in the table and added a new MODEL name and zeros for other columns before I did insertion...
#!/bin/bash
MODEL=$1
sqlplus -S username/password << EOF
whenever sqlerror exit 1;
set echo on
set verify off
INSERT INTO SEMANTIC.COUNT_STATISTICS(MODEL,NEW_COUNT,NEW_DATE,OLD_COUNT,OLD_DATE)
SELECT MODEL,
SELECT COUNT(*)
FROM TABLE(SEM_MATCH(
?s ?p ?o
}',SEM_Models('$MODEL'),NULL,
SEM_ALIASES(SEM_ALIAS('','http://VISION/DataSource/SEMANTIC#')),NULL))
SYSDATE,
NEW_COUNT,
NEW_DATE
FROM SEMANTIC.COUNT_STATISTICS
WHERE MODEL = '$MODEL'
AND NEW_DATE = (
select max(NEW_DATE)
from SEMANTIC.COUNT_STATISTICS
where MODEL = '$MODEL'
update SEMANTIC.COUNT_STATISTICS
set prnct_change =
(NEW_COUNT-OLD_COUNT)/NULLIF(OLD_COUNT,0)*100
where model = '$MODEL'
AND NEW_DATE = (
select max(NEW_DATE)
from SEMANTIC.COUNT_STATISTICS
where MODEL = '$MODEL'
COMMIT;
exit;
EOF
Now I added MERGE in front of INSERT so it checks if the MODEL name doesn't exist-it creates it:
MERGE INTO SEMANTIC.COUNT_STATISTICS s
USING (SELECT '${MODEL}' AS MODEL, 0 AS NEW_COUNT, SYSDATE AS NEW_DATE,
0 AS OLD_COUNT, SYSDATE AS OLD_DATE FROM dual) t
on (s.MODEL = t.MODEL)
when not matched then
INSERT (s.MODEL, s.NEW_COUNT, s.NEW_DATE, s.OLD_COUNT, s.OLD_DATE)
VALUES (t.MODEL, t.NEW_COUNT, t.NEW_DATE, t.OLD_COUNT, t.OLD_DATE);
My code combined...
#!/bin/bash
MODEL=$1
sqlplus -S username/password << EOF
whenever sqlerror exit 1;
set echo on
set verify off
MERGE INTO SEMANTIC.COUNT_STATISTICS s
USING (SELECT '${MODEL}' AS MODEL, 0 AS NEW_COUNT, SYSDATE AS NEW_DATE, 0 AS OLD_COUNT, SYSDATE AS OLD_DATE FROM dual) t
on (s.MODEL = t.MODEL)
when not matched then
INSERT (s.MODEL, s.NEW_COUNT, s.NEW_DATE, s.OLD_COUNT, s.OLD_DATE)
VALUES (t.MODEL, t.NEW_COUNT, t.NEW_DATE, t.OLD_COUNT, t.OLD_DATE);
exit;
EOF
model_exists () {
sqlplus -s username/password <<!
set heading off
set feedback off
set verify off
set pages 0
SELECT count(MODEL)
FROM SEMANTIC.COUNT_STATISTICS
where MODEL ='$MODEL' AND TO_DATE(NEW_DATE, 'DD-MON-YY') = TO_DATE(SYSDATE, 'DD-MON-YY');
exit;
modelcount=$(model_exists $1)
if [ "${modelcount:-0}" -ne 0 ]; then
sqlplus -S username/password << EOF
whenever sqlerror exit 1;
set echo on
set verify off
INSERT INTO SEMANTIC.COUNT_STATISTICS(MODEL,NEW_COUNT,NEW_DATE,OLD_COUNT,OLD_DATE)
SELECT MODEL,
SELECT COUNT(*)
FROM TABLE(SEM_MATCH(
'{?s ?p ?o }',SEM_Models('$MODEL'),NULL,
SEM_ALIASES(SEM_ALIAS('','http://VISION/DataSource/SEMANTIC#')),NULL))
SYSDATE,
NEW_COUNT,
NEW_DATE
FROM SEMANTIC.COUNT_STATISTICS
WHERE MODEL = '$MODEL'
AND NEW_DATE = (
select max(NEW_DATE)
from SEMANTIC.COUNT_STATISTICS
where MODEL = '$MODEL'
COMMIT;
exit;
EOF
else
sqlplus -S username/password << EOF
whenever sqlerror exit 1;
set echo on
set verify off
UPDATE COUNT_STATISTICS
SET MODEL = '$MODEL',
NEW_COUNT = (SELECT COUNT(*) FROM TABLE(SEM_MATCH('{?s ?p ?o}',SEM_Models('$MODEL'),NULL,
SEM_ALIASES(SEM_ALIAS('','http://VISION/DataSource/SEMANTIC#')),NULL))
NEW_DATE = SYSDATE,
OLD_COUNT = NEW_COUNT,
OLD_DATE = NEW_DATE
WHERE MODEL = '$MODEL'
AND NEW_DATE = (
select max(NEW_DATE)
from SEMANTIC.COUNT_STATISTICS
where MODEL = '$MODEL'
COMMIT;
exit;
EOF
fi
sqlplus -S username/password << EOF
whenever sqlerror exit 1;
set echo on
set verify off
update COUNT_STATISTICS
set prnct_change =
(NEW_COUNT-OLD_COUNT)/NULLIF(OLD_COUNT,0)*100
where model = '$MODEL'
AND NEW_DATE = (
select max(NEW_DATE)
from SEMANTIC.COUNT_STATISTICS
where MODEL = '$MODEL'
COMMIT;
exit;
EOF
But this is creating two rows if it is a new MODEL, ie:
./load_myScript.sh MODELNAME
MODEL
NEW_COUNT
NEW_DATE
OLD_COUNT
OLD_DATE
PRNCT_CHANGE
MODELNAME
72669230
22-AUG-13
0
22-AUG-13
(null)
MODELNAME
0
22-AUG-13
0
22-AUG-13
(null)
This is not what I want. I want to create a new row if it doesn't exist and then update that same one for that day. But tomorrow it should INSERT a new one for that same MODEL name.
Does anyone see what I am doing wrong?Hi,
MODEL is an Oracle keyword, so it causes confusion to have a column named MODEL. Errors like "Missing Keyword" can occur when Oracle thinks you're talking about the MODEL clause, rather than the column.
The best solution is not to use Oracle keywords (as found in v$reserverd words) for you own column names, or other identifiers. MODEL_NAME and MODEL_ID are good names for columns
If you really must use that column name, qualify it with the table name, and/or put the column name in double-quotes (case-sensitive), e.g.
count_statistics."MODEL" -
Hi,
I am running a SQL Statement in SQL Developer and it runs ok. When I try running the same statement in BI Publisher, I get the following error:
An error occurred while processing the EXECUTE PHYSICAL statement. [nQSError: 17001] Oracle Error code: 905, message: ORA-00905: missing keyword
My SQL is below:
select a.active_year, round(nvl(b.leavers, 0)/(count(a.active_month)/12)*100, 1) as left_in_period
from(
select 'Avg No of Staff' TABLE_NAME, s.person_id, s.active_month,
case when(case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 7 then 2007
when (case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 8 then 2008
when (case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 9 then 2009
when (case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 10 then 2010
when (case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 11 then 2011
when (case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 12 then 2012
when (case when to_number(to_char(s.active_month, 'mm')) in(11, 12) then substr(s.active_month,8,4)+1 else to_number(to_char(s.active_month, 'YYYY')) end) = 13 then 2013
else to_number(to_char(s.active_month, 'YYYY')) end ACTIVE_YEAR
from hc_employee_turnover_staff s
union
select * from(
WITH my_data as (
SELECT f.person_id,
f.person_type_id,
f.effective_start_date,
f.effective_end_date,
substr(p.internal_location, 1, 5) as loc,
l.location_code,
d.group_name
from per_all_people_f f,
--per_person_type_usages_f t,
per_people_x p,
per_assignments_x a,
hr_locations l,
pay_people_groups d
--WHERE f.person_id = 1182
where f.person_id = p.person_id
--and p.person_id = t.person_id
AND p.person_id = a.person_id(+)
AND a.location_id = l.location_id(+)
and a.people_group_id = d.people_group_id(+)
and f.person_type_id in(1120,2122, 2123, 2120, 2121, 2118, 2119)),
month_starts AS (
SELECT DISTINCT DT FROM (
SELECT LAST_DAY(to_date('01-OCT-2010','DD-MON-YYYY') + (LEVEL +1))+1 AS DT
FROM DUAL
CONNECT BY LEVEL <= to_date('01-NOV-2012','DD-MON-YYYY') - (to_date('01-OCT-2010','DD-MON-YYYY'))))
SELECT 'Avg No of Staff' TABLE_NAME, person_id, month_starts.dt ACTIVE_MONTH,
case when to_number(to_char(month_starts.dt, 'mm')) in(11, 12) then substr(month_starts.dt,8,4)+1 else to_number(to_char(month_starts.dt, 'YYYY')) end ACTIVE_YEAR
from my_data
INNER JOIN MONTH_STARTS
ON (month_starts.dt between my_data.effective_start_date and my_data.effective_end_date))
where table_name = 'Avg No of Staff') a,
(select leaving_year, count(leaving_month) AS leavers from(
select 'No of Leavers' TABLE_NAME, l.person_id, l.leaving_month,
case when(case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 7 then 2007
when (case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 8 then 2008
when (case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 9 then 2009
when (case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 10 then 2010
when (case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 11 then 2011
when (case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 12 then 2012
when (case when to_number(to_char(l.leaving_month, 'mm')) in(11, 12) then substr(l.leaving_month,8,4)+1 else to_number(to_char(l.leaving_month, 'YYYY')) end) = 13 then 2013
else to_number(to_char(l.leaving_month, 'YYYY')) end LEAVING_YEAR
from HC_EMPLOYEE_TURNOVER_LEAVERS l
union all
select 'No of Leavers' TABLE_NAME, p.person_id,
trunc(to_date(e.effective_start_date - 1), 'MONTH') as leaving_month,
case when to_number(to_char(e.effective_start_date - 1, 'mm')) in(11, 12) then substr(e.effective_start_date - 1,8,4)+1 else to_number(to_char(e.effective_start_date - 1, 'YYYY')) end LEAVING_YEAR
from per_all_people_f e,
per_people_x p,
per_assignments_x a,
hr_locations l,
pay_people_groups d,
per_jobs_v j,
per_grade_definitions g
WHERE e.person_type_id = 1123
and e.person_id = p.person_id
and p.person_id = a.person_id(+)
and a.location_id = l.location_id(+)
and a.grade_id = g.grade_definition_id(+)
and a.people_group_id = d.people_group_id(+)
and a.job_id = j.job_id(+)
and e.effective_start_date - 1 >= '01-NOV-2010')
group by division, leaving_year) b
where a.division = b.division(+)
and a.active_year = b.leaving_year(+)
GROUP BY A.ACTIVE_YEAR, B.LEAVERS
ORDER BY 2, 1
Can anyone help?
Thanks
Edited by: sliderrules on 03-Dec-2010 03:10Hi,
I know this post is a while old though it's more for the future individuals who experiencing the issue
I followed this by removing the comments though I was unable to resolve the issue. In my scenario, I was experiencing the issue with the naming convention of CTE's
http://technicalconfessions.com/posts.php?post_id=199&title=Bi%20Publisher%2011g%20(OBIEE)%20ORA-00905:%20missing%20keyword
Regards,
Daniel -
ORA-00905: missing keyword
CREATE TABLE STG
X NUMBER
)INSERT INTO STG(X) VALUES (1);
COMMIT;
this table will be created dynamically in my program, somewhere I want to get the count
so i tried this
declare
l_cnt number := 0;
begin
execute immediate 'select count(x)
into l_cnt
from stg';
dbms_output.put_line('l_cnt: '||l_cnt);
end;
/it gives me the error
ORA-00905: missing keyword
how do i get the count dynamically for a table created dynamically ?Hi,
user650888 wrote:
CREATE TABLE STG
X NUMBER
)INSERT INTO STG(X) VALUES (1);
COMMIT;
this table will be created dynamically in my program, Why are you creating a table in your program? That's almost never needed in Oracle.
somewhere I want to get the count
so i tried this
declare
l_cnt number := 0;
begin
execute immediate 'select count(x)
into l_cnt
from stg';
dbms_output.put_line('l_cnt: '||l_cnt);
end;
/it gives me the error
ORA-00905: missing keyword
how do i get the count dynamically for a table created dynamically ?
EXECUTE IMMEDIATE 'SELECT COUNT (x) FROM stg' INTO l_cnt; -
ORA-00905: missing keyword while generating sqltxplain.sql
Hi All,
I got the below error while generating the sqltxplain.sql, please help me to sort it out.
SQL>/
old 1: ^^explain_plan_for.
new 1: EXPLAIN PLAN SET statement_id = '42881' INTO sqltxplain.sqlt$_sql_plan_table FOR
Dump file /q02/app/oracle/oaqadb/oaqa_oaqadb/udump/oaqa_ora_1847432.trc
ERROR at line 2:
ORA-00905: missing keyword
Database resides in
Oracle Database 10g Enterprise Edition
10.2.0.4.0
64bit
AIX(Operating System)
Regards,
Jagadish.
Edited by: 941792 on Jun 26, 2012 4:25 PMPlease read this:
https://forums.oracle.com/forums/ann.jspa?annID=718 -
ORA-00905: missing keyword -- with analytical query
Hi Gurus,
I created a function in my developer 10g server. where it worked fine.
But my SIT server is a Version 9.2.0.6.0 . The same function is giving me this error.
create or replace function test22 return number
is
CURSOR C2 IS
SELECT MAX(sysdate) OVER(PARTITION BY TO_CHAR(sysdate, 'MMRRRR') ORDER BY sysdate ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) EFF_FROM_DT_CONV
from dual ;
begin
for i in c2
loop
DBMS_OUTPUT.PUT_LINE('HI' || I.EFF_FROM_DT_CONV);
end loop;
null;
return 1;
end;
Show error
5/1 PL/SQL: SQL Statement ignored
5/130 PL/SQL: ORA-00905: missing keyword
Please help me how to resolve this issue.
If I run the sql statement in sqlprmt it works fine. But when I integrate with PL/SQL am getting errorYou properbly hit bug
Bug 3083373 ORA-905 when using an analytic clause in SQL within PLSQL
which is fixed in 9.2.0.7
As Workaround you could use dynamic SQL (EXECUTE IMMEDIATE...) -
SAP Upgrade ORA-00905: missing keyword
Dear experts,
we have a very urgent SAP upgrade case,
From SAP R/3 470 SR1 110 to ECC 6 EHP4 SPS09
source system have three languages ZH EN DE,it's a
non-unicode system,before SAP upgrade,From rscpinst, i delete language
German and change contry code to CN,
(China). Then there is only code page 8400,T-code: I18N check ok,now we have
a error during upgrade,i was already replace the kernel to 385 version(640_Rel Non-unicode,TP and R3trans alreay the latest version) repeat the SHADOW_IMPORT_UPG1 step but still fail,log result as follow,the SAPKLZHSR1EHP4ERP6F8.GS1 has incomplete conversion
but the previous log file I.E SAPKLZHSR1EHP4ERP6F7.GS1 also have incomplete conversion but no ORA-00905,we only have codepage 8400 and Non-unicode but why the log mention 4103 it's a Unicode code page,thanks a lot!
SHDUPGIMP1.ELG
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SHADOW IMPORT ERRORS and RETURN CODE in SAPKLZHSR1EHP4ERP6F8.GS1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2EETW000 SQL error 905 occured: ORA-00905: missing keyword
2EETW000 SQL error 905 occured: ORA-00905: missing keyword
1 ETP111 exit code : "8"
SAPKLZHSR1EHP4ERP6F8.GS1
4 ETW000 22 entries for RSMPTEXTS~ imported (SAPLMCB2 1*).
4 ETW000 1 entry for TLIBT~ updated (1MCB2).
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '41004e0041004c005900530045005f00440055005200430048004600dc004800520045004e0020002000200020002000200020002000200020002000' -> 'ANALYSE_DURCHF#HREN '
4 ETW000 0 entries from FUNCT~ (1ANALYSE_DURCHF#HREN %) deleted.
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '41004e0041004c005900530045005f00440055005200430048004600dc004800520045004e0020002000200020002000200020002000200020002000' -> 'ANALYSE_DURCHF#HREN '
4 ETW000 0 entries from FUNCT~ (1ANALYSE_DURCHF#HREN %) deleted.
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '41004e0041004c005900530045005f00440055005200430048004600dc004800520045004e0020002000200020002000200020002000200020002000' -> 'ANALYSE_DURCHF#HREN '
4 ETW000 0 entries from FUNCT~ (1ANALYSE_DURCHF#HREN %) deleted.
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '41004e0041004c005900530045005f00440055005200430048004600dc004800520045004e0020002000200020002000200020002000200020002000' -> 'ANALYSE_DURCHF#HREN '
4 ETW000 0 entries from TFTIT~ (1ANALYSE_DURCHF#HREN ) deleted.
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '41004e0041004c005900530045005f00440055005200430048004600dc004800520045004e0020002000200020002000200020002000200020002000' -> 'ANALYSE_DURCHF#HREN '
4 ETW000 0 entries from TFTIT~ (1ANALYSE_DURCHF#HREN ) deleted.
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '41004e0041004c005900530045005f00440055005200430048004600dc004800520045004e0020002000200020002000200020002000200020002000' -> 'ANALYSE_DURCHF#HREN '
4 ETW000 0 entries from TFTIT~ (1ANALYSE_DURCHF#HREN ) deleted.
4 ETW000 [ dev trc,00000] Wed Sep 7 10:41:04 2011 815387003 1338.120210
4 ETW000 [ dev trc,00000] OCIStmtExecute() failed with -1=OCI_ERROR 10 1338.120220
4 ETW000 [ dev trc,00000] SQL error 905: 6 1338.120226
4 ETW000 [ dbsloci.,00000] *** ERROR => Error 905 in stmt_fetch() from oci_execute_stmt(), orpc=0
4 ETW000 12 1338.120238
4 ETW000 [ dbsloci.,00000] *** ERROR => ORA-905 occurred when executing SQL stmt (parse error offset=110)
4 ETW000 9 1338.120247
4 ETW000 [ dev trc,00000] sc_p=0x140f618,no=67,idc_p=(nil),con=0,act=1,slen=149,smax=256,#vars=4,stmt=0x1783c10,table=
4 ETW000 17 1338.120264
4 ETW000 [ dev trc,00000] SELECT ID,OBJECT,LANGU,TYP,VERSION FROM "DOKIL~" WHERE (LANGU IN ( :A0 )) AND ID = :A1 AND OBJECT BE\
4 ETW000 9 1338.120273
4 ETW000 [ dev trc,00000] TWEEN :A2 ANALYSE#_DURCHF#REN % :A3 #?; 5 1338.120278
4 ETW000 [ dev trc,00000] sc_p=0x140f618,no=67,idc_p=(nil),con=0,act=1,slen=149,smax=256,#vars=4,stmt=0x1783c10,table=
4 ETW000 11 1338.120289
4 ETW000 [ dev trc,00000] Dumping DBSL stmt. cache: 5 1338.120294
4 ETW000 [ dev trc,00000] prep=0,lit=0,nsql=1,lobret=0,xop=1,dbcnt=0,upsh=(nil),stmtp=0x1784758,rtc=0
4 ETW000 29 1338.120323
4 ETW000 [ dev trc,00000] IN : cols=4,rmax=1,xcnt=0,rpc=0,rowi=0,rtot=0,upto=4294967295,rsize=28,vmax=32,bound=1,iobuf_p=0x1493510,vda_p=0x1784db0
4 ETW000 10 1338.120333
4 ETW000 [ dev trc,00000] lobs=0,lmax=0,lpcnt=0,larr=(nil),lcurr_p=(nil),rret=0 6 1338.120339
4 ETW000 [ dev trc,00000] SELECT ID,OBJECT,LANGU,TYP,VERSION FROM "DOKIL~" WHERE (LANGU IN ( :A0 )) AND ID = :A1 AND OBJECT BE\
4 ETW000 7 1338.120346
4 ETW000 [ dev trc,00000] TWEEN :A2 ANALYSE#_DURCHF#REN % :A3 #?; 5 1338.120351
4 ETW000 [ dbds ,00596] ***LOG BY2=>sql error 905 performing FET [dbds#2 @ 596]
4 ETW000 14 1338.120365
4 ETW000 [ dbds ,00596] ***LOG BY0=>ORA-00905: missing keyword [dbds#2 @ 596] 6 1338.120371
2EETW000 SQL error 905 occured: ORA-00905: missing keyword
4 ETW000 0 entries from FUNCT~ (1MCB_GRAPHIC_DAILY %) deleted.
4 ETW000 0 entries from FUNCT~ (%MCB_GRAPHIC_DAILY %) deleted.
4 ETW000 0 entries from TFTIT~ (1MCB_GRAPHIC_DAILY ) deleted.
4 ETW000 0 entries from TFTIT~ (%MCB_GRAPHIC_DAILY ) deleted.
SAPKLZHSR1EHP4ERP6F7.GS1
4 ETW000 1 entry for LDBNT~ imported (1FTI_TR_PL_CF *).
4 ETW000 0 d / 1 i / 0 u / 0 = 0% ucf LDBT~
4 ETW000 1 entry for LDBT~ imported (1FTI_TR_PL_CF).
4 ETW000 1 entry for TRDIRT~ inserted (SAPDBFTI_TR_POSITIONS 1*).
3WETW000 some text was mutilated during conversion from unicode to ascii in language '1'. This is the result: 'SP_JOTC ###############'
3WETW000 language = '1', converted from codepage 4103 to codepage 8400, incomplete conversion due to invalid chars: '530050005f004a004f005400430020002000200020002000200020002000200020003a571659a44e13664d881f75a74ec1542000200020002000200020002000' -> 'SP_JOTC ###############'
4 ETW000 REPOT1SAPDBFTI_TR_POSITIONS A replaced.
4 ETW000 0 entries from D020T~ (SAPDBFTI_TR_POSITIONS %) deleted.
4 ETW000 0 entries from D021T~ (SAPDBFTI_TR_POSITIONS %) deleted.
4 ETW000 0 entries from TRDIRT~ (DBFTI_TR_POSITIONSFXXX 1%) deleted.
4 ETW000 0 entries from TRDIRT~ (DBFTI_TR_POSITIONSNXXX 1%) deleted.
4 ETW000 0 entries from TRDIRT~ (DBFTI_TR_POSITIONSN001 1%) deleted.
4 ETW000 0 entries from TRDIRT~ (DBFTI_TR_POSITIONSSEL 1%) deleted.
4 ETW000 0 entries from TRDIRT~ (DBFTI_TR_POSITIONSSXXX 1%) deleted.
4 ETW000 0 entries from TRDIRT~ (DBFTI_TR_POSITIONSTOP 1%) deleted.
SAPup.ECO
Phase SHADOW_IMPORT_UPG1:
BLOCKED SIGNALS: ''
SAPup> Starting subprocess 2865 at 20110907101845
ENV: DIR_LIBRARY=/usr/sap/upgrade/upg_dir/abap/exenew
ENV: LD_LIBRARY_PATH=/usr/sap/upgrade/upg_dir/abap/exenew:/usr/sap/upgrade/upg_dir/jvm/jre/lib/amd64/server:/usr/sap/upgrade/upg_dir/jvm/jre/lib/amd64:/usr/sap/upgrade/upg_dir/jvm/jre/../lib/amd64:/usr/sap/GS1/SYS/exe/run:/oracle/GS1/102_64/lib
ENV: NLS_LANG=AMERICAN_AMERICA.WE8DEC
ENV: ORACLE_BASE=/oracle
ENV: ORACLE_HOME=/oracle/GS1/102_64
ENV: ORACLE_PSRV=GS1
ENV: ORACLE_SID=GS1
ENV: ORA_NLS33=/oracle/client/92x_64/ocommon/nls/admin/data
ENV: PATH=/usr/sap/upgrade/upg_dir/abap/exenew:/oracle/GS1/102_64/bin:.:/home/gs1adm:/usr/sap/GS1/SYS/exe/run:/opt/gcc295/bin:/opt/gnome/bin:/usr/games:/usr/bin/X11:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/global_lx/bin:/usr/global/bin
ENV: SAPSYSTEMNAME=GS1
ENV: auth_shadow_upgrade=0
ENV: dbms_type=ORA
ENV: dbs_ora_schema=SAPDAT
ENV: dbs_ora_tnsname=GS1
EXECUTING /usr/sap/upgrade/upg_dir/abap/exenew/tp (/usr/sap/upgrade/upg_dir/abap/exenew/tp) pf=/usr/sap/upgrade/upg_dir/abap/bin/SHDUPGIMP1.TPP put GS1
This is /usr/sap/upgrade/upg_dir/abap/exenew/tp version 376.03.38 (release 701)
This is /usr/sap/upgrade/upg_dir/abap/exenew/R3trans version 6.14 (release 701 - 03.06.11 - 17:57:00).
2EETW000 SQL error 905 occured: ORA-00905: missing keyword
2EETW000 SQL error 905 occured: ORA-00905: missing keyword
/usr/sap/upgrade/upg_dir/abap/exenew/R3trans finished (0008).
ERROR: stopping on error 8 during SHADOW IMPORT
Warning: Parameter INTERRUPT is no longer used.
Warning: Parameter DAYLIGHT_SHUTDOWN is no longer used.
Warning: Parameter WITH_TACOB is no longer used.
Warning: Parameter IMPDP_BY_EVENT is no longer used.
Warning: Parameter INTERRUPT is no longer used.
Warning: Parameter DAYLIGHT_SHUTDOWN is no longer used.
Warning: Parameter WITH_TACOB is no longer used.
Warning: Parameter IMPDP_BY_EVENT is no longer used.
Warning: Parameter DBCONFPATH is no longer used.
stopping on error 8 during SHADOW IMPORT
tp returncode summary:
TOOLS: Highest return code of single steps was: 8
WARNS: Highest tp internal warning was: 0118
tp finished with return code: 8
meaning:
A tool used by tp produced errors
Process with ID 2865 terminated with status 8
B.R
Lance.
Edited by: Yen on Sep 7, 2011 8:11 AMHello,
Following upg master was used -
51036889_1 BS 7 SR1 Upgrade Master 1/2
51036889_2 BS 7 SR1 Upgrade Master 2/2
And the kernel dvd used was NUC -
51036767_4 BS 7 SR1 Kernel 7.01
After successful upgrade to ecc6 EhP4, Unicode conversion was done later with UC kernel DVD (during IMPORT)
Thanks -
DBMS_ADVANCED_REQRITE getting ORA-00905: missing keyword
What am I doing wrong here?
17:17:29 NJ3417@pubd1> create table test_a (col_a varchar2(20));
Table created.
Elapsed: 00:00:00.04
17:17:55 NJ3417@pubd1> insert into test_a values('Red');
1 row created.
Elapsed: 00:00:00.02
17:18:09 NJ3417@pubd1> create table test_b (col_b varchar2(20));
Table created.
Elapsed: 00:00:00.02
17:18:32 NJ3417@pubd1> insert into test_b values('Blue');
1 row created.
Elapsed: 00:00:00.03
17:18:55 NJ3417@pubd1> commit;
Commit complete.
17:34:56 NJ3417@pubd1> begin
17:34:56 2 sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
17:34:56 3 name => 'Mikes SQL override',
17:34:56 4 source_stmt => 'SELECT col_a FROM test_a',
17:34:56 5 destination_stmt => 'SELECT col_b FROM test_b',
17:34:56 6 validate => FALSE);
17:34:56 7 end;
17:34:56 8 /
begin
ERROR at line 1:
ORA-00905: missing keyword
ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
ORA-06512: at line 2
17:54:18 NJ3417@pubd1> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
5 rows selected.Thanks,
Mikemtefft wrote:
What am I doing wrong here?I don't have your exact version but I believe you can not have any string as the name of the rewrite rule. See the documentation
Here is the working example:
SQL> select * from v$version ;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> create table test_a (col_a varchar2(20));
Table created.
SQL> insert into test_a values('Red');
1 row created.
SQL> create table test_b (col_b varchar2(20));
Table created.
SQL> insert into test_b values('Blue');
1 row created.
SQL> commit ;
Commit complete.
SQL> select col_a from test_a ;
COL_A
Red
SQL> select col_b from test_b ;
COL_B
Blue
begin
sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
name => 'Mikes SQL override',
source_stmt => 'SELECT col_a FROM test_a',
destination_stmt => 'SELECT col_b FROM test_b',
validate => FALSE);
end;
8 /
begin
ERROR at line 1:
ORA-00905: missing keyword
ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 29
ORA-06512: at "SYS.DBMS_ADVANCED_REWRITE", line 185
ORA-06512: at line 2
begin
sys.dbms_advanced_rewrite.declare_rewrite_equivalence(
name => 'myrule',
source_stmt => 'SELECT col_a FROM test_a',
destination_stmt => 'SELECT col_b FROM test_b',
validate => FALSE);
end;
8 /
PL/SQL procedure successfully completed.
SQL> show parameter rewrite
NAME TYPE VALUE
query_rewrite_enabled string TRUE
query_rewrite_integrity string enforced
SQL> alter session set query_rewrite_integrity=trusted ;
Session altered.
SQL> show parameter rewrite
NAME TYPE VALUE
query_rewrite_enabled string TRUE
query_rewrite_integrity string TRUSTED
SQL> select col_a from test_a ;
COL_A
Blue -
ORA-00905ISSING KEYWORD ERROR IS COMING
CREATE TABLE TEST
( INSTITUTIONLINKID NUMBER(*,0) NOT NULL ENABLE,
CARDMANAGEMENT_MODE VARCHAR2(8) NOT NULL ENABLE,
PINGENERATION_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
PIN_LENGTH NUMBER(*,0),
PIN_MODE VARCHAR2(8),
RE_REGISTRATION_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
CON_SMS_RETRY_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
CON_SMS_RETRY_COUNT NUMBER(*,0),
CON_SMS_RETRY_INTERVAL NUMBER(*,0),
SMS_RETRY_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
SMS_RETRY_COUNT NUMBER(*,0),
SMS_RETRY_INTERVAL NUMBER(*,0),
ERROR_SMS_RETRY_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
ERROR_SMS_COUNT NUMBER(*,0),
ERROR_SMS_INTERVAL NUMBER(*,0),
SAF_RETRY_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
SAF_RETRY_COUNT NUMBER(*,0),
SAF_RETRY_COUNT_INTERVAL NUMBER(*,0),
PIN_ONRECEIPT_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
LABEL_ONRECEIPT VARCHAR2(3) NOT NULL ENABLE,
FLASHMSG_REQUIRED VARCHAR2(3) NOT NULL ENABLE,
INSTITUTIONID VARCHAR2(6) NOT NULL ENABLE,
INSTITUTION_FIID VARCHAR2(20) NOT NULL ENABLE,
INSTITUTION_LOGICAL_NETWORK VARCHAR2(20) NOT NULL ENABLE,
AIRLINEPAYMENTFLAG VARCHAR2(1),
BILLPAYMENTFLAG VARCHAR2(1),
EXPIRY_PERIOD NUMBER(*,0),
INACTIVITY_PERIOD NUMBER(*,0),
PASSWORD_EXPIRYPERIOD NUMBER(*,0),
NOOFUNSUCCESSFULATTEMPTS NUMBER(*,0),
PASSWORDCHANGESPERDAY NUMBER(*,0),
LOGONLYFLAG VARCHAR2(1),
EMAILSMSALERTSREQUIRED VARCHAR2(3),
CAPCHE_REQUIRED VARCHAR2(3),
ONETIMEPASSWORD VARCHAR2(3),
OTPREMINDER VARCHAR2(6),
ACTIVATION_REQUIRED CHAR(1),
ACQ_INSTITUTION_IDEN_CODE VARCHAR2(11),
ADDITIONALBUFFER1 VARCHAR2(47),
ACCOUNT_LINKAGE_INDICATOR CHAR(1) DEFAULT 1 NOT NULL ENABLE,
CARDACCEPTORTERMID VARCHAR2(40) NOT NULL ENABLE,
CARDACCEPTORTERMNAME VARCHAR2(40) NOT NULL ENABLE,
AUTHID_P38 VARCHAR2(6) DEFAULT '000000' NOT NULL ENABLE,
CARDISSUERAUTHORIZERDATA_P61 VARCHAR2(19) DEFAULT '0000000000000000000' NOT N
ULL ENABLE,
POSADD_DATA_P63 VARCHAR2(48) DEFAULT '896523' NOT NULL ENABLE,
ACQ_INSTID_S100 VARCHAR2(11) DEFAULT '00000000000' NOT NULL ENABLE,
AUTH_INDICATORS_S121 VARCHAR2(20) DEFAULT '78562' NOT NULL ENABLE,
INVOICEDATA_S123 VARCHAR2(15) DEFAULT '012MPAY' NOT NULL ENABLE,
BATCH_SHIFT_DATA_S124 VARCHAR2(9) DEFAULT '123456' NOT NULL ENABLE,
REG_RECEIPT VARCHAR2(300) DEFAULT 'YOUR MOBILE NUMBER REGISTERED SUCCESSFULLY
' NOT NULL ENABLE,
CHEQUE_LENGTH VARCHAR2(2),
VIRTUALCARD VARCHAR2(45),
VIRTUALCARDPREFIX VARCHAR2(6),
CARD_SEQUENCE VARCHAR2(13) DEFAULT 1111111111,
POS_DISCLAIMER VARCHAR2(200),
POS_TRAN_COMM VARCHAR2(12),
FSS_FTTYPE CHAR(1),
FSS_ACCOUNTNO VARCHAR2(25),
FSS_ACCOUNTTYPE VARCHAR2(2),
FSS_IFSCCODE VARCHAR2(25),
FSS_ACCOUNTHOLDERNAME VARCHAR2(50),
MBTACCOUNTNO VARCHAR2(20),
MBTACCOUNTTYPE VARCHAR2(2),
SAVINGACCOUNTLIST VARCHAR2(500),
CURRENTACCOUNTLIST VARCHAR2(500),
BRANCHFLAG CHAR(1) DEFAULT 'N',
NBIN VARCHAR2(4),
NPCIPACQUIRERID VARCHAR2(11),
FUNCODE_P24 VARCHAR2(5),
FWDINSTID_P33 VARCHAR2(12),
P42_MCOMID VARCHAR2(30),
P43_MCOMNAME VARCHAR2(30),
SMSPIN_REQUIRED VARCHAR2(10),
BENREGCONFIRMREQ VARCHAR2(1),
IMPS_VERIFICATION_REQUIRED VARCHAR2(1),
BUILD_MM_STATUS VARCHAR2(1),
WAP_PWD_REQUIRED VARCHAR2(1) DEFAULT NULL,
CONSTRAINT PK_INSTITUTIONLINK PRIMARY KEY (INSTITUTIONLINKID)
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
ENABLE,
CONSTRAINT ILI_IID FOREIGN KEY (INSTITUTIONID)
REFERENCES INSTITUTIONINFO (INSTITUTION_ID) ENABLE
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT);Hi,
You should look at sqlplus error and line number:
>
CARDISSUERAUTHORIZERDATA_P61 VARCHAR2(19) DEFAULT '0000000000000000000' NOT N
ERROR at line 45:
ORA-00905: missing keyword
>
You have got "not null" keyword splitting to 2 lines:
>
CARDISSUERAUTHORIZERDATA_P61 VARCHAR2(19) DEFAULT '0000000000000000000' NOT N
ULL ENABLE,
Should be :
CARDISSUERAUTHORIZERDATA_P61 VARCHAR2(19) DEFAULT '0000000000000000000' NOT NULL ENABLE, -
hi guys,
Can anyone tell me what is the easiest way to find out Report miss match error of bi with r3 report especially in fi.
thanks in advance,
regards,
Bunty.lots of ways we can do that.Check your reconciliation reports at your organistaion , then you will get an idea how they compare each time otherwise in general everybody copies data in excel and want to compare.
Maybe you are looking for
-
Customer ageing report - FI AR Drilldown reports
Hi, There is standard report for Customer Due Date Analysis S_ALR_87012168 . this report displays amount in local currency value only. Is there any Standard report for Customer due date analysis in Document Currency. i seached SDN, there is no po
-
Client Agent installation on SCCM Primary Site Server
Hello, I Installed Client agent via Client push to my SCCM Primary Site. Installation was sucessfull (Return code 0 in ccmsetup.log). But in console still the client status shows 'NO'. Is there any difference when installing Client agent on Primary S
-
Flex 3 + Flash Player 9,0,16
I'm currently very close to deployment of a major flex 3 application deployment into a corporate environment with thousands of distributed desktops. The IT group has Flash 9,0,16 installed on the images for those machines, and a full rollout to a cur
-
Header and Item table - Form Design Question
Hi All, I have a header table and Item table. For every record in the header table I have multiple records in the item table. I want to have a adobe form in the following way 1. A new page starts for every record in the header table and Items in the
-
How to implement hasing algorithm in oracle
implement hasing algorithm in oracle