HQL/SQL query translator error on SJSAS 8.1 EE
I encountered an error while executing hibernate query in my app and the log message is shown below.
[#|2006-09-20T13:27:02.956-0400|WARNING|sun-appserver-ee8.1_02|javax.enterprise.system.stream.err|_ThreadID=12;|
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken|#] I am using HIberante 3 and I do have antlr-2.7.2.jar in my classpath. And I am using org.hibernate.hql.classic.ClassicQueryTranslatorFactory class instead of
org.hibernate.hql.ast.ASTQueryTranslatorFactory. I have also added the antlr-2.7.2.jar in classpath-prefix in domain.xml. Did anybody encounter the same problem? Please advice.
Thanks.
I fixed this problem by adding/changing two files: sun-web.xml and srever.policy.
In sun-web.xml
<sun-web-app>
<class-loader delegate="false"/>
</sun-web-app> In server.policy
grant {
permission java.security.AllPermission;
}; I am not if this is a good solution but it works.
Thanks.
Similar Messages
-
Display SQL query in error text
Using CFMX 6.1.
Is it possible to get our error handler page to display the
SQL query that fails and causes an error?
If tried #error.sql# but it doesn't exist after a db
exception. If I put a cftry around a particular query and then use
cfcatch.sql within a cfcatch tag pair, it works fine. But given our
error handler page is for the entire site, I can't use cfcatch, at
least not the way the site is currently architected. I was hoping
error.sql would work since my quick ref quide states that "Any
cfcatch variable that applies to exception type can be accessed
within the Error scope. But then it doesn't list Error.SQL or
CFCATCH.SQL for that matter in any documentation I've seen, yet the
later works in cfcatch tags.
Any help would be appreciated.You don't have to place a CFTRY/CFCATCH around each query. I
don't know how many pages you have in your application, but you
could do something like the following:
1. Replace <body> with <body><CFTRY>
2. Replace </body> with the following
<CFCATCH TYPE="database">
<CFMODULE TEMPLATE="customErrorPage.cfm"
sqlStatement="#CFCATCH.Sql# " message="#CFCATCH.message#">
</CFCATCH>
</CFTRY>
</body>
You can use a global search-and-replace utility, such as
SR32, to make this task painless. Click
here to go to the SR32
site. -
SQL query syntax error .......
I am using following query
SELECT PERNR VORNA NACHN GBDAT FROM PA0002
INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE UPPER( VORNA ) = UPPER( STRU_USERIP-VORNA )
AND ENDDA >= SY-DATUM
AND BEGDA <= SY-DATUM .
and I am geting syntax error as --
vorna is not valid comparison operator .
can anyone plz suggest me solution over this problem .Logic must be written,
The below logic is incomplete
Break your head and modify it
TABLES:pa0002.
DATA:itab TYPE TABLE OF pa0002.
DATA:wa TYPE pa0002.
DATA:lv_vorna TYPE pa0002-vorna.
DATA:ra_vorna TYPE RANGE OF pa0002-vorna.
DATA:wa_vorna LIKE LINE OF ra_vorna .
DATA:lv_index TYPE i.
DATA:offset TYPE i.
DATA:pa_vorna TYPE pa0002-vorna VALUE 'Frank'.
DATA:len TYPE i.
len = STRLEN( pa_vorna ).
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna TO LOWER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna TO UPPER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
wa_vorna-low = PA_VORNA.
APPEND wa_vorna TO ra_vorna.
TRANSLATE PA_VORNA TO LOWER CASE.
DO len TIMES.
lv_index = sy-index - 1.
offset = lv_index + 1.
DO len TIMES.
MOVE pa_vorna TO lv_vorna.
TRANSLATE lv_vorna+lv_index(offset) TO UPPER CASE.
wa_vorna-low = lv_vorna.
APPEND wa_vorna TO ra_vorna.
ADD 1 TO lv_index.
ENDDO.
ENDDO. -
SQL Query giving error in SAP B1 8.82 PL 09
Hi all,
Please check the query below.
If we remove the Where condition from the Query it works fine.
Otherwise it gives error. The error screen is also attached.
[Microsoft][SQL Server Native Client 10.0][SQL Server]The data types ntext and
ntext are incompatible in the equal to operator. 'Blanket Agreement'(OOAT)(OUQR)Dear Nagarajan K,
First of all Thank You for prompt reply to my query.
Select * from oinv T0 where T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1]
The issue with the above posted query is if you remove the filter conditions i.e where T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1]
The query works.
Put the filter condition back and it gives eror:
[Microsoft][SQL Server Native Client 10.0][SQL Server]The data types ntext and
ntext are incompatible in the equal to operator. 'Blanket Agreement'(OOAT)(OUQR)
What is possibly going wrong because data is there. -
Hi,
I'm trying to build a data model based on data on our server. I've created a Data Set in SQL using the Query Builder, but when I go to save, I receive this error message:
[Hyperion][SQLServer JDBC Driver][SQLServer]Invalid object name 'CMPROJ.DBO.ISDT'.
Does this have anything to do with accessing my server? Any suggestions?
Many Thanks.Sorry but this has nothing to do with this thread - aimed for questions around Oracle Communications Data Model, the Enterprise Data Warehouse for Telcos available as DB option.
You might want to ask your question to the BIapps folks/Hyperion Thread. If still interested by "building" a data model for comms, you'd better save time and get something pre-built like OCDM...
Regards
Axel. -
A feature I've come to rely on in Toad is that when I run a query and there is an error, the part of the code that caused the error will be highlighted. It's simple, and it's a big productivity boost. This feature is what's stopping me from using SQL Developer at this point. Are there plans to implement this?
I second this comment!
I do a lot of OWB development and I often validate results of the mapping directly in SQL (which are usually going on for 200-400 lines.
In toad, executing the statement wit an error (usually a constant defined in OWB but represented in the intermediaet result by a "FULLPACKAGE.BlaBlaBla will bring the cursor directly at the line that errored. SQL Developer will only give an error message. Kinda counter productive... -
SQL query returning error in 1 db and not in other db
database1
Select AMT_OFF,
COMMENT_TXT,
COOP_AMT_OFF,
DEAL_NO,
DETAIL_ID,
DETAIL_TYPE,
MAX_QTY,
MIN_QTY,
PACK_QTY,
PACK_TYPE,
PCT_OFF,
SEQ_NO,
SITE_NO,
VENDOR_ITEM
From dealdtl
WHERE (deal_no, site_no, seq_no) IN
(select deal_no, site_no, seq_no
from deal_sku
where sku_no = 29747
and apply_site_no = 1201
and deal_no = dealdtl.deal_no
and site_no = dealdtl.site_no
and seq_no = dealdtl.seq_no)
and min_qty <= decode(pack_type, 'P',1,'U',10)
and (site_no, deal_no) IN
(select site_no, deal_no
from dealhdr
where vendor_id = 'VNMIKE'
--and site_no = dealdtl.site_no
--and deal_no = dealdtl.deal_no
and start_dt <= to_date('12-SEP-08', tmxgbl.date_format)
and stop_dt >= to_date('12-SEP-08', tmxgbl.date_format)
query produces an error on to_date function ORA-01858 non numeric character found where numeric expected
all the tables have no data in them
i.e. if i do a
select site_no, deal_no
from dealhdr --0 rows
select deal_no, site_no, seq_no
from deal_sku--0 rows
Select AMT_OFF,
COMMENT_TXT,
COOP_AMT_OFF,
DEAL_NO,
DETAIL_ID,
DETAIL_TYPE,
MAX_QTY,
MIN_QTY,
PACK_QTY,
PACK_TYPE,
PCT_OFF,
SEQ_NO,
SITE_NO,
VENDOR_ITEM
From dealdtl--o rows
However, when the same query is executed in a different database, it does not bring up an error, same data condition 0 rows on all three tables.
On both databases tmxgbl.date_format returns the same 'mm/dd/rr' formaty mask
can somebody explain the reason for this please?
Thanks
Vijaystill no error on the database that doesn not throw an error
Select AMT_OFF,
COMMENT_TXT,
COOP_AMT_OFF,
DEAL_NO,
DETAIL_ID,
DETAIL_TYPE,
MAX_QTY,
MIN_QTY,
PACK_QTY,
PACK_TYPE,
PCT_OFF,
SEQ_NO,
SITE_NO,
VENDOR_ITEM
From dealdtl
WHERE (deal_no, site_no, seq_no) IN
(select deal_no, site_no, seq_no
from deal_sku
where sku_no = 29747
and apply_site_no = 1201
and deal_no = dealdtl.deal_no
and site_no = dealdtl.site_no
and seq_no = dealdtl.seq_no)
and min_qty <= decode(pack_type, 'P',1,'U',10)
and (site_no, deal_no) IN
(select site_no, deal_no
from dealhdr
where vendor_id = 'VNMIKE'
--and site_no = dealdtl.site_no
--and deal_no = dealdtl.deal_no
and start_dt <= to_date('09/12/08', chr(39)||tmxgbl.date_format||chr(39))
and stop_dt >= to_date('09/12/08', chr(39)||tmxgbl.date_format||chr(39))
--and start_dt <= to_date('12-SEP-08', 'CRAP')
--no error -
Newbie - help with a SQL query for a bar chart - Originally posted in APEX
I originally posted this in the APEX forum but someone there suggested this is more of a SQL question. Anyone out there who can provide some assistance?
Hi,
I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
select null link
, CATEGORY label
, count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
, count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
from GRAPO_PROHEADTRK
where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
group by CATEGORY
Order by COUNT(PROJECT_ID) DESC
The code from the other app was:
select null link
, FUNCTIONAL_AREA label
, count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
, count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
, count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
from PM_V2
where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
group by FUNCTIONAL_AREA
Order by COUNT(PROJECT_ID) DESC
I'm getting a "Failed to parse SQL query!" error when I try to run validation.
Is this enough info for some assistance? Any help would really be appreciated.
Thanks,
RachelHi, Rachel,
user10774102 wrote:
I originally posted this in the APEX forum but someone there suggested this is more of a SQL question. Anyone out there who can provide some assistance?
Hi,
I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
select null link
, CATEGORY label
, count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
, count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
from GRAPO_PROHEADTRK
where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
group by CATEGORY
Order by COUNT(PROJECT_ID) DESCIs there a problem with the code above?
It's curious that the WHERE clause includes "PROJECT_STATUS='6'", but there is no pivoted column for project_status='6', like there is for '1' through '5'. That's not necessarily a mistake, and it wouldn't raise an error in any case.
Instead of
where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')you could say
where PROJECT_STATUS IN ('1', '2', '3', '4', '5', '6')but that probably has nothing to do with your current problem.
The code from the other app was:
select null link
, FUNCTIONAL_AREA label
, count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
, count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
, count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
from PM_V2
where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
group by FUNCTIONAL_AREA
Order by COUNT(PROJECT_ID) DESC
I'm getting a "Failed to parse SQL query!" error when I try to run validation.Is that an Apex error message? Sorry, I don't know anything about Apex.
If you can't get a more specific error message from Apex, then try debugging this statement in SQL*Plus. When you get it fixed, then you can copy it back into Apex.
If this is a SQL problem, then you should be able to re-create the problem in pure SQL.
If you can't re-create the problem in pure SQL, then it's probably an Apex problem, and belongs in the Apex forum, not here.
I don't see anything obviously wrong with your code, but I can't tell if, for example, you spelled a column name wrong, or if something has the wrong data type
Is this enough info for some assistance? Any help would really be appreciated.It wiould be better if you posted a completE script that people could run to re-create the problem, and to test their ideas.
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
Always say which version of Oracle (and any other software, such as Apex) you're using. -
Newbie - need help with a SQL query for a bar chart
Hi,
I'm a new user on APEX with no real SQL knowledge and I'm trying to build a dashboard with charts into an existing APEX application. Based on another application, I have come up with the following SQL code:
select null link
, CATEGORY label
, count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
, count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
from GRAPO_PROHEADTRK
where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
group by CATEGORY
Order by COUNT(PROJECT_ID) DESC
The code from the other app was:
select null link
, FUNCTIONAL_AREA label
, count (decode(PROJECT_STATUS,'Active',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'Complete',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'On Hold',PROJECT_ID)) "On Hold"
, count (decode(PROJECT_STATUS,'Recurring',PROJECT_ID))"Recurring"
, count (decode(PROJECT_STATUS,'Pipeline',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'Not Approved',PROJECT_ID))"Not Approved"
from PM_V2
where LOB='S2S' and (FUNCTIONAL_AREA='Accounts Payable' or FUNCTIONAL_AREA='Expense' or FUNCTIONAL_AREA='Procurement' or FUNCTIONAL_AREA='Fixed Assets')
group by FUNCTIONAL_AREA
Order by COUNT(PROJECT_ID) DESC
I'm getting a "Failed to parse SQL query!" error when I try to run validation.
Is this enough info for some assistance? Any help would really be appreciated.
Thanks,
RachelHello,
This is more of an SQL question, rather than specifically APEX-related. It's notable that you say: I'm a new user on APEX with no real SQL knowledgeWhich is fine (we all have to start somewhere, afterall) but it might be worth de-coupling the problem from APEX in the first instance. I'd also strongly recommend either taking a course, reading a book (e.g. http://books.google.co.uk/books?id=r5vbGgz7TFsC&printsec=frontcover&dq=Mastering+Oracle+SQL&hl=en#v=onepage&q=Mastering%20Oracle%20SQL&f=false) or looking for a basic SQL tutorial - it will save you a whole lot of heartache, I promise you. Search the oracle forums for the terms "Basic SQL Tutorial" and you should come up with a bunch of results.
Given that you've copied your query template from another, I would suggest ensuring that the actual query works first of all. Try running it in either:
* SQL Editor
* SQL*Plus
* an IDE like SQL Developer (available free from the OTN: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html ) or TOAD or similar.
You may find there are syntax errors associated with the query - it's difficult to tell without looking at your data model.
select null link
, CATEGORY label
, count (decode(PROJECT_STATUS,'1',PROJECT_ID))"Active"
, count (decode(PROJECT_STATUS,'2',PROJECT_ID))"Complete"
, count (decode(PROJECT_STATUS,'3',PROJECT_ID))"On Hold"
, count (decode(PROJECT_STATUS,'4',PROJECT_ID))"Pipeline"
, count (decode(PROJECT_STATUS,'5',PROJECT_ID))"Pending Review"
from GRAPO_PROHEADTRK
where (PROJECT_STATUS='1' or PROJECT_STATUS='2' or PROJECT_STATUS='3' or PROJECT_STATUS='4' or PROJECT_STATUS='5' or PROJECT_STATUS='6')
group by CATEGORYNote that your "order by" clause references a field called "PROJECT_ID", which exists in the old query but you've changed other similar references to "PROJECT_STATUS" - is it possible you've just missed this one? The perils of copy-paste coding I'm afraid... -
Error while executing a sql query for select
HI All,
ORA-01652: unable to extend temp segment by 128 in tablespace PSTEMP i'm getting this error while i'm executing the sql query for selecting the data.I am having 44GB of temp space, while executing the below query my temp space is getting full, Expert please let us know how the issue can be resolved..
1. I dont want to increase the temp space
2. I need to tune the query, please provide your recomendations.
insert /*+APPEND*/ into CST_DSA.HIERARCHY_MISMATCHES
(REPORT_NUM,REPORT_TYPE,REPORT_DESC,GAP,CARRIED_ITEMS,CARRIED_ITEM_TYPE,NO_OF_ROUTE_OF_CARRIED_ITEM,CARRIED_ITEM_ROUTE_NO,CARRIER_ITEMS,CARRIER_ITEM_TYPE,CARRIED_ITEM_PROTECTION_TYPE,SOURCE_SYSTEM)
select
REPORTNUMBER,REPORTTYPE,REPORTDESCRIPTION ,NULL,
carried_items,carried_item_type,no_of_route_of_carried_item,carried_item_route_no,carrier_items,
carrier_item_type,carried_item_protection_type,'PACS'
from
(select distinct
c.REPORTNUMBER,c.REPORTTYPE,c.REPORTDESCRIPTION ,NULL,
a.carried_items,a.carried_item_type,a.no_of_route_of_carried_item,a.carried_item_route_no,a.carrier_items,
a.carrier_item_type,a.carried_item_protection_type,'PACS'
from CST_ASIR.HIERARCHY_asir a,CST_DSA.M_PB_CIRCUIT_ROUTING b ,CST_DSA.REPORT_METADATA c
where a.carrier_item_type in('Connection') and a.carried_item_type in('Service')
AND a.carrier_items=b.mux
and c.REPORTNUMBER=(case
when a.carrier_item_type in ('ServicePackage','Service','Connection') then 10
else 20
end)
and a.carrier_items not in (select carried_items from CST_ASIR.HIERARCHY_asir where carried_item_type in('Connection') ))A
where not exists
(select *
from CST_DSA.HIERARCHY_MISMATCHES B where
A.REPORTNUMBER=B.REPORT_NUM and
A.REPORTTYPE=B.REPORT_TYPE and
A.REPORTDESCRIPTION=B.REPORT_DESC and
A.CARRIED_ITEMS=B.CARRIED_ITEMS and
A.CARRIED_ITEM_TYPE=B.CARRIED_ITEM_TYPE and
A.NO_OF_ROUTE_OF_CARRIED_ITEM=B.NO_OF_ROUTE_OF_CARRIED_ITEM and
A.CARRIED_ITEM_ROUTE_NO=B.CARRIED_ITEM_ROUTE_NO and
A.CARRIER_ITEMS=B.CARRIER_ITEMS and
A.CARRIER_ITEM_TYPE=B.CARRIER_ITEM_TYPE and
A.CARRIED_ITEM_PROTECTION_TYPE=B.CARRIED_ITEM_PROTECTION_TYPE
AND B.SOURCE_SYSTEM='PACS'
Explain Plan
==========
Plan
INSERT STATEMENT ALL_ROWSCost: 129 Bytes: 1,103 Cardinality: 1
20 LOAD AS SELECT CST_DSA.HIERARCHY_MISMATCHES
19 PX COORDINATOR
18 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10002 :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1
17 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,103 Cardinality: 1
15 HASH JOIN RIGHT ANTI NA PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 129 Bytes: 1,098 Cardinality: 1
4 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 63 Bytes: 359,283 Cardinality: 15,621
3 PX SEND BROADCAST PARALLEL_TO_PARALLEL SYS.:TQ10001 :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621
2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621
1 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1001Cost: 63 Bytes: 359,283 Cardinality: 15,621
14 NESTED LOOPS ANTI PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 40,256,600 Cardinality: 37,448
11 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 65 Bytes: 6,366,160 Cardinality: 37,448
8 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1002
7 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1002Cost: 1 Bytes: 214 Cardinality: 2
6 PX SEND BROADCAST PARALLEL_FROM_SERIAL SYS.:TQ10000 Cost: 1 Bytes: 214 Cardinality: 2
5 INDEX FULL SCAN INDEX CST_DSA.IDX$$_06EF0005 Cost: 1 Bytes: 214 Cardinality: 2
10 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448
9 MAT_VIEW ACCESS FULL MAT_VIEW PARALLEL_COMBINED_WITH_PARENT CST_ASIR.HIERARCHY :Q1002Cost: 63 Bytes: 2,359,224 Cardinality: 37,448
13 TABLE ACCESS BY INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT CST_DSA.HIERARCHY_MISMATCHES :Q1002Cost: 0 Bytes: 905 Cardinality: 1
12 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT SYS.HIERARCHY_MISMATCHES_IDX3 :Q1002Cost: 0 Cardinality: 1
16 INDEX RANGE SCAN INDEX PARALLEL_COMBINED_WITH_PARENT CST_DSA.IDX$$_06EF0001 :Q1002Cost: 1 Bytes: 5 Cardinality: 1 -
hi Experts,
while running SQL Query i am getting an error as
The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or LIKE operator. for the query
select T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
T2.LineText
from OQUT T0 INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
QUT10 T2 ON T1.DocEntry = T2.DocEntry where T1.DocEntry='590'
group by T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
,T2.LineText
how to resolve the issueDear Meghanath,
Please use the following query, Hope your purpose will serve.
select T1. Dscription,T1.docEntry,T1.Quantity,T1.Price ,
CAST(T2.LineText as nvarchar (MAX))[LineText]
from OQUT T0 INNER JOIN QUT1 T1 ON T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
QUT10 T2 ON T1.DocEntry = T2.DocEntry --where T1.DocEntry='590'
group by T1. Dscription,T1.docEntry,T1.Quantity,T1.Price
,CAST(T2.LineText as nvarchar (MAX))
Regards,
Amit -
I'm attempting to dynamically generate a rather large SQL query via the "PL/SQL function body returning SQL query" report region option. The SQL query generated will possibly be over 32K. When I execute my page, I sometimes receive the "ORA-06502: PL/SQL: numeric or value error" which points to a larger than 32K query that was generated. I've seen other posts in the forum related to this dynamic SQL size limitation issue, but they are older (pre-2010) and point to the 32K limit of the DNS (EXECUTE IMMEDIATE) and DBMS_SQL. I found this post (dynamic sql enhancements in 11g) which discusses 11g no longer having the 32K size limitation for generating dynamic SQL. Our environment is on 11gR2 and using ApEx 4.2.1. I do not know which dynamic SQL method -- DNS or DBMS_SQL -- ApEx 4.2.1 is using. Can someone clarify for me which dynamic SQL method ApEx uses to implement the "PL/SQL function body returning SQL query" option?
As a test, I created a page on apex.oracle.com with a report region with the following source:
declare
l_stub varchar2(25) := 'select * from sys.dual ';
l_sql clob := l_stub || 'union all ';
br number(3) := 33;
begin
while length ( l_sql ) < 34000 loop
l_sql := l_sql || l_stub || 'union all ';
end loop;
l_sql := l_sql || l_stub;
for i in 1 .. ceil ( length ( l_sql ) / br ) loop
dbms_output.put_line ( dbms_lob.substr ( l_sql, br, ( ( i - 1 ) * br ) + 1 ) );
end loop;
return l_sql;
end;
The dbms_output section is there to be able to run this code in SQL*Plus and confirm the size of the SQL is indeed larger than 32K. When running this in SQL*Plus, the procedure is successful and produces a proper SQL statement which can be executed. When I put this into the report region on apex.oracle.com, I get the ORA-06502 error.
I can certainly implement a work-around for my issue by creating a 'Before Header' process on the page which populates an ApEx collection with the data I am returning and then the report can simply select from the collection, but according to documentation, the above 32K limitation should be resolved in 11g. Thoughts?
Shane.What setting do you use in your report properties - especially in Type and in Region Source?
If you have Type="SQL Query", then you should have a SELECT statement in the Region Source. Something like: SELECT .... FROM ... WHERE
According to the ERR-1101 error message, you have probably set Type to "SQL Query (PL/SQL function body returning SQL query)". In this situation APEX expects you to write a body of a PL/SQL function, that will generate the text of a SQL query that APEX should run. So it can be something like:
declare
mycond varchar2(4000);
begin
if :P1_REPORT_SEARCH is not null THEN
mycond:='WHERE LAST_NAME like :P1_REPORT_SEARCH ||''%''';
end if;
return 'select EMPLOYEE_ID, FIRST_NAME, LAST_NAME from EMPLOYEES ' ||mycond;
end;
And for escaping - are you interested in escaping the LIKE wildcards, or the quotes?
For escaping the wildcards in LIKE function so that when the user enters % you will find a record with % and not all functions, look into the SQL Reference:
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/conditions007.htm
(You would than need to change the code of your function accordingly).
If you are interested in escaping the quotes, try to avoid concatenating the values entered by the user into the SQL. If you can, use bind variables instead - as I have in my example above. If you start concatenating the values into the text of SQL, you are open to SQLInjection - user can enter anything, even things that will break your SQL. If you really need to allow users to choose the operator, I would probably give them a separate combo for operators and a textfield for values, than you could check if the operator is one of the allowed ones and create the condition accordingly - and than still use bind variable for inserting the filtering value into the query. -
Error in report when executing pl/sql function body returning sql query.
Hi,
I have used the pl/sql function body returning sql query for creating a report. I have created a datepicker(
P10_TASK_DATE) which can be submitted.The code is as below
DECLARE
v_sql varchar2(3000);
BEGIN
if :P10_TASK_DATE is not null THEN
v_sql:='select
* from tasks';
return v_sql;
else
v_sql:='select * from discovery';
return v_sql;
END IF;
END;if the date field is empty "select * from discovery" is executed and report is getting generated. But when we give a
date using date picker the page is submitted and i get "report error: ORA-01403: no data found" even
though the "tasks" table has data in it. Plz help
Thanks,
TJhi
Please try this
1. Create 2 region
1st region source=
select * from tasks'
go to the tab -> condition =
item NOT NULL
EXpression1 =:P10_TASK_DATE
this will run whenever the item have any date
2. open your 2 nd region source code= select * from discovery
put the condition
item is NULL
EXpression1 =:P10_TASK_DATE
thanks
Mark Wyatt -
Getting zero-sized reply error when running report from SQL query
Hi,
I have a Report from SQL Query in Portal. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: <data suppressed>
The following error was encountered:
Zero Sized Reply
Squid did not receive any data for this request.
Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
Thanks,
LorenaProblem comes when any of the filter is applied in any one of the cases selected from the GUI.Do you mean that the problems only shows when you run the report in your browser via 9iAS?
Which version are you using?
Can you post the before report trigger? -
Getting Zero Sized Reply error in report from SQL query
Hi,
I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: <data suppressed>
The following error was encountered:
Zero Sized Reply
Squid did not receive any data for this request.
Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
Thanks,
LorenaHi,
I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: <data suppressed>
The following error was encountered:
Zero Sized Reply
Squid did not receive any data for this request.
Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
Thanks,
Lorena
Maybe you are looking for
-
Initial load of G/L account master data
Does anyone have any familiarity with any built-in tools SAP provides for bulk loading of master data? I have always been aware of LSMW but if there is any documentation out there around LSMW or other tools SAP may provide it would be much appreciat
-
Adapter engine queue monitoring
Hi All, I have one doubt about adapter engine queue. We can see adapter engine queue in RWB->Message Monitoring-> Adapter engine-> Display . Here in queue if one message goes in to system error status, remaining all messages from that queue goes on
-
Problems obtaining .rxe with labview 8.5 professional
Hello everyone! I am starting with labview for nxt, and I have some problems during the compilation. I have installed all what it is said in instructions for labview 8.5 professional, then I have done the "mass compiled" but I have obtanied lots of
-
What are credentials/tokens needed to connect to FMS
I'm trying to connect to FMS with Wirecast and keep getting this error Cannot publish the stream. Verify the stream name and if you have provided any credentials/tokens that they are up to date. [-4020]that they are up to date. and of course, can not
-
Can't read AExp Configuration- is it dead?
Hi- had a network with an AEBS connected to the internet and an AExp as a client connected to my stereo for streaming music. All was working perfectly. I moved apartment- renamed network. At the same time I got a new Powerbook so moved from Panther t