Compile forms error because using rank function
Hi,
Oracle Form 9i don't known rank function in my SQL statement. When compile forms, it alerts err message: "Encountered the symbol "(" when expecting one ..."
code:
select * from (
select group_id, acct_no, acct_desc, rank() over(order by acct_no desc) rank_no from customer
where group_id='002'
) where rank_no< 10000
Help me ASAP.
Many thank,
Bum.
Where is INTO clause ? Plz provide the actual code you are writing.
I think this type of queries not supported in Forms 9i.....try forms 10g or above.
Similar Messages
-
Error using Rank function in Answers
Hi All,
Am trying to generate a report in Answers which lists Top Accounts with Revenue.
I Ranked the Revenue field and it is returning me correct values. ( Rank(account.revenue) )
But, when I try to filter on this field and restrict the rows which shows only top 10 Accounts, it is returning the following error:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 1792, message: ORA-01792: maximum number of columns in a table or view is 1000 at OCI call OCIStmtExecute. [nQSError: 17010] SQL statement preparation failed. (HY000)
Can any one help me on this.
Thanks in Advance,
Imtiaz.Hi Joe,
This is the Physical query generated when I use Rank function and the report is fine.
select distinct D1.c1 as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10,
D1.c11 as c11,
D1.c12 as c12,
D1.c13 as c13,
D1.c14 as c14,
D1.c15 as c15
from
(select D1.c1 as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10,
D1.c11 as c11,
D1.c12 as c12,
D1.c13 as c13,
D1.c14 as c14,
D1.c15 as c15
from
(select Case when D1.c1 is not null then Rank() OVER ( ORDER BY D1.c1 DESC NULLS LAST ) end as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c1 as c4,
D1.c4 as c5,
D1.c5 as c6,
D1.c6 as c7,
D1.c7 as c8,
D1.c8 as c9,
D1.c9 as c10,
D1.c10 as c11,
D1.c11 as c12,
D1.c12 as c13,
D1.c13 as c14,
D1.c14 as c15,
ROW_NUMBER() OVER (PARTITION BY D1.c1, D1.c2, D1.c3, D1.c4, D1.c5, D1.c6, D1.c7, D1.c8, D1.c9, D1.c10, D1.c11, D1.c12, D1.c13, D1.c14 ORDER BY D1.c1 ASC, D1.c2 ASC, D1.c3 ASC, D1.c4 ASC, D1.c5 ASC, D1.c6 ASC, D1.c7 ASC, D1.c8 ASC, D1.c9 ASC, D1.c10 ASC, D1.c11 ASC, D1.c12 ASC, D1.c13 ASC, D1.c14 ASC) as c16
from
(select distinct T690.SUM_REVN_AMT as c1,
T690.NAME as c2,
T2216.NAME as c3,
T690.X_PETROFAC_REVN as c4,
T690.SUM_WIN_PROB as c5,
T690.X_PERCENT_GET as c6,
T690.SUM_WIN_PROB * T690.X_PERCENT_GET / nullif( 100, 0) as c7,
T690.X_EC_PRIORITY as c8,
T19028.LOGIN as c9,
T690.X_COUNTRY as c10,
T690.X_REGION as c11,
T18311.NAME as c12,
T18641.NAME as c13,
T18238.NAME as c14
from
SIEBEL.S_BU T18238 left outer join (
SIEBEL.S_USER T19028 left outer join (
SIEBEL.S_OPTY T690 left outer join SIEBEL.S_STG T2216 On T690.CURR_STG_ID = T2216.ROW_ID) left outer join SIEBEL.S_ORG_EXT T1189 On T690.PR_DEPT_OU_ID = T1189.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18311 /* Competitor */ On T690.PR_CMPT_OU_ID = T18311.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18641 /* Partner */ On T690.PR_PRTNR_ID = T18641.ROW_ID) left outer join SIEBEL.S_POSTN T19114 On T690.PR_POSTN_ID = T19114.PAR_ROW_ID) left outer join SIEBEL.S_OPTY_BU T18280 On T690.ROW_ID = T18280.OPTY_ID) left outer join SIEBEL.S_OPTY_X T19415 On T690.ROW_ID = T19415.PAR_ROW_ID) On T19028.PAR_ROW_ID = T19114.PR_EMP_ID) On T18238.ROW_ID = T18280.BU_ID
) D1
) D1
where ( D1.c16 = 1 )
) D1
order by c1 desc
But When I apply Filter on this Rank column then it gives me the error. THis is the Physical query for that
select distinct Case when D1.c1 is not null then Rank() OVER ( ORDER BY D1.c1 DESC NULLS LAST ) end as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c1 as c4,
D1.c4 as c5,
D1.c5 as c6,
D1.c6 as c7,
D1.c7 as c8,
D1.c8 as c9,
D1.c9 as c10,
D1.c10 as c11,
D1.c11 as c12,
D1.c12 as c13,
D1.c13 as c14,
D1.c14 as c15
from
(select D1.c1 as c1,
D1.c2 as c2,
D1.c3 as c3,
D1.c4 as c4,
D1.c5 as c5,
D1.c6 as c6,
D1.c7 as c7,
D1.c8 as c8,
D1.c9 as c9,
D1.c10 as c10,
D1.c11 as c11,
D1.c12 as c12,
D1.c13 as c13,
D1.c14 as c14
from
(select T690.SUM_REVN_AMT as c1,
T690.NAME as c2,
T2216.NAME as c3,
T690.X_PETROFAC_REVN as c4,
T690.SUM_WIN_PROB as c5,
T690.X_PERCENT_GET as c6,
T690.SUM_WIN_PROB * T690.X_PERCENT_GET / nullif( 100, 0) as c7,
T690.X_EC_PRIORITY as c8,
T19028.LOGIN as c9,
T690.X_COUNTRY as c10,
T690.X_REGION as c11,
T18311.NAME as c12,
T18641.NAME as c13,
T18238.NAME as c14,
Case when T690.SUM_REVN_AMT is not null then Rank() OVER ( ORDER BY T690.SUM_REVN_AMT DESC NULLS LAST ) end as c15
from
SIEBEL.S_BU T18238 left outer join (
SIEBEL.S_USER T19028 left outer join (
SIEBEL.S_OPTY T690 left outer join SIEBEL.S_STG T2216 On T690.CURR_STG_ID = T2216.ROW_ID) left outer join SIEBEL.S_ORG_EXT T1189 On T690.PR_DEPT_OU_ID = T1189.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18311 /* Competitor */ On T690.PR_CMPT_OU_ID = T18311.ROW_ID) left outer join SIEBEL.S_ORG_EXT T18641 /* Partner */ On T690.PR_PRTNR_ID = T18641.ROW_ID) left outer join SIEBEL.S_POSTN T19114 On T690.PR_POSTN_ID = T19114.PAR_ROW_ID) left outer join SIEBEL.S_OPTY_BU T18280 On T690.ROW_ID = T18280.OPTY_ID) left outer join SIEBEL.S_OPTY_X T19415 On T690.ROW_ID = T19415.PAR_ROW_ID) On T19028.PAR_ROW_ID = T19114.PR_EMP_ID) On T18238.ROW_ID = T18280.BU_ID
) D1
where ( D1.c15 <= 10 )
) D1
order by c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15
Thanks,
Imtiaz -
ORA-00902: invalid datatype comile error while using CAST function
Hi everyone,
I'm getting ORA-00902: invalid datatype compilation error while using CAST function.
open ref_cursor_list for select empName from TABLE(CAST(part_t AS partnumberlist));
The partnumberlist and ref_cursor_list is declared in the Package spec as given below.
TYPE ref_cursor_list IS REF CURSOR;
TYPE partnumberlist IS TABLE OF emp.empName%TYPE;
The error points the partnumberlist as invalid datatype in TOAD because of this i'm unable to compile the package.
Any suggestion
Thanks and regards
Sathish GopalHere is my code for
package Spec
CREATE OR REPLACE PACKAGE "HISTORICAL_COMMENTZ" AS
TYPE prior_part_data_record IS RECORD (
prior_part_row_id PGM_RPLCMNT_PART.PR_PART_ROW_S_ID%TYPE,
prior_pgm_chng_s_id PGM_RPLCMNT_PART.PR_PGM_CHNG_S_ID%TYPE
TYPE parts_list IS TABLE OF prior_part_data_record;
--TYPE parts_list IS TABLE OF NUMBER;
TYPE partnumberlist IS TABLE OF PGM_RPLCMNT_PART.PR_PART_ROW_S_ID%TYPE;
TYPE partnumber_cursor IS REF CURSOR;
TYPE comment_record IS RECORD (
pgm_s_id PGM_PART_CMNT.PGM_S_ID%TYPE,
part_row_s_id PGM_PART_CMNT.PART_ROW_S_ID%TYPE,
pgm_chng_s_id PGM_PART_CMNT.PGM_CHNG_S_ID%TYPE,
cmnt_txt PGM_PART_CMNT.CMNT_TXT%TYPE,
cmnt_dt PGM_PART_CMNT.CMNT_DT%TYPE,
updt_rsrc_id PGM_PART_CMNT.UPDT_RSRC_ID%TYPE
TYPE comment_list IS TABLE OF comment_record;
global_pgm_s_id INTEGER := 0;
global_part_row_s_id INTEGER := 0;
err_num NUMBER := 999999;
err_msg VARCHAR2 (250);
PROCEDURE getComments (
pgm_s_id IN NUMBER,
part_row_s_id IN NUMBER,
partnumber_cursorlist out partnumber_cursor);
END;
Package Body
CREATE OR REPLACE PACKAGE BODY HISTORICAL_COMMENTZ
AS
FUNCTION getPriorPart
(param_prior_pgm_chng_s_id IN PGM_RPLCMNT_PART.PR_PGM_CHNG_S_ID%TYPE,
return_prior_part_data_record IN OUT prior_part_data_record
RETURN INTEGER
IS
retVal INTEGER;
prior_part_row_id INTEGER;
prior_pgm_chng_s_id INTEGER;
local_prior_part_data_record prior_part_data_record;
BEGIN
SELECT PR_PART_ROW_S_ID AS prior_part_row_id, PR_PGM_CHNG_S_ID AS prior_pgm_chng_s_id
INTO local_prior_part_data_record
--SELECT PR_PART_ROW_S_ID INTO retVal
FROM PGM_RPLCMNT_PART
WHERE PGM_S_ID = global_pgm_s_id AND CUR_PGM_CHNG_S_ID = param_prior_pgm_chng_s_id;
return_prior_part_data_record := local_prior_part_data_record;
retVal := 0;
RETURN retVal;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
err_num := SQLCODE;
err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
retVal := -1;
RETURN retVal;
WHEN OTHERS
THEN
err_num := SQLCODE;
err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
retVal := -1;
RETURN retVal;
END getPriorPart;
FUNCTION getComment (found_parts_list IN parts_list, comments OUT comment_list)
RETURN INTEGER
IS
CURSOR init_cursor
IS
SELECT PGM_S_ID,PART_ROW_S_ID,PGM_CHNG_S_ID,CMNT_TXT,CMNT_DT,UPDT_RSRC_ID
FROM PGM_PART_CMNT WHERE 1 = 2;
retVal INTEGER;
indexNum PLS_INTEGER;
local_part_record prior_part_data_record;
local_comment_record comment_record;
local_part_row_s_id NUMBER;
i PLS_INTEGER;
BEGIN
OPEN init_cursor;
FETCH init_cursor
BULK COLLECT INTO comments;
i := 0;
indexNum := found_parts_list.FIRST;
WHILE indexNum IS NOT NULL
LOOP
local_part_record := found_parts_list(indexnum);
local_part_row_s_id := local_part_record.prior_part_row_id;
SELECT PGM_S_ID,PART_ROW_S_ID,PGM_CHNG_S_ID,CMNT_TXT,CMNT_DT,UPDT_RSRC_ID
INTO local_comment_record FROM PGM_PART_CMNT
WHERE PGM_S_ID = global_pgm_s_id
AND PART_ROW_S_ID = local_part_row_s_id;
comments(i) := local_comment_record;
i := i + 1;
END LOOP;
RETURN retval;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
err_num := SQLCODE;
err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
RETURN retval;
WHEN OTHERS
THEN
err_num := SQLCODE;
err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
RETURN retval;
END getComment;
PROCEDURE getComments
pgm_s_id IN NUMBER,
part_row_s_id IN NUMBER,
partnumber_cursorlist OUT partnumber_cursor)
IS
comment_recordlist comment_record;
retPartnumberlist partnumberlist;
found_parts_list parts_list;
local_part_record prior_part_data_record;
is_more_parts BOOLEAN;
driver_chng_s_id NUMBER;
num_parts NUMBER;
retVal NUMBER;
comments comment_list;
returnPartnumberlist partnumberlist;
iloopCounter PLS_INTEGER;
inx1 PLS_INTEGER;
part_t partnumberlist :=partnumberlist(100,200,300);
CURSOR part_list_init_cursor
IS
SELECT PR_PART_ROW_S_ID,PR_PGM_CHNG_S_ID FROM PGM_RPLCMNT_PART WHERE 1 = 2;
CURSOR inIt_cursor
IS
SELECT 0 FROM DUAL WHERE 1 = 2;
BEGIN
DBMS_OUTPUT.ENABLE (5000000);
global_pgm_s_id := pgm_s_id;
global_part_row_s_id := part_row_s_id;
SELECT PART_ROW_S_ID AS prior_part_row_id, PR_PGM_CHNG_S_ID AS prior_pgm_chng_s_id
INTO local_part_record
FROM PGM_RPLCMNT_PART
WHERE PGM_S_ID = global_pgm_s_id AND PART_ROW_S_ID = global_part_row_s_id AND
CUR_PGM_CHNG_S_ID IN (SELECT MAX(CUR_PGM_CHNG_S_ID) FROM PGM_RPLCMNT_PART WHERE
PGM_S_ID = global_pgm_s_id AND PART_ROW_S_ID = global_part_row_s_id
GROUP BY PART_ROW_S_ID);
OPEN part_list_init_cursor;
FETCH part_list_init_cursor
BULK COLLECT INTO found_parts_list;
-- Add the existing part to the found list
found_parts_list.EXTEND;
found_parts_list(1) := local_part_record;
driver_chng_s_id := local_part_record.prior_pgm_chng_s_id;
num_parts := 1;
is_more_parts := TRUE;
WHILE (is_more_parts) LOOP
retVal := getPriorPart(driver_chng_s_id,local_part_record);
IF (retVal != -1) THEN
found_parts_list.EXTEND;
num_parts := num_parts + 1;
found_parts_list(num_parts) := local_part_record;
driver_chng_s_id := local_part_record.prior_pgm_chng_s_id;
ELSE
is_more_parts := FALSE;
END IF;
END LOOP;
--num_parts := getComment(found_parts_list,comments);
OPEN init_cursor;
FETCH init_cursor
BULK COLLECT INTO returnPartnumberlist;
num_parts := found_parts_list.COUNT;
FOR iloopCounter IN 1 .. num_parts
LOOP
returnPartnumberlist.EXTEND;
returnPartnumberlist(iloopCounter) := found_parts_list(iloopCounter).prior_part_row_id;
END LOOP;
retPartnumberlist := returnPartnumberlist;
open
* partnumber_cursorlist for select PR_PART_ROW_S_ID from TABLE(CAST(retPartnumberlist AS historical_commentz.partnumberlist));*
DBMS_OUTPUT.put_line('Done....!');
EXCEPTION
some code..............................
END getComments;
END HISTORICAL_COMMENTZ;
/ -
How to use "Rank" function in Oracle?
I need to display Top 15 records by using rank function.
Here is my query...I need to pull top 15 FAQ's using the below query.. How can I use RANK function to display the Top 15 FAQ"s in the list.
Select distinct SUb1.FAQ,Sub1.FAQ_Hits,GU.display_Name_FMLS as displayname,ev.ParentLinkrecordid,ev.userid from User GU
Join Event ev
ON LOWER (ev.userid) IN (LOWER (GU.lanid), LOWER (Gu.racfid))
Join (Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID from Event ev
Join SubjectMatter sm
ON (TO_CHAR (sm.smrecordid) = ev.eventdetail1) AND ev.eventdetail1 IS NOT NULL AND sm.smtype = 1
Where (Upper(ev.eventsubtype) in (Upper('FAQ'),Upper('OPENFAQ')))
AND TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= TO_DATE ('20100601', 'yyyymmdd')
and TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= TO_DATE ('20100831', 'yyyymmdd')
Group by sm.stem,ev.Parentlinkrecordid
order by FAQ )sub1
ON Sub1.Topic_ID = ev.ParentLinkrecordid)A few bits that I noticed in the query ...
in (Upper('FAQ'),Upper('OPENFAQ'))1) Do you really a upper for a string which is already in upper case.
Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID2) Do you need a distinct when you are using a GROUP function viz. SUM ?
You rank query is as follows, I am not very good at the ANSI style JOIN so changed it slightly ... :-)
Also notice the usage rank function in the "sub1" query.
select distinct sub1.faq,
sub1.faq_hits,
gu.display_name_fmls as displayname,
ev.parentlinkrecordid,
ev.userid
from user gu, event ev,
(select rank() over (order by sum(ev.eventresults) desc) rnk,
sum(ev.eventresults) as faq_hits,
sm.stem as faq,
ev.parentlinkrecordid as topic_id
from event ev, subjectmatter sm
where (to_char(sm.smrecordid) = ev.eventdetail1)
and ev.eventdetail1 is not null
and sm.smtype = 1
AND upper(ev.eventsubtype) in ('FAQ', 'OPENFAQ')
and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= to_date('20100601', 'yyyymmdd')
and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= to_date('20100831', 'yyyymmdd')
group by sm.stem, ev.parentlinkrecordid
order by faq) sub1
where lower(ev.userid) in (lower(gu.lanid), lower(gu.racfid))
and sub1.topic_id = ev.parentlinkrecordid)
and sub1.rnk <= 15;Like mentioned above, some sample data would have helped. -
Sql tuning using rank function
Hi,
Can someone help me in writing the below qry using rank() function?
DELETE FROM stc_calllog_ext a
WHERE a.stc_save_status = 'CT'
AND ROWID IN (SELECT a.ROWID
FROM stc_calllog_ext a, calllog_ext b
WHERE a.prod_line_code= b.prod_line_code
AND a.brand_code = b.brand_code
AND a.model_number = b.model_number
AND a.stc_save_status != b.stc_save_status
AND trunc(a.stc_start_time) = trunc(b.stc_start_time)
AND a.stc_start_time BETWEEN TRUNC(SYSDATE-8) AND TRUNC(SYSDATE)
AND a.call_taker_userid = b.call_taker_userid
AND a.cons_telephone_no =b.cons_telephone_no
)With the information you have provided, I've come up with the following.
SELECT A.ACCOUNT_NO, A.PAYMENT_TYPE, A.INSTALLMENT_TYPE, A.DATE_CHANGE
FROM
(SELECT account_no, payment_type, installment_type, date_change,
LEAD( (payment_type), 1)
over (partition by account_no order by account_no, DATE_CHANGE) LEAD_PAY,
LEAD( (installment_type), 1)
over (partition by account_no order by account_no, DATE_CHANGE) LEAD_INST
from T_ACCNTS ) A
WHERE A.PAYMENT_TYPE <> NVL(A.LEAD_PAY,99)
OR A.INSTALLMENT_TYPE <> NVL(A.LEAD_INST,99)
ORDER BY 1, 4; -
Error when using SUM function in Excel template
I am trying to use the XDO_METADATA to create a sum of a column from my XML data and I am getting the following error in the Template Viewer:
[111412_104246459][][PROCEDURE] Log Level is changed to PROCEDURE
[111412_104246553][oracle.xdo.common.xml.XSLTWrapper][ERROR] XSL error:
Time: 0.125 sec.
FO Formatting failed.
<Line 317, Column 116>: XML-23029: (Error) FORG0001: invalid value for cast/constructor
@Line 317 ==> <Cell Index="2" Style="R7C3" Field="XDO_?SUM_V_CR_MO_IDD1?"><xsl:value-of select="sum(.//G_CR_MST_D/V_CR_MO_IDD)"/>
when I use:
XDO_?SUM_V_CR_MO_IDD1? <?sum(.//G_CR_MST_D/V_CR_MO_IDD)?>
or
[111412_104048508][][PROCEDURE] Log Level is changed to PROCEDURE
[111412_104048554][oracle.xdo.common.xml.XSLTWrapper][ERROR] XSL error:
Time: 0.078 sec.
FO Formatting failed.
<Line 317, Column 105>: XML-23029: (Error) FORG0001: invalid value for cast/constructor
@Line 317 ==> <Cell Index="2" Style="R7C3" Field="XDO_?SUM_V_CR_MO_IDD1?"><xsl:value-of select="sum(.//V_CR_MO_IDD)"/>
when I use:
XDO_?SUM_V_CR_MO_IDD1? <?sum(.//V_CR_MO_IDD)?>
I believe the XSL to be correct because when I change it to a count it works and when I go into BI Publisher 11g and create the query in the data model and then create a summary from it, the summary is created.
Can anyone help?I went back to basics and created reports (via EXCEL templates) like I was asking based on good old EMP and DEPT and I found exactly the same problems I was mentioning. I looked at the templates provided but they were not calculating totals, like me they were selecting them and then just displaying them on the page.
Anyway, I have narrowed it down to the fact that when you do aggregates like sum(.//SAL) this works if you have a salary for every value. I did an outer join with DEPT so I did have empty rows and why I still experienced the problems.
Basically XSL does not like adding (including using the sum function) values that effectively have nulls in them which is why I get the cast/constructor errors because it is trying to turn a NaN value to a number and does not (or cannot) do it.
You need to either have a value in every row of your column (maybe possible by selecting nvl in your query) and make sure that you check the "create empty nodes" checkbox in the data model of BI Publisher.,
the other solution is an xsl solution where you would have to make sure that you only added non null values and for that you would have to investigate xsl blogs.
It is, by the way, why my count worked because it is just counting that the record exists it does not care what the element content is or isn't.
Closing thread. -
Error while using group function
Oracle forms6i
Hai
While i am compile my coding it compile successfully, but when i tried to executes i shows error in group function
my coding is
if (cnt<>0 ) then
select BARCODE,INTIME,OUTTIME into today_bar,today_in,today_out from dail_att where BARCODE= :Barcode
and ATTEND_DATE = :bardate;
update dail_att set outtime = max(:bartime) where barcode= :barcode
and ATTEND_DATE = :bardate;
else
if (cnt2<>0 ) then
select INTIME,OUTTIME into yest_in,yest_out from dail_att where BARCODE= :Barcode
and ATTEND_DATE = :bardate-1;
if(yest_in is not null and yest_out is null) then
update dail_att set outtime =max(:bartime) where barcode= :barcode
and ATTEND_DATE = :bardate-1;
else
insert into dail_att(barcode,intime,attend_date)
values(:barcode,min(:bartime),:bardate);
end if;
else
if :bartime between 0100 and 0630 then
insert into dail_att(barcode,intime,attend_date)
values(:barcode,min(:bartime),:bardate-1);
update dail_att set outtime = max(:bartime) where barcode= :barcode
and ATTEND_DATE = :bardate-1;
else
insert into dail_att(barcode,intime,attend_date)
values(:barcode,:min(bartime),:bardate);
end if;
end if;
end if;
while i am trying to this groupfunction it throws error while i use having tell me how to use group function and where
to use
Regadrs
Srikkanth.MHai sir
I had a table that contain fields
EMPCODE NUMBER
EMPNAME VARCHAR2(25)
BARCODE VARCHAR2(25)
INTIME VARCHAR2(25)
OUTTIME VARCHAR2(25)
INTRTIMEIN VARCHAR2(25)
INTROUTTIME VARCHAR2(25)
PERTIMEIN VARCHAR2(25);
PERTIMEOUT VARCHAR2(25);
ATTEND_DATE DATE ;
Consider that a table with 6 fields ie timein,intrtimein,pertimein,pertimeout,intrtimeout,timeout
I have generating a attendance table and a table contain 6 various times for an employees and we need to arrange it in order
0815,0816,1230,1250,1645,1646
If 0815 is the starting time then timein ie mintime
0816 stored to be in intrtime
then1250 then it stored in pertimein
then 1230 then it stored in pertimeout
then 1645 stored in intrtimeout
then 1646 stored in timeout
I tried with max and min function but its not working properly pls tell me some solutions
Thanks & Regards
Srikkanth.M -
Error in using aggregate function in Outer Query in Siebel Analytics
Hi,
When I am using aggregate function in outer query in Siebel Analytics I am facing error.
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 59111] The SQL statement must include a GROUP BY clause. (HY000)
Bellow is the code.
SELECT test1.username saw_0, test1.desg saw_1,COUNT (test2.querydate) saw_2
FROM (SELECT POSITION.CBL username,
POSITION.CBP desg
FROM "CM"
WHERE (POSITION.BPTCD = 'Marketing')
AND (POSITION.EDate =TIMESTAMP '1899-01-01 00:00:00'
) test1,
(SELECT users.UN username,
measures."Query Count" querycount,
measures."Max Total Time" secs,
topic.db dashboardname,
"Query Time".DATE querydate
FROM "Plan"
WHERE (topic."Dashboard Name" IN ('DS'))) test2
WHERE test2.username = LOWER (test1.username)
AND test2.dashboardname = 'DS'
GROUP BY test1.username, test1.desgShould your query be a valid SQL query?
I can't think that the query you have would be valid in a SQL plus window.
Chris -
Error while using the function module..pack_handling_unit_dlvry
Hi all...
while using the function module pack_handling_unit_dlvry,
we need to pass the handling unit number as per the functionality we require.
but the mandatory field for the function module is the handling unit number in the form of bar code..
so how to use this function module..
All the useful answers will be regarded..
Regards,
Saroja.Have you tried using BAPI BAPI_HU_CREATE. Also view Function Module Documentation on its usage.
-
Error while using Evaluate function
Hi ,
I am using the following expression in the criteria tab in order to get first value for every customer order by date:
EVALUATE('FIRST_VALUE(%1) OVER (PARTITION BY %2 ORDER BY %3)' AS INTEGER, "Fact - Customer SubLedger"."TRANSACTION AMOUNT",Customer.CUST_ACCOUNT_NUMBER,"GL Date".DAY).
When I try to execute the report it throws following error :
*[nQSError: 42015] Cannot function ship the following expression: Evaluate( FIRST_VALUE(%1) OVER (PARTITION BY %2 ORDER BY %3),D1.c4, D1.c2, D1.c13)*
Can anybody help me with this? Where am i going wrong?
Regards,
VikasHi Kishore,
I am using the exactly same formula which you have mentioned here still it is giving me the same error.
EVALUATE('First_value(%1) over (partition by %2 order by %3)' AS DOUBLE , "Fact - Customer SubLedger"."OPENING BALANCE",Customer.CUST_ACCOUNT_NUMBER, "GL Date".DAY)
Error : *[nQSError: 42015] Cannot function ship the following expression: Evaluate( First_value(%1) over (partition by %2 order by %3),D909.c9, D909.c3, D909.c14)*
Can't say why it is behaving like this.
Anyways thanks all of you for your help.
May be I am going wrong somewhere else.I will try to solve this issue by myself.
Once again thanks to all of you.
Regards,
Vikas -
File scenario error in Used defined function
Hi Everyone,
I was doing file to file scenario, i want to get the same source file name in target also.
I created the structure as FileName, Company, Address. I did direct mapping for Company and Address
but for field FileName, i created a userdefined function as i want the same file name.
I mentioned the following code in Used defined function
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
When i test the mapping in IR, with sample data, i am getting this error.
RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:Target_File_MT/FileName. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._Source_File_to_Target_File_MM_ method DynamicFile$[, com.sap.aii.mappingtool.tf3.rt.Context@1763e46]
Could anyone please help me with the issue.
I have done only IR part, I didnot configured ID.
Regards,
Varun.HI,
Check Adapter Specific Message attributes.This blog will help you
The specified item was not found.
You can also go for variable substitution :-
When you specify the target directory and file name schema, you have option of setting variables and defining them in a table. The variables are replaced by elements from the XML structure at runtime.
http://help.sap.com/saphelp_nw2004s/helpdata/en/8e/464442c1a1c253e10000000a1550b0/content.htm
links on the dynamic variable substitution
The specified item was not found.
The specified item was not found.
Dynamic File Name Part 1
Dynamic File Name using XI 3.0 SP12 Part - I
Dynamic File Name Part 2
Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
Thanks -
Error while using Ago function
hi all,
OBI 11.1.1.7.1
I am unable to view data on result tab. No value returned in Calcutated Attribute. Please Help
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 22040] To use Ago function, the storage level of the query ('[Time Dim.PAY_DT]') must be a static level.Please have your System Administrator look at the log for more details on this error. (HY000)
Regards,
NiveditaSubstr("Fin Account".ASSET_NUM, 1, instr(Fin Account".ASSET_NUM, ':')+1)
or
Substr("Fin Account".ASSET_NUM, instr(Fin Account".ASSET_NUM, ':')+1,50)
i think you should use 3 parameters, did you try that if it would work?
additionally check what is the default format of your data: go to column properties -> data format; if its text then ok; otherwise you will have to cast the number to char; in such a case the above could be:
Substr(cast("Fin Account".ASSET_NUM as char(20)), 1, instr(cast(Fin Account".ASSET_NUM as char(20)), ':')+1)
or
Substr(cast("Fin Account".ASSET_NUM as char(20)), instr(cast(Fin Account".ASSET_NUM as char(20)), ':')+1,50)
Edited by: UserMB on Jun 25, 2009 6:17 AM -
How to use RANK function ?
Hello everyone,
here is the query I run in sql developer using RANKFunction.
SELECT Empno, Ename, Job, Mgr, Hiredate, Sal
FROM
(SELECT Empno, Ename, Job, Mgr, Hiredate, Sal,
*RANK*() OVER
(ORDER BY SAL Desc NULLS LAST) AS Emp_Rank
FROM Emp
ORDER BY SAL Desc NULLS LAST)
WHERE Emp_Rank < 6;How I can use this query in my report in obiee or is there any replacement of RANK() function in obiee so that I can use that to get my same above result.
ThanksKuldip wrote:
Thanks, you are absolutely correct. However, By doing this I am getting my output as whic I was not expecting.
Students Marks Rank
student1 95 1
student2 95 1
student3 93 3
student4 93 3
student5 91 5
The output should be as instead
Students Marks Rank
student1 95 1
student2 95 1
student3 93 2
student4 93 2
student5 91 3
Can It be done like this ?
Thanks.
Edited by: Kuldip on Mar 15, 2012 11:51 PMHi Boss,
I think you copied the above scenario from this site..
http://oracle-bi.siebelunleashed.com/articles/rank-and-dense-rank-functionsobiee/
Then why asking how to do this? Are you testing us? Doesn't that site say how to achieve this? -
Error when using CONVERT_OTF function module
Dear Friends,
In many of our reports we are using the function module CONVERT_OTF to send the output as a mail the users.
But after the latest patch update we have came across a new problem. Mail is getting triggered and we can also see the icon or
the file in mail. But when we are opening the file we are getting the message that "THERE WAS AN ERROR OPENING THIS
DOCUMENT. THE FILE IS DAMAGED AND COULD NOT BE REPAIRED.
Earlier this program has been working fine from last 2 years but after updating the patch in the of August 2009. This problem we are
facing. All our mails are not working.
Thanks
Vamshi
Edited by: Rob Burbank on Sep 7, 2009 3:12 PMDear Clemens,
Thank you for the immediate response. I have checked the program in Debug Mode. When we are passing the data to the CONVERT_OTF the output table of the function module is showing the data in some Unicode format in the tables OTF and LINES.
Out of the FM is in completely special characters and this is after updating the latest patch.
We are using Release 700 Level 19 and Service Package SAPKA70019.
Thanks and Regards
Vamshi Sreerangam
Edited by: vamshi sreerangam on Sep 8, 2009 5:54 AM -
Device: MBP 15" Retina 2.3 GHz Intel i7
OSX: 10.9.4
Monitor: 27" Thunderbolt Display
Issue: When using OSX functions like Mission Control (Expose) and spotlight, I frequently get graphical errors that remain on the desktop unless I reset the computer. I can resolve the issue by adding a new desktop and dragging my windows over.
This happens almost every day.You have installed all these non-Apple system modifications:
Kernel Extensions: ?
[loaded] at.obdev.nke.LittleSnitch (4052 - SDK 10.8) Support
[loaded] com.nvidia.CUDA (1.1.0) Support
[loaded] com.promise.driver.stex (5.2.7 - SDK 10.9) Support
[not loaded] com.silabs.driver.CP210xVCPDriver (3.0.0d1) Support
[not loaded] com.silabs.driver.CP210xVCPDriver64 (3.0.0d1) Support
[not loaded] com.wacom.kext.pentablet (5.2.6) Support
[not loaded] com.wacom.kext.wacomtablet (6.3.8 - SDK 10.9) Support
Litlle snitch has been a bad actor for some users.
You do not have any CUDA Hardware, so the CUDA Driver is not needed.
I do not know what siLabs driver thinks it may be driving.
You left the door open:
Gatekeeper: ?
Anywhere
Maybe you are looking for
-
Powerbook G4 dead or dying.
It froze up..very rare. Shut down with the power key. Has not booted since. Sometimes I get a whirring noise. Sometimes I get the grey apple screen. Sometimes I get a tone and three beeps (and the little light flashing at the bottom of the display).
-
hi all i manage a server with cf8. my customer decided to move server to a cloud. from that moment, i lost my sleep... one or twice a day jRun gets the error "JRun closed connection". this is a little report of situation... any help is very appreciat
-
Showing Keyfigures error for result and overall result in the Query output
Hi All, when executing query results show correct figures for qty & value but with ERROR instead of uom(Unit of Measurement) & currency; Can anybody help? Rgds, C.V.
-
Work Context is stored in which XML file
Hi, we have created a workcontext from the weblogic admin console for our application. I just wanna know in which xml file/file's the work context related information is stored. Thanks in advance
-
To Change Basic Unit of Measure
Dear Sappers, With refernce to my previous posted thread, below I am giving the detailed copy of *PERFORMANCE ASSISTANCE* The Performance Assistance is giving me solution to proceed but for proceeding further is not possible. As max no of sessions a