Select over partition compilation error
Forms [32 Bit] Version 10.1.2.0.2 (Production)!!
Is it possible that select over partition is all right in a Record group while it is giving error in to trigger?
Thanks in advance
Triggers are compiled in forms so need to use only the features available to forms, which doesn't include all the new stuff in the database.
Record groups are not compiled, they are parsed on the database so can include all database functionality. If you create a record group you can see immediately the source in v$sql, with bind variables replaced with :1, :2 etc.
Similar Messages
-
Count Distinct Over Partition Syntax Error
Count(Distinct [field]) over (partition by [field2]) returns a syntax error at the key word distinct
Count(all [field]) over (partition by [field2]) compiles fine
I am writing a query to count the number of clients a sales rep has when the sales rep represents multiple companies (ad agency). I need a count of the clients each company has and a distinct count that each rep has. A client may be assigned to multiple companies.
Is a distinct count supported with partitions?Until we wait for the full implementation of the OVER clause, you can
try something like this:
CREATE TABLE Foo (
fookey INT PRIMARY KEY,
company VARCHAR(30),
sales_rep VARCHAR(30),
client VARCHAR(30));
INSERT INTO Foo VALUES(1, 'ABC Corp.', 'Joe', 'Client1');
INSERT INTO Foo VALUES(2, 'ABC Corp.', 'Joe', 'Client2');
INSERT INTO Foo VALUES(3, 'ABC Corp.', 'Peter', 'Client2');
INSERT INTO Foo VALUES(4, 'DEF Corp.', 'Joe', 'Client1');
INSERT INTO Foo VALUES(5, 'DEF Corp.', 'Joe', 'Client3');
SELECT fookey, company, sales_rep, client,
MAX(rk1) OVER(PARTITION BY sales_rep) AS rep_distinct_client_cnt,
MAX(rk2) OVER(PARTITION BY company) AS company_distinct_client_cnt
FROM (
SELECT fookey, company, sales_rep, client,
DENSE_RANK() OVER(PARTITION BY sales_rep ORDER BY client) As rk1,
DENSE_RANK() OVER(PARTITION BY company ORDER BY client) As rk2
FROM Foo) AS F;
fookey company sales_rep client rep_distinct_client_cnt
company_distinct_client_cnt
1 ABC Corp. Joe Client1 3 2
2 ABC Corp. Joe Client2 3 2
3 ABC Corp. Peter Client2 1 2
4 DEF Corp. Joe Client1 3 2
5 DEF Corp. Joe Client3 3 2
Plamen Ratchev
http://www.SQLStudio.com -
Newbie: jsp compile error w/ tomcat 5.0.19
Hello there, this is my first time try to write something in jsp/ servlets, and i encounter a minor installation problem:
using mdk linux with j2sdk1.4.2 (locate at /usr/local/), tomcat is also locate at /usr/local.
I am able to see HelloServlet.java, and HelloWorld.html at http://localhost:8080/servlet/HelloServlet
and http://localhost:8080/testing/HelloWorld.html
but i'm unable to see HelloWorld.jsp at http://localhost:880/HellowWorld.jsp (my HelloWorld.html and HellowWorld.jsp are locate at the same dir)
here's are the things i added in my /etc/profile so far:
CATALINA_HOME="/usr/local/Tomcat"
export CATALINA_HOME
JAVA_HOME="/usr/local/j2sdk1.4.2"
export JAVA_HOME
JavaPath="/usr/local/j2sdk1.4.2/bin"
export JavaPath
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
CLASSPATH=$CLASSPATH:/usr/local/Tomcat/common/lib/servlet-api.jar:/usr/local/Tomcat/
common/lib/jsp-api.jar:/home/allen/programming/j2ee/:./
export CLASSPATH
when do java -verison, i see:
[root@localhost local]# java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
when start tomcat, i got:
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/Tomcat
Using CATALINA_HOME: /usr/local/Tomcat
Using CATALINA_TMPDIR: /usr/local/Tomcat/temp
Using JAVA_HOME: /usr/local/j2sdk1.4.2
i thought i did everything that was told, yet i can't see jsp page on my browser, while i can see servlets and html,
thank you for your time in advance ^_^sorry, it was a typo, yea...it was for http://localhost:8080/testing/Hello.jsp
this morning, i copied "tool.jar" from j2sdk1.4.2 to my /usr/local/tomcat/common/lib, restarted, fire it up again using "./catalina.sh" just to see where the problems came from, and here's where the compile error occue:
Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:978)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:799)
at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:387)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:688)
at java.lang.Thread.run(Thread.java:534)
Mar 16, 2005 7:28:37 AM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Env: Compile: javaFileName=/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_//org/apache/jsp/testing/Hello_jsp.java
classpath=/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/classes/:/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/lib/catalina-root.jar:/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_:/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/classes/:/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/lib/catalina-root.jar:/usr/local/jakarta-tomcat-5.0.19/shared/classes/:/usr/local/jakarta-tomcat-5.0.19/common/classes/:/usr/local/jakarta-tomcat-5.0.19/common/endorsed/xercesImpl.jar:/usr/local/jakarta-tomcat-5.0.19/common/endorsed/xmlParserAPIs.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/ant.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-collections.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-dbcp-1.1.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-el.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-pool-1.1.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/jasper-compiler.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/jasper-runtime.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/jmx.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/jsp-api.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-common.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-factory.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-java.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-resources.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/servlet-api.jar:/usr/local/jakarta-tomcat-5.0.19/common/lib/tools.jar:/usr/local/j2sdk1.4.2/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.19/bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.19/bin/commons-logging-api.jar:/usr/local/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar:/usr/local/j2sdk1.4.2/jre/lib/ext/dnsns.jar:/usr/local/j2sdk1.4.2/jre/lib/ext/ldapsec.jar:/usr/local/j2sdk1.4.2/jre/lib/ext/localedata.jar
cp=/usr/local/j2sdk1.4.2/lib/tools.jar:/usr/local/Tomcat/bin/bootstrap.jar:/usr/local/Tomcat/bin/commons-logging-api.jar
cp=/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/classes
cp=/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/lib/catalina-root.jar
cp=/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_
cp=/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/classes
cp=/usr/local/jakarta-tomcat-5.0.19/webapps/ROOT/WEB-INF/lib/catalina-root.jar
cp=/usr/local/jakarta-tomcat-5.0.19/shared/classes
cp=/usr/local/jakarta-tomcat-5.0.19/common/classes
cp=/usr/local/jakarta-tomcat-5.0.19/common/endorsed/xercesImpl.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/endorsed/xmlParserAPIs.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/ant.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-collections.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-dbcp-1.1.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-el.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/commons-pool-1.1.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/jasper-compiler.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/jasper-runtime.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/jmx.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/jsp-api.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-common.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-factory.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-java.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/naming-resources.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/servlet-api.jar
cp=/usr/local/jakarta-tomcat-5.0.19/common/lib/tools.jar
cp=/usr/local/j2sdk1.4.2/lib/tools.jar
cp=/usr/local/jakarta-tomcat-5.0.19/bin/bootstrap.jar
cp=/usr/local/jakarta-tomcat-5.0.19/bin/commons-logging-api.jar
cp=/usr/local/j2sdk1.4.2/jre/lib/ext/sunjce_provider.jar
cp=/usr/local/j2sdk1.4.2/jre/lib/ext/dnsns.jar
cp=/usr/local/j2sdk1.4.2/jre/lib/ext/ldapsec.jar
cp=/usr/local/j2sdk1.4.2/jre/lib/ext/localedata.jar
work dir=/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_
extension dir=/usr/local/j2sdk1.4.2/jre/lib/ext
srcDir=/usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_
include=org/apache/jsp/testing/Hello_jsp.java
Mar 16, 2005 7:28:37 AM org.apache.jasper.compiler.Compiler generateClass
SEVERE: Error compiling file: /usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_//org/apache/jsp/testing/Hello_jsp.java [javac] Compiling 1 source file
[javac] /usr/local/jakarta-tomcat-5.0.19/work/Catalina/localhost/_/org/apache/jsp/testing/Hello_jsp.java:48: cannot resolve symbol
[javac] symbol : class Data
[javac] location: package util
[javac] out.print( new java.util.Data() );
[javac] ^
[javac] 1 error
Mar 16, 2005 7:32:34 AM org.apache.jasper.compiler.Compiler generateClass
looking over the compiler error, it seems to me tomcat is able to recongize /usr/local/j2sdk1.4 's location. which i assume it implied JAVA_HOME and CLASSPATH are setup correctly.
Dunno why it just won't display jsp pages and kept saying compiler error...
thank you for helping -
Hello experts,
I'm totally new to C#. I'm trying to modify existing code to automatically rename a file if exists. I found a solution online as follows:
string[] allFiles = Directory.GetFiles(folderPath).Select(filename => Path.GetFileNameWithoutExtension(filename)).ToArray();
string tempFileName = fileName;
int count = 1;
while (allFiles.Contains(tempFileName ))
tempFileName = String.Format("{0} ({1})", fileName, count++);
output = Path.Combine(folderPath, tempFileName );
string fullPath=output + ".xml";
However, it gives the following compilation errors
for the Select and Contain methods respectively.:
'System.Array' does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type 'System.Array' could be found
(are you missing a using directive or an assembly reference?)
'System.Array' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'System.Array' could be
found (are you missing a using directive or an assembly reference?)
I googled on these errors, and people suggested to add using System.Linq;
I did, but the errors persist.
Any help and information is greatly appreciated.
P. S. Here are the using clauses I have:
using System;
using System.Data;
using System.Windows.Forms;
using System.IO;
using System.Collections.Generic;
using System.Text;
using System.Linq;Besides your issue with System.Core, you also have a problem with the logic of our code, particularly your variables. It is confusing what your variables represent. You have an infinite loop, so the last section of code is never reached. Take a look
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace consAppFileManipulation
class Program
static void Main(string[] args)
string fullPath = @"c:\temp\trace.log";
string folderPath = @"c:\temp\";
string fileName = "trace.log";
string output = "";
string fileNameOnly = Path.GetFileNameWithoutExtension(fullPath);
string extension = Path.GetExtension(fullPath);
string path = Path.GetDirectoryName(fullPath);
string newFullPath = fullPath;
string[] allFiles = Directory.GetFiles(folderPath).Select(filename => Path.GetFileNameWithoutExtension(filename)).ToArray();
string tempFileName = fileName;
int count = 1;
//THIS IS AN INFINITE LOOP
while (allFiles.Contains(fileNameOnly))
tempFileName = String.Format("{0} ({1})", fileName, count++);
//THIS CODE IS NEVER REACHED
output = Path.Combine(folderPath, tempFileName);
fullPath = output + ".xml";
//string fullPath = output + ".xml";
UML, then code -
Why does plsql give compilation error for select statement?
When I run following plsql program, it gives compilation error. Could somebody please point me out what could be wrong here? I am running it from system user.
create or replace procedure drop_user_proc (iname in varchar2) is
uname varchar2(100);
begin
select username into uname from dba_users where username = upper(iname);
end drop_user_proc;
select username from dba_users where username = upper('newuser');
When I run it, I get following error. dba_users is there that is the reason it works outside plsql block, but it doesn't from inside block.
SQL> @t4
Warning: Procedure created with compilation errors.
USERNAME
NEWUSER
SQL> show err
Errors for PROCEDURE DROP_USER_PROC:
LINE/COL ERROR
4/3 PL/SQL: SQL Statement ignored
4/35 PL/SQL: ORA-00942: table or view does not existRole based grants are not available within the stored procedures.
Only explicit grants are recognized when compiling stored code.
You need to grant select on that table to the user where you are creating this procedure. -
I try to generate a chm file over the net and I get a compiling error message
Hi all,
I am trying to generate chm files over the net, and the same project when I am generating the same chm locally works fine, however when I am attempting to generate the same chm on a network location, it gives me a compiling error and aborts the generation. It is also keeping the chm file open afterwards, so I have to reboot the machine.
It is RH7 working on a Windows XP Pro 32 bit.
Thank youIt is not a project issue. RoboHelp is just not designed to work that way but like a lot of things, some people can use them outside what they were designed for. However, just because some people can work that way, it does not follow everyone can.
I've seen people with projects on a network and they say have been doing it for years so it must be OK. A while later they come back and say the problem is fixed since moving it locally.
Sorry but it looks like you are stuck with working the way you do or getting your colleague to do it. It might be as simple as he is on a different bit of your network.
See www.grainge.org for RoboHelp and Authoring tips
@petergrainge -
Wierd SQL Select Compile Error
Hello.
When I do my SQL like this:
SQL SELECT cus_surname as "Surname",
cus_forename as
"FirstName",
cus_telephone as
"Telephone",
cus_address as
"Address1",
cus_line1 as
"Address2",
cus_line2 as
"Address3",
cus_town as
"Address4",
cus_city as
"Address5",
cus_postcode as
"Address6"
INTO :lCustomer
FROM msp_customers
WHERE cus_serial = :lRefCustomer.Serial
on session SessionToUse;
I get this compile error:
The read-only virtual attribute
FoundationClasses.FoundationBusinessObject.IsNew can't be passed as an
OUTPUT or an INPUT OUTPUT parameter.
Yet if I remove the "as" from the SQL Select syntax it works, with no
compile errors.
Why? I don't understand why they are different!
Tim Sawyer
PanCredit
Leeds, UK.
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>I added a DBMS_OUTPUT.put_line(l_wrap) in keith codes
and run out put wrapped test codes in sqlplus and can see wrapped test procedure.
create or replace procedure test wrapped
a000000
b2
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
7
11d 124
ohyVALi7ang26ROCF0CZ3wLg6ngwgy7Q2SdqfC/p+D6E39xrRLEK0/eVVEVSORSTWoZXk1gi
JT9nTrV3IXmGVbi5uMlIl+0C/WV9wPlFL5z37QfcEOYUdmLx8iwul2hEvDehUX0jLfiltHqx
MhAgy16zDvWPfv5uE4HrlBvRAYoDmETXR7r10x/uyQyUxDw4sVyq6Ndh4GSFw9zp801nKSN1
P0GOB03CtlcnrqAjQhASJKrP4sXW74oOyr373DBBP/CLndRTT0TZ1HvWVzAgL5C++Dl6PNyQ
But I got compiled errors as
Compilation errors for PROCEDURE SYS.TEST
Error: PLS-00103: Encountered the symbol "ASWALLET_OPEN" when expecting one of the following:
( ; is with authid as cluster compress order using compiled
wrapped external deterministic parallel_enable pipelined
result_cache
The symbol "is" was substituted for "ASWALLET_OPEN" to continue.
Line: 1
Text: create or replace procedure test wrapped
Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national character
nchar
The symbol "<an identifier>" was substituted for "=" to continue.
Line: 1
Text: create or replace procedure test wrapped
Error: PLS-00103: Encountered the symbol "=" when expecting one of the following:
constant exception <an identifier>
<a double-quoted delimited-identifier> table long double ref
char time timestamp interval date binary national character
nchar
Line: 1
Text: create or replace procedure test wrapped
.Bot trigger and procedure works well before wrapped.
I use oracle 11g2 at window 2003.
Thanks
newdba -
Compilation error in PL/SQL
Hi All,
Please find the strange query situation in PLSQL.
If i run the query without PLSQL block (i.e. declar begin end) it runs well and insert data
in table but if put the same query in PLSQL block it gives compilation error.
Following is the spool
SQL> select * from v$version;
BANNER
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
SQL> insert into smcbom_load_hours_temp
2 select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
3 from (
4 select plan_level,sp.data_set_name,
5 sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
6 usagerate ,operationseq,percent,
7 sbov.group_id,sp.alloy,sp.planner_code,
8 sbov.days,sbov.totaloffsetdays,deptclass,dept,
9 decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
10 (SELECT MAX(INWEIGHT)
11 FROM SMCBOM_BOM_OPERATION_VIEW
12 WHERE ALLOY=sbov.alloy
13 AND PLANNER_CODE=sbov.planner_code
14 AND PLAN_LEVEL = 0
15 AND GROUP_ID = sbov.group_id ),
16 0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
17 1) v_hr,
18 smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
19 sum(-sbov.totaloffsetdays)
20 over (partition by sp.alloy,sp.planner_code,sbov.group_id
21 order by plan_level asc,operationseq desc) new_offset
22 from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
23 where sbov.alloy= sp.alloy
24 and sbov.planner_code=sp.planner_code
25 and group_id=521136
26 )
27 group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
23 rows created.
SQL> commit;
Commit complete.
SQL> declare
2 begin
3 insert into smcbom_load_hours_temp
4 select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
5 from (
6 select plan_level,sp.data_set_name,
7 sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
8 usagerate ,operationseq,percent,
9 sbov.group_id,sp.alloy,sp.planner_code,
10 sbov.days,sbov.totaloffsetdays,deptclass,dept,
11 decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
12 (SELECT MAX(INWEIGHT)
13 FROM SMCBOM_BOM_OPERATION_VIEW
14 WHERE ALLOY=sbov.alloy
15 AND PLANNER_CODE=sbov.planner_code
16 AND PLAN_LEVEL = 0
17 AND GROUP_ID = sbov.group_id ),
18 0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
19 1) v_hr,
20 smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
21 sum(-sbov.totaloffsetdays)
22 over (partition by sp.alloy,sp.planner_code,sbov.group_id
23 order by plan_level asc,operationseq desc) new_offset
24 from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
25 where sbov.alloy= sp.alloy
26 and sbov.planner_code=sp.planner_code
27 and group_id=521136
28 )
29 group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
30 end;
31 /
(SELECT MAX(INWEIGHT)
ERROR at line 12:
ORA-06550: line 12, column 2:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + mod not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string>
ORA-06550: line 22, column 6:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
, from
SQL> spool off;In some versions of Oracle (certainly all of the 8.x versions and earlier, and possibly some of the earlier 9 versions) the SQL parsers in the SQL engine and in the PL/SQL engine were different. Some features that worked directly in SQL did not work in PL/SQL. Scalar sub-queries were one of those things.
You have three options. You can try to re-write the insert statement to eliminate the PL/SQL unimplemented feature. You can create a view in the database for the SELECT part of the insert statement then use that view in the insert. finally, and least desirable, you can build the whole statment as a string, and use EXECUTE IMMEDIATE to run it in PL/SQL.
HTH
John -
PLSQL does not support 'Sum Over Partition'
I have something (and many obvious syntactical variations) like the following which works great in SQLPLUS but not in PLSQL:
select
table1.aField,
table2.bField,
sum (table1.type) over (partition by type)
from
table1, table2
where
aField = something;
PLSQL does not seem to like the "(" in from of the partition keyword.
I get the following PL/SQL error when I attempt to compile:
4/26 PLS-00103: Encountered the symbol "(" when expecting one of the following:
, fromWhat Oracle version are you running?
Is it Oracle8i?
Begining with Oracle9i, SQL parsers for SQL and PL/SQL were merged togather. Before 9i, many of the new features introduced in SQL were not recognized by the PL/SQL parser.
The following example works as expected on Oracle9i:
SQL> begin
2 for rec in (select deptno, ename, sum(sal) over (partition by deptno)total from scott.emp)
3 loop
4 dbms_output.put_line(rec.ename||' - '||rec.total) ;
5 end loop ;
6 end ;
7 /
CLARK - 8750
KING - 8750
MILLER - 8750
SMITH - 10875
ADAMS - 10875
FORD - 10875
SCOTT - 10875
JONES - 10875
ALLEN - 9400
BLAKE - 9400
MARTIN - 9400
JAMES - 9400
TURNER - 9400
WARD - 9400
PL/SQL procedure successfully completed.
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production
SQL> -
SUM OVER PARTITION BY condition?
I have a piece of SQL similar to:
SELECT person,
amount,
type,
SUM(amount) OVER (PARTITION BY person) sum_amount_person
FROM table_a
What I would like to be able to do is use a conditional PARTITION BY clause, so rather than partition and summing for each person I would like to be able to sum for each person where type = 'ABC'
I would expect the syntax to be something like
SELECT person,
amount,
type,
SUM(amount) OVER (PARTITION BY person WHERE type = 'ABC') sum_amount_person
FROM table_a
Is this possible? Or am I missing a much simpler solution?
RichardThe proposed query does not compile on my Windows Oracle 9.2.0.5 or 10.1. This could be generated by the ambiguty introduced by DECODE in the evaluation of query (does it filter the selected rows, or the rows summarized for each selected row, or both?).
I propose two alternatives. The requirements are not specific enough to allow me to choose between them.
SQL> SELECT * FROM table_a ORDER BY 1, 3;
PERSON AMOUNT TYP
john 12 abc
john 8 abc
john 20 def
mike 15 abc
mike 30 ghi
steve 30 abc
6 rows selected.
SQL> SELECT person,
2 amount,
3 type,
4 SUM(decode(type, 'ABC',amount, to_number(NULL)) OVER (PARTITION BY person) sum_amount_person
5 FROM table_a;
SUM(decode(type, 'ABC',amount, to_number(NULL)) OVER (PARTITION BY person) sum_amount_person
ERROR at line 4:
ORA-30483: window functions are not allowed here
SQL> SELECT person,
2 amount,
3 type,
4 CASE type WHEN 'abc' THEN SUM(amount) OVER (PARTITION BY person) END sum_amount_person
5 FROM table_a;
PERSON AMOUNT TYP SUM_AMOUNT_PERSON
john 12 abc 40
john 20 def
john 8 abc 40
mike 15 abc 45
mike 30 ghi
steve 30 abc 30
6 rows selected.
SQL> SELECT person,
2 amount,
3 type,
4 CASE type WHEN 'abc' THEN SUM(amount) OVER (PARTITION BY person, type) END sum_amount_person
5 FROM table_a;
PERSON AMOUNT TYP SUM_AMOUNT_PERSON
john 12 abc 20
john 8 abc 20
john 20 def
mike 15 abc 15
mike 30 ghi
steve 30 abc 30
6 rows selected. -
Hi, I am learning Java using a few courses from text books. Everything has been going well so far. I do most of my devleopment on Linux but recently installed the JDK on my Windows partition. The course I am using from the book comes with a library that you are to use in all the programming exercises. Anyway, this is the code from the program that I am getting a compile error on.
import ccj.*;
public class Fastype
{ public static void main(String[] args);
{ String totype = ("The quick brown fox jumps over the lazy dog.");
double wpm;
double sec;
System.out.print("This program tests your typing skills. When you are ready to start press 'y'(and enter) and a sentence will appear. Type it as fast as you can without error(don't forget to press the enter key when done.) Ready?");
String z = Console.in.readChar(); // just a statement that waits until the user is ready
Time start = new Time();
System.out.println(totype);
String user = Console.in.readWord();
Time end = new Time();
sec = (end.getSeconds()-start.getSeconds());
wpm = 9 * 60 / sec;
System.out.print("Time: " + sec + "\nYou can type " + wpm + " words per minute.");
if (user.equals(totype)) System.out.print("Good.");
else
if( user.compareTo(totype) != 0)
System.out.println(" But speed is irrelevant when you type with errors.");
}When I compile I get:
Fastype.java:6: missing method body, or declare abstract
{ public static void main(String[] args);
^All the programs I've written so far use :
{ public static void main(String[] args)So I can't really tell whats going on here. I'm sure this is probably really stupid but I'm new to this.
Thanks.
IRCAll the programs I've written so far use :
{ public static void main(String[] args)
semicolon son,semicolon in the main method..
tips: when the compiler gives an error ,try to take a closer look and check for the syntax of the corresponding line..
don't worry happens to newbies... -
Group by using partition getting error
select
code,
code_value_text
ext_contact_organization,
regulatory_group_name,
sum(spd.case_id) over (partition by code,code_value_text,regulatory_group_name)
from AERSP.code_list_dtls cdl,
AERSP.ec_contact_log cntct,
AERSP.de_suspect_drugs spd
where cntct.ext_contact_organization=cdl.code
and code_list_name= 'SP_ORGANIZATION'
and spd.case_id=cntct.case_id
I used above SQL to group based on the columns I wanted but when I run that SQL getting error INVALID NUMBER,
Why Im getting error, Please help.
Thanks in advance
Murthyselect
code,
code_value_text
ext_contact_organization,
regulatory_group_name,
sum(spd.case_id) over (partition by
code,code_value_text,regulatory_group_name)
rom AERSP.code_list_dtls cdl,
AERSP.ec_contact_log cntct,
AERSP.de_suspect_drugs spd
where cntct.ext_contact_organization=cdl.code
code_list_name= 'SP_ORGANIZATION'
and spd.case_id=cntct.case_id
I used above SQL to group based on the columns I
wanted but when I run that SQL getting error INVALID
NUMBER,
Why Im getting error, Please help.
Thanks in advance
MurthyIt's difficult to say 100%, because we know nothing about your data.
But i can suppose, that problem is in sum(spd.case_id).
Probably you have any not-numeric data in the column case_id
Regards
Dmytro -
Keep getting compile error. dunno why.
i keep getting compile error that Compilation errors for PACKAGE BODY NRMS_INTERFACE.PKGNDW
Error: PLS-00113: END identifier 'BOOLISDATAAVAILABLE' must match 'PKGND' at line 1, column 29
Line: 3309
Text: end boolIsDataAvailable;
function boolIsDataAvailable(o_errorcode OUT NUMBER,
o_errortext OUT VARCHAR2) return boolean is
DataAccess number;
boolResult boolean;
begin
begin
select DATA_ACCESS
into DataAccess
from INTERFACEPARAMETER
where NUMBER_VALUE = 0;
boolResult := true;
exception
WHEN OTHERS THEN
-- coder assumes that any exceptions here will lead to data not being available.
boolResult := false;
end;
return boolResult;
end;
end boolIsNDWAvailable;Argh....again the importance of formatting and indentation is proved...
In other words: the tag
before and after samples.
Thanks for the followups ;)
+it's past 21.00/09.00PM over here, so already a while no more coffee for me+
+Yes, that's a disclaimer+ ;) -
FPGA Compile error and cannot find the compilatio​n server
Hi,
My name is Bonghun. I recently installed the Labview 2011; previously, I installed 2010 and Labview worked very well.
I am using a Compact Rio (cRIO 9022 and chassis 9114).
I installed Labview 2011, Real time and FPGA modules including crio 4.0, Xilinx 10.1 and 12.4.
When I compile a FPGA.vi, it doesn't compile FPGA.vi.
Labview requests the message which ask to select compile server. After selecting the local compile server, Labview
requests at each step again and again.
Error number is Error - 123002. occured at niFpgaCompileFarm_OpenJob.vi
I tried to remove all programs and re-install several times but still I could not find the solution.
Please help me and let me know what is problem in my system.
Thank you.
Attachments:
Trouble in compile.ppt 179 KBI am having this issue with LabVIEW 2012 running in Windows XP on a PXI-1042Q to run an FPGA on cRIO-9075.
I had no problem running through the process on my office PC with the same Software/Modules/Drivers installed. Compiler ran without problems.
I ported my project over to the PXI Chassis and cannot compile because CompileWorker closes right after intermediate files finish generating. I am using Local Server and all the necessary modules including Xilinx are installed (I uninstalled EVERYTHING and did a complete reinstall also and still get the same result).
When the Compilation Status Window comes up, it says Attempting to connect to compile server and CompileWorker immediately says it has Encountered a Problem and needs to close. The Compilation status Window gives me a message saying:
"LabVIEW FPGA: The compilation cannot be performed by the compile worker. The compile worker may be configured incorrectly for this compilation, or it may be in an error state."
I also tried making a new project with a simple FPGA VI and tried compiling and got the same results.
Any thoughts? -
Compile Error: "schema 'name' does not exist
Im trying to build a program that quereys a table in a database but i keep getting this error. Am i missing a link between the files or am i missing a line of code in my program??
Apologies. I receive a compiler error which reads as follows;
java.lang.ClassNotFoundException: org.apache.derby.jdbc.EmbeddedDriver
java.sql.SQLSyntaxErrorException: Schema 'DEMO' does not exist
Heres the main body of code i am trying to execute.
public class Main {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
try{
Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
}catch(ClassNotFoundException e){
System.out.println(e);
try{
Connection con = DriverManager.getConnection("jdbc:derby://localhost:1527/SimpleDBDemo", "demo", "demo");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM DEMO.Table1");
while (rs.next()) {
String s = rs.getString("Name");
float n = rs.getFloat("Age");
System.out.println(s + " " + n);
}catch(SQLException e){
System.err.println(e);
I am using NetBeans IDE and have created a database under: Services->Databases-> Java DB->SimpleDBDemo.
I have a database connection in which theres a simple table (called "TABLE1") created which contains the names and ages of two people.
Hope this makes the problem a bit clearer.
Any help would be greatly appreciated.
Maybe you are looking for
-
Windows 8.1 problem saving word 365 document by using Netdrive in NAS Synology
Hi Everyone, I have Problem with Windows 8.1 to open or save word 365 document by using Netdrive in NAS Synology. Please I Need your help asap.
-
How can I set an expiration date on a pdf in adobe acrobat 9?
I am trying to set an expiration date for some documents, I have tried to use several javascript methods with no success. My adobe skills are very minimal so the easiest way possible would be appreciated.
-
Just got 8520 and very confused, could i have some help please.
Hey Right just got this phone and im confused. Firstly how do i update? i tried using the thing on the site and it said there was no updates yet im on 4.6? And also how do i download app world as when i tried it said something about not being able to
-
Hello dear sirs, I tried to download SRDemo application using JDeveloper 10.1.3 update utility but every time download ends the zip file is incomplete. Unfourtunately I couldn't find any really working URL where I could download it manually. Could an
-
hi i have a problem after upgrading to windows 8 the following hardware PCI\VEN_1180&DEV_0843&SUBSYS_330517C0&REV_01 PCI\VEN_1180&DEV_0843&SUBSYS_330517C0 PCI\VEN_1180&DEV_0843&CC_088000 PCI\VEN_1180&DEV_0843&CC_0880 and PCI\VEN_1180&DEV_0592&SUBSYS_