Revoke scott's execution on SUBSTR.
Dear,
As the subject indicates, I want to revoke user's execution permission on built-in function. I tried a lot but failed.
Another question, does jdbc provides a way to pre compile a sql statement so that i will not run the sql unless compilation is passed.
for example: we have a query sql invoking a function, but user does not have the permission on this function. There is a workaround that is putting this query into a outer select statement and set the condition as false for the outer query.
SELECT * FROM *'YOU SQL'* where 1=2. But this is to run the sql and I do not know it is a good way(low performance, does the embed sql get executed?).
Looks like odbc can compile sql against database.
Thanks,
Ricky
>
As the subject indicates, I want to revoke user's execution permission on built-in function. I tried a lot but failed.
>
That isn't possible. Grants and revokes work on schema objects and a built-in function is not a schema object.
>
Another question, does jdbc provides a way to pre compile a sql statement so that i will not run the sql unless compilation is passed.
for example: we have a query sql invoking a function, but user does not have the permission on this function. There is a workaround that is putting this query into a outer select statement and set the condition as false for the outer query.
SELECT * FROM 'YOU SQL' where 1=2. But this is to run the sql and I do not know it is a good way(low performance, does the embed sql get executed?).
>
You can answer that question yourself by running a simple test.
Here is what the Java Developer's guide says
http://docs.oracle.com/cd/B28359_01/appdev.111/b28765/addfunc.htm
>
If you use OraclePreparedStatement functionality, the SQL statement you want to run is precompiled and stored in a PreparedStatement object, and you can run it as many times as required without compiling it every time it is run. If the data in the statement changes, you can use bind variables as placeholders for the data and then provide literal values at run time.
Similar Messages
-
Order of values passed to ODCIAggregateIterate
I have implemented my own aggregate function that concatenates varchar2 values together. It works perfectly, however, the order of the aggregated data is inconsistent and does not match the order that it occurs in the table the aggregation is over ( I have sorted the data). As an example:
original data:
column_a column_b
a 1-abc
a 2-abc
a 3-abc
b 1-abc
b 2-abc
b 3-abcafter aggregation query
column_a column_b_concat
a 1-abc,3-abc,2-abc
b 1-abc,2-abc,3-abcMost of the concatenated data is correct (2nd row) but some of it is not (1st row). My question is....Is there a way to force the order of the aggregated rows to be maintained? I understand for aggregations such as count, sum or avg order is unimportant and so the db optimizes it to run as fast as possible. I can do this using PL/SQL but the execution time is much longer and would rather avoid it if possible.
Thanks.
Edited by: user8092994 on Feb 23, 2009 5:11 PMHi,
Let's phrase the question in terms of the scott.emp table and the wm_concat function, which a lot of people using Oracle 10 (and up) have available.
Right now you're doing something like:
SELECT deptno
, WM_CONCAT (ename) AS ename_concat
FROM scott.emp
GROUP BY deptno;and getting results like
. DEPTNO ENAME_CONCAT
10 CLARK,KING,MILLER
20 SMITH,FORD,ADAMS,SCOTT,JONES
30 ALLEN,BLAKE,MARTIN,TURNER,JAMES,WARDexcept that the names aren't in order (which is exactly the problem: you need to be sure they are in order, as shown above).
I can think of three ways to do that:
(1) modify the function (as you have already considered)
(2) use CONNECT_BY_PATH instead of the function
(3) use the analytic form of the function
My guess is that the options above are listed in order of execution speed ((1) is fastest), but that's just my hunch.
Option (2) works like this:
WITH got_r_num AS
SELECT deptno
, ename
, ROW_NUMBER () OVER
( PARTITION BY deptno
ORDER BY ename
) AS r_num
FROM scott.emp
SELECT deptno
, SUBSTR ( SYS_CONNECT_BY_PATH (ename, ',')
, 2
) AS ename_concat
FROM got_r_num
WHERE CONNECT_BY_ISLEAF = 1
START WITH r_num = 1
CONNECT BY r_num = PRIOR r_num + 1
AND deptno = PRIOR deptno;Option (3) works like this:
WITH got_concat AS
SELECT deptno
, WM_CONCAT (ename) OVER
( PARTITION BY deptno
ORDER BY ename
) AS e_concat
FROM scott.emp
SELECT deptno
, MAX (e_concat) AS ename_concat
FROM got_concat
GROUP BY deptno;Any user-defined aggregate function can also serve as an analytic function: just add "OVER (...)" when you run it.
Within each partition, the various values of e_concat will all be longer versions of one another, all starting the same way.
For example, in deoptno = 10, the various values are
CLARK
CLARK,KING
CLARK,KING,MILLERThe one you want to display is the longest one, which, since they all start the same way, will also be the MAX. -
If sga_target set explicitly, result cache become disabled
hi all,
I am using 11g R2 and automatic memory management. I realized something. if I explicitly declare sga_target parameter in parameter file, result cache become disabled.
as you know if you use automatic memory management, sga_target is set to 0 automatically already but if I write that to the parameter file than whatever I set for result_cache_max_size parameter, instance always opens with result_cache_max_size=0 (I saw that in alert log).
is there any reason for that ?
here is my pfile contents.
orcl.__db_cache_size=922746880
orcl.__java_pool_size=33554432
orcl.__large_pool_size=16777216
orcl.__oracle_base='C:\app\paranoyakX'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=838860800
orcl.__sga_target=1258291200
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=251658240
orcl.__streams_pool_size=16777216
*.audit_file_dest='C:\app\paranoyakX\admin\orcl\adump'
*.audit_trail='DB_EXTENDED'
*.compatible='11.2.0.0.0'
*.control_files='C:\app\paranoyakX\oradata\orcl\control01.ctl','C:\app\paranoyakX\flash_recovery_area\orcl\control02.ctl'
*.db_16k_cache_size=0
*.db_4k_cache_size=0
*.db_block_size=8192
*.db_domain='oracle.com'
*.db_flashback_retention_target=1000
*.db_keep_cache_size=0
*.db_name='orcl'
*.db_recovery_file_dest='C:\app\paranoyakX\flash_recovery_area'
*.db_recovery_file_dest_size=10737418240
*.diagnostic_dest='C:\app\paranoyakX'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.memory_max_target=34359738368
*.memory_target=2097152000
*.nls_language='TURKISH'
*.nls_territory='TURKEY'
*.open_cursors=300
*.pga_aggregate_target=528482304
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.undo_tablespace='UNDOTBS1'
*.result_cache_max_size=5000000
*.sga_target=0I would suggest that you pay more attention to documentation and don't jump to conclusion in a haste. Just because the parameter result_cache_max_size is set to 0, it does not mean that the result cache in itself is disabled. This is the maximum size of the result cache. See below,
[oracle@edbar2p0-orcl ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jul 14 08:35:00 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> sho parameter result
NAME TYPE VALUE
client_result_cache_lag big integer 3000
client_result_cache_size big integer 0
result_cache_max_result integer 5
result_cache_max_size big integer 1184K
result_cache_mode string MANUAL
result_cache_remote_expiration integer 0
SQL> show parameter sga
NAME TYPE VALUE
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 460M
sga_target big integer 0
SQL> set autot trace exp
selSQL> ect /*+ result_cache */ * from scott.dept;
Execution Plan
Plan hash value: 3383998547
| Id | Operation | Name | Rows | Bytes | Cost (
%CPU)| Time |
| 0 | SELECT STATEMENT | | 4 | 80 | 3
(0)| 00:00:01 |
| 1 | RESULT CACHE | 1c13q1afp56bq0jpnmysvywx7g | | |
| |
| 2 | TABLE ACCESS FULL| DEPT | 4 | 80 | 3
(0)| 00:00:01 |
Result Cache Information (identified by operation id):
1 - column-count=3; dependencies=(SCOTT.DEPT); name="select /*+ result_cache
*/ * from scott.dept"
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing optionsThe value for the result_cache parameter is automatically set by oracle depending on either you have Memory_target/SGA_TARGET or Shared_Pool parameter set. Please see oracle documentation for more information.
HTH
Aman.... -
Hi,
Can any one help me how to do performance tunning.I was given two scripts which contains more UNION clauses.Hi,
What version of Oracle are you on? If you have Oracle 22S (the S is for "Sentient"), there's one way:
SCOTT@ORA22S> set autotrace traceonly explain
SCOTT@ORA22S> ed
Wrote file afiedt.buf
1 select *
2 from test
3* where test_date > date '2001-01-01'
SCOTT@ORA22S> /
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=40656 Card=1071132 Bytes=163883196)
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'TEST' (TABLE) (Cost=40656 Card=1071132 Bytes=163883196)
2 1 INDEX (FULL SCAN) OF 'TST_CUSTOM_03' (INDEX) (Cost=6785 Card=1071132)
SCOTT@ORA22S> alter session set sql_go_fast = true;
Session altered.
SCOTT@ORA22S> /
Execution Plan
0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=9979 Card=1071132 Bytes=163883196)
1 0 TABLE ACCESS (FULL) OF 'TEST' (TABLE) (Cost=9979 Card=1071132 Bytes=163883196)Unfortunately Oracle 22S may not be available for a while. Until then you may have to listen to Billy ;-)
cheers,
Anthony -
Complex query, Union or OR
Hi,
I have a complex SQL query with a big WHERE clause,
Select * from TableA , TableB, TableC
where cond1 and cond2 and cond3
now I have to add another condition Cond4, should I go ahead with
First approach
Select * from TableA , TableB, TableC
where (cond1 and cond2 and cond3) or (cond1 and cond2 and cond4)
Secodn Approach
Select * from TableA , TableB, TableC
where cond1 and cond2 and cond3
Union
Select * from TableA , TableB, TableC
where cond1 and cond2 and cond4
Union will be better or OR will be betterOR will perform better. With every union you have extra table (or index) access, you have to read more buffers.
SQL> select empno
2 from emp
3 where empno = 7788 or ename = 'SCOTT';
7788
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 TABLE ACCESS (FULL) OF 'EMP'
SQL> select empno
2 from emp
3 where empno = 7788
4 union
5 select empno
6 from emp
7 where ename = 'SCOTT';
7788
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 SORT (UNIQUE)
2 1 UNION-ALL
3 2 TABLE ACCESS (BY INDEX ROWID) OF 'EMP'
4 3 INDEX (UNIQUE SCAN) OF 'PK_EMP' (UNIQUE)
5 2 TABLE ACCESS (FULL) OF 'EMP' -
Configuring "auto" revoke of BPM task execution
Hi All,
I need to implement something to do an "auto" revoke of a task when the user exit from "task execution" view without using revoke+close button.
Someone can help me?
Thanks in advance.
Edited by: g.agnelli on Apr 11, 2011 2:41 PMHi,
unfortunately this is not possible today. However it is planned to extend the API in future releases, so that you could programmatically call a revoke method. But again, this is not available in the current release.
Regards,
Christian -
How can I revoke execution of dbms_job from users ?
I tried "revoke execute on dbms_job from user_X ;"
and got an error that I can not revoke permission I didn't grant .
I don't want that anyone who wants to schedule a job every 10 seconds will be able to do that . I want to permit only users of dba role , to execute this (or other) package .
Thanks ,
Lior .dbms_job is used under the covers by several pieces of database functionality including AQ notification, AQ propagation, refreshing of materialized views etc .
I did see a security note that recommended revoking execute on dbms_job from public, but you should be well aware of possible unintended consequences of this action i.e. don't do this on a production database without testing it on a non-production database first !
I don't really see the security benefit of this. Anyone could write a shell script or use the Windows scheduler or cron to submit the same huge query every 2 minutes !
The real solution here is performance monitoring, auditing and accountability.
-Ravi -
Loading jar files at execution time via URLClassLoader
Hello�All,
I'm�making�a�Java�SQL�Client.�I�have�practicaly�all�basic�work�done,�now�I'm�trying�to�improve�it.
One�thing�I�want�it�to�do�is�to�allow�the�user�to�specify�new�drivers�and�to�use�them�to�make�new�connections.�To�do�this�I�have�this�class:�
public�class�DriverFinder�extends�URLClassLoader{
����private�JarFile�jarFile�=�null;
����
����private�Vector�drivers�=�new�Vector();
����
����public�DriverFinder(String�jarName)�throws�Exception{
��������super(new�URL[]{�new�URL("jar",�"",�"file:"�+�new�File(jarName).getAbsolutePath()�+"!/")�},�ClassLoader.getSystemClassLoader());
��������jarFile�=�new�JarFile(new�File(jarName));
��������
��������/*
��������System.out.println("-->"�+�System.getProperty("java.class.path"));
��������System.setProperty("java.class.path",�System.getProperty("java.class.path")+File.pathSeparator+jarName);
��������System.out.println("-->"�+�System.getProperty("java.class.path"));
��������*/
��������
��������Enumeration�enumeration�=�jarFile.entries();
��������while(enumeration.hasMoreElements()){
������������String�className�=�((ZipEntry)enumeration.nextElement()).getName();
������������if(className.endsWith(".class")){
����������������className�=�className.substring(0,�className.length()-6);
����������������if(className.indexOf("Driver")!=-1)System.out.println(className);
����������������
����������������try{
��������������������Class�classe�=�loadClass(className,�true);
��������������������Class[]�interfaces�=�classe.getInterfaces();
��������������������for(int�i=0;�i<interfaces.length;�i++){
������������������������if(interfaces.getName().equals("java.sql.Driver")){
����������������������������drivers.add(classe);
������������������������}
��������������������}
��������������������Class�superclasse�=�classe.getSuperclass();
��������������������interfaces�=�superclasse.getInterfaces();
��������������������for(int�i=0;�i<interfaces.length;�i++){
������������������������if(interfaces[i].getName().equals("java.sql.Driver")){
����������������������������drivers.add(classe);
������������������������}
��������������������}
����������������}catch(NoClassDefFoundError�e){
����������������}catch(Exception�e){}
������������}
��������}
����}
����
����public�Enumeration�getDrivers(){
��������return�drivers.elements();
����}
����
����public�String�getJarFileName(){
��������return�jarFile.getName();
����}
����
����public�static�void�main(String[]�args)�throws�Exception{
��������DriverFinder�df�=�new�DriverFinder("D:/Classes/db2java.zip");
��������System.out.println("jar:�"�+�df.getJarFileName());
��������Enumeration�enumeration�=�df.getDrivers();
��������while(enumeration.hasMoreElements()){
������������Class�classe�=�(Class)enumeration.nextElement();
������������System.out.println(classe.getName());
��������}
����}
It�loads�a�jar�and�searches�it�looking�for�drivers�(classes�implementing�directly�or�indirectly�interface�java.sql.Driver)�At�the�end�of�the�execution�I�have�found�all�drivers�in�the�jar�file.
The�main�application�loads�jar�files�from�an�XML�file�and�instantiates�one�DriverFinder�for�each�jar�file.�The�problem�is�at�execution�time,�it�finds�the�drivers�and�i�think�loads�it�by�issuing�this�statement�(Class�classe�=�loadClass(className,�true);),�but�what�i�think�is�not�what�is�happening...�the�execution�of�my�code�throws�this�exception
java.lang.ClassNotFoundException:�com.ibm.as400.access.AS400JDBCDriver
��������at�java.net.URLClassLoader$1.run(URLClassLoader.java:198)
��������at�java.security.AccessController.doPrivileged(Native�Method)
��������at�java.net.URLClassLoader.findClass(URLClassLoader.java:186)
��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:299)
��������at�sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
��������at�java.lang.ClassLoader.loadClass(ClassLoader.java:255)
��������at�java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
��������at�java.lang.Class.forName0(Native�Method)
��������at�java.lang.Class.forName(Class.java:140)
��������at�com.marmots.database.DB.<init>(DB.java:44)
��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
��������at�com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
��������at�com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
��������at�com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
Driver�file�is�not�in�the�classpath�!!!�
I�have�tried�also�(as�you�can�see�in�comented�lines)�to�update�System�property�java.class.path�by�adding�the�path�to�the�jar�but�neither...
I'm�sure�I'm�making�a/some�mistake/s...�can�you�help�me?
Thanks�in�advice,
(if�there�is�some�incorrect�word�or�expression�excuse�me)Sorry i have tried to format the code, but it has changed to �... sorry read this one...
Hello All,
I'm making a Java SQL Client. I have practicaly all basic work done, now I'm trying to improve it.
One thing I want it to do is to allow the user to specify new drivers and to use them to make new connections. To do this I have this class:
public class DriverFinder extends URLClassLoader{
private JarFile jarFile = null;
private Vector drivers = new Vector();
public DriverFinder(String jarName) throws Exception{
super(new URL[]{ new URL("jar", "", "file:" + new File(jarName).getAbsolutePath() +"!/") }, ClassLoader.getSystemClassLoader());
jarFile = new JarFile(new File(jarName));
System.out.println("-->" + System.getProperty("java.class.path"));
System.setProperty("java.class.path", System.getProperty("java.class.path")+File.pathSeparator+jarName);
System.out.println("-->" + System.getProperty("java.class.path"));
Enumeration enumeration = jarFile.entries();
while(enumeration.hasMoreElements()){
String className = ((ZipEntry)enumeration.nextElement()).getName();
if(className.endsWith(".class")){
className = className.substring(0, className.length()-6);
if(className.indexOf("Driver")!=-1)System.out.println(className);
try{
Class classe = loadClass(className, true);
Class[] interfaces = classe.getInterfaces();
for(int i=0; i<interfaces.length; i++){
if(interfaces.getName().equals("java.sql.Driver")){
drivers.add(classe);
Class superclasse = classe.getSuperclass();
interfaces = superclasse.getInterfaces();
for(int i=0; i<interfaces.length; i++){
if(interfaces[i].getName().equals("java.sql.Driver")){
drivers.add(classe);
}catch(NoClassDefFoundError e){
}catch(Exception e){}
public Enumeration getDrivers(){
return drivers.elements();
public String getJarFileName(){
return jarFile.getName();
public static void main(String[] args) throws Exception{
DriverFinder df = new DriverFinder("D:/Classes/db2java.zip");
System.out.println("jar: " + df.getJarFileName());
Enumeration enumeration = df.getDrivers();
while(enumeration.hasMoreElements()){
Class classe = (Class)enumeration.nextElement();
System.out.println(classe.getName());
It loads a jar and searches it looking for drivers (classes implementing directly or indirectly interface java.sql.Driver) At the end of the execution I have found all drivers in the jar file.
The main application loads jar files from an XML file and instantiates one DriverFinder for each jar file. The problem is at execution time, it finds the drivers and i think loads it by issuing this statement (Class classe = loadClass(className, true);), but what i think is not what is happening... the execution of my code throws this exception
java.lang.ClassNotFoundException: com.ibm.as400.access.AS400JDBCDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at com.marmots.database.DB.<init>(DB.java:44)
at com.marmots.dbreplicator.DBReplicatorConfigHelper.carregaConfiguracio(DBReplicatorConfigHelper.java:296)
at com.marmots.dbreplicator.DBReplicatorConfigHelper.<init>(DBReplicatorConfigHelper.java:74)
at com.marmots.dbreplicator.DBReplicatorAdmin.<init>(DBReplicatorAdmin.java:115)
at com.marmots.dbreplicator.DBReplicatorAdmin.main(DBReplicatorAdmin.java:93)
Driver file is not in the classpath !!!
I have tried also (as you can see in comented lines) to update System property java.class.path by adding the path to the jar but neither...
I'm sure I'm making a/some mistake/s... can you help me?
Thanks in advice,
(if there is some incorrect word or expression excuse me) -
Execution Error while using a trigger
Hi all,
I have written the following trigger.<br><br>
<b>SQL></b> CREATE OR REPLACE TRIGGER update_publisher_trgr <BR>
AFTER INSERT OR UPDATE <BR>
ON tinku.book_publishers <BR>
FOR EACH ROW <BR>
BEGIN <BR>
IF INSERTING THEN <BR>
INSERT INTO scott.publishers <BR>
VALUES(:new.p_id,:new.name,:new.token_id,:new.is_reg);<BR>
<B>ELSIF UPDATING THEN -----(9 th row) </B><BR>
UPDATE scott.publishers <BR>
SET is_reg=:new.is_reg <BR>
WHERE publisher_id=:old.p_id; <BR>
IF(:new.is_reg==0) THEN <BR>
DECLARE <BR>
CURSOR book_id_cursor IS <BR>
SELECT book_index <BR>
FROM books <BR>
WHERE publisher_id=:old.p_id; <BR>
BEGIN <BR>
FOR i IN book_id_cursor LOOP <BR>
INSERT INTO scott.publisher_details <BR>
VALUES (updates_id_seq.NEXTVAL,i.book_index,12); <BR>
END LOOP; <BR>
COMMIT; <BR>
END; <BR>
END IF; <BR>
END IF; <BR>
END update_publisher_trgr; <BR>
SQL> / <br>
Warning: Trigger created with compilation errors.<br>
SQL> show errors; <br>
Errors for TRIGGER UPDATE_PUBLISHER_TRGR:<br><br>
LINE/COL ERROR <br>
-------------- -----------------------------------------------------------------<br>
9/32 PLS-00103: Encountered the symbol "=" when expecting one of the<br>
following:<br>
( - + all mod null <an identifier><br>
<a double-quoted delimited-identifier> <a bind variable> any<br>
avg count current max min prior some sql stddev sum variance<br>
execute forall time timestamp interval date<br>
<a string literal with character set specification><br>
<a number> <a single-quoted SQL string><br>
<br><br>
How can I avoid this error.<br>
<br>
Please help me in this regard,<br>
<br>
Thanks in Advance,<br>
<br>
Trinath Somanchi,<br>
Hyderabad.<br>
<br>hi,
I have created the procedure in scott schema and the trigger in tinku schema.<br>
the procedure is created with no errors but trigger is created with compilation errors.
<br>
the procedure created in scott schema:<br><br>
CREATE OR REPLACE PROCEDURE populate_pub_dtls(pPublisherId Number)<br>
IS <br>
CURSOR book_id_cursor IS <br>
SELECT book_index <br>
FROM books <br>
WHERE publisher_id=pPublisherId; <br>
<br>
next_val NUMBER;<br>
BEGIN <br>
FOR i IN book_id_cursor LOOP <br>
SELECT updates_id_seq.NEXTVAL INTO next_val FROM dual;<br>
INSERT INTO scott.publisher_details <br>
VALUES (next_val,i.book_index,12); <br>
END LOOP; <br>
COMMIT;<br>
END; <br>
<br>
the Trigger created in Tinku schema is:<br>
<br>
CREATE OR REPLACE TRIGGER update_publisher_trgr <br>
AFTER INSERT OR UPDATE <br>
ON tinku.book_publishers <br>
FOR EACH ROW <br>
BEGIN <br>
IF INSERTING THEN <br>
INSERT INTO scott.publishers <br>
VALUES(:new.p_id,:new.name,:new.token_id,:new.is_reg);<br>
ELSIF UPDATING THEN<br>
UPDATE scott.publishers <br>
SET is_reg=:new.is_reg <br>
WHERE publisher_id=:old.p_id; <br>
IF(:new.is_reg=0) THEN <br>
scott.populate_pub_dtls ( :old.p_id );<br>
END IF; <br>
END IF; <br>
END update_publisher_trgr; <br>
<br>
but this trigger on execution is giving the following errors:<br>
<br>
LINE/COL ERROR <br>
-------- -----------------------------------------------------------------<br>
3/8 PLS-00201: identifier 'PUBLISHERS' must be declared <br>
3/8 PL/SQL: SQL Statement ignored <br>
6/6 PLS-00201: identifier 'PUBLISHERS' must be declared <br>
6/6 PL/SQL: SQL Statement ignored <br>
10/28 PLS-00201: identifier 'SCOTT.POPULATE_PUB_DTLS ' <br>
must be declared <br><br>
10/28 PL/SQL: Statement ignored <br>
<br>
but scott.publishers is existing.<br>
<br>
how can i get rid of this error.<br>
<br>
Please help me in this regard,<br>
<br>
Thanks in Advance;<br>
<br>
Trinath Somanchi,
<br>
Hyderabad.
<br> -
Unable to get the execution plan when using dbms_sqltune (11gR2)
Hi,
Database version: 11gR2
I have a user A that is granted privileges to execute dbms_sqltune.
I can create a task, excute it and run the report.
But, when I run the report I get the following error:
SQL> show user
USER is "A"
SQL> set long 10000 longchunksize 10000 linesize 200 pagesize 000
select dbms_sqltune.report_tuning_task(task_name => 'MYTEST') from dual;SQL>
GENERAL INFORMATION SECTION
Tuning Task Name : MYTEST
Tuning Task Owner : A
Workload Type : Single SQL Statement
Scope : COMPREHENSIVE
Time Limit(seconds): 1800
Completion Status : COMPLETED
Started at : 05/15/2013 11:53:22
Completed at : 05/15/2013 11:53:23
Schema Name: SYSMAN
SQL ID : gjm43un5cy843
SQL Text : SELECT SUM(USED), SUM(TOTAL) FROM (SELECT /*+ ORDERED */
SUM(D.BYTES)/(1024*1024)-MAX(S.BYTES) USED,
SUM(D.BYTES)/(1024*1024) TOTAL FROM (SELECT TABLESPACE_NAME,
SUM(BYTES)/(1024*1024) BYTES FROM (SELECT /*+ ORDERED USE_NL(obj
tab) */ DISTINCT TS.NAME FROM SYS.OBJ$ OBJ, SYS.TAB$ TAB,
SYS.TS$ TS WHERE OBJ.OWNER# = USERENV('SCHEMAID') AND OBJ.OBJ# =
TAB.OBJ# AND TAB.TS# = TS.TS# AND BITAND(TAB.PROPERTY,1) = 0 AND
BITAND(TAB.PROPERTY,4194400) = 0) TN, DBA_FREE_SPACE SP WHERE
SP.TABLESPACE_NAME = TN.NAME GROUP BY SP.TABLESPACE_NAME) S,
DBA_DATA_FILES D WHERE D.TABLESPACE_NAME = S.TABLESPACE_NAME
GROUP BY D.TABLESPACE_NAME)
ERRORS SECTION
- ORA-00942: table or view does not exist
SQL>
It seems there a missing privileg for dislaying the execution plan.
As a workaround, this is solved by granting select any dictionay (which I don't want) to the user A.
Does someone have an idea about what privilege is missing?
Kind Regards.Hi,
SELECT ANY DICTIONARY system privilege provides access to SYS schema objects only => which you are using as workaround
SELECT_CATALOG_ROLE provides access to all SYS views only.==> Safe option
SQL> grant SELECT ANY DICTIONARY to test;
Grant succeeded.
SQL> conn test/test
Connected.
SQL> select count(*) from sys.obj$;
COUNT(*)
13284
SQL> conn /as sysdba
Connected.
SQL> revoke SELECT ANY DICTIONARY from test;
Revoke succeeded.
SQL> grant SELECT_CATALOG_ROLE to test;
Grant succeeded.
SQL> conn test/test
Connected.
SQL> select count(*) from sys.obj$;
select count(*) from sys.obj$
ERROR at line 1:
ORA-00942: table or view does not existHTH -
Problem in execution of a function having clob datatype
[http://www.orafaq.com/forum/t/128331/98870/]
Hi,
I had a Problem in executing a function having clob datatype.
Here below is my function.
create or replace type split_obj as object
occurence_id number(10,0),
splitvalue varchar2(1000)
create or replace type split_rec as table of split_obj;
create or replace FUNCTION Split_new1(
p_string IN clob,
p_delimiter IN VARCHAR2
) return split_rec pipelined is
v_length NUMBER := dbms_lob.getlength(p_string);
v_start NUMBER := 1;
v_index NUMBER;
V_temp NUMBER(10,0):=0;
begin
WHILE(v_start <= v_length)
LOOP
v_index := dbms_lob.INSTR(p_string, p_delimiter, v_start);
IF v_index = 0 THEN
V_temp:=V_temp+1;
PIPE ROW(split_obj(v_temp,dbms_lob.SUBSTR(p_string, v_length,v_start)));
v_start := v_length + 1;
ELSE
v_temp:=v_temp+1;
PIPE ROW(split_obj(v_temp,dbms_lob.SUBSTR(p_string, v_index - v_start,v_start)));
v_start := v_index + 1;
END IF;
END LOOP;
return;
end Split_new1;Here attached link contains the procedure trying to execute the function with huge string more than 400kb.
Could you pls let me know how to do the same in sqlplus and toad.
Thanks in advance.
Edited by: user512743 on Nov 27, 2008 4:31 AMBluShadow wrote:
The problem is that in your execution of this you are trying to assign a value to the clob variable using
v_clob := '<string>'
where the string is greater than allowed in PL/SQL.
Whilst the CLOB itself can hold more data, the string is actually the equivalent of a VARCHAR2 so cannot exceed VARCHAR2 limits.
You should use the DBMS_LOB package to append data to your CLOB in chunks of no more than 32767 characters at a time.??? PL/SQL provides full CLOB support. There is no need to use DBMS_LOB (although you could). OP's function has logic errors. Anyway:
SQL> create or replace type split_obj as object
2 (
3 occurence_id number(10,0),
4 splitvalue varchar2(1000)
5 );
6 /
Type created.
SQL> create or replace type split_rec as table of split_obj;
2 /
Type created.
SQL> create or replace
2 FUNCTION Split_new1(
3 p_string IN clob,
4 p_delimiter IN VARCHAR2
5 )
6 return split_rec pipelined
7 is
8 v_length NUMBER := length(p_string);
9 v_start NUMBER := 1;
10 v_end NUMBER;
11 V_id NUMBER :=0;
12 v_clob CLOB := p_string || p_delimiter;
13 begin
14 while(v_start <= v_length) loop
15 v_end := instr(v_clob, p_delimiter, v_start);
16 v_id := v_id + 1;
17 pipe row(split_obj(v_id,substr(p_string,v_start,v_end - v_start)));
18 v_start := v_end + length(p_delimiter);
19 end loop;
20 return;
21 end Split_new1;
22 /
Function created.
SQL> create table test_table(x clob)
2 /
Table created.
SQL> declare
2 c clob;
3 begin
4 for i in 1..26 loop
5 c := c || lpad(chr(ascii('a') + i - 1),1000,chr(ascii('a') + i - 1)) || ',';
6 end loop;
7 for i in 1..26 loop
8 c := c || lpad(chr(ascii('A') + i - 1),1000,chr(ascii('A') + i - 1)) || ',';
9 end loop;
10 for i in 1..26 loop
11 c := c || lpad(chr(ascii('a') + i - 1),1000,chr(ascii('a') + i - 1)) || ',';
12 end loop;
13 for i in 1..26 loop
14 if i > 1 then c := c || ','; end if;
15 c := c || lpad(chr(ascii('A') + i - 1),1000,chr(ascii('A') + i - 1));
16 end loop;
17 insert into test_table
18 values(c);
19 end;
20 /
PL/SQL procedure successfully completed.
SQL> select length(x)
2 from test_table
3 /
LENGTH(X)
104103
SQL> select t.occurence_id,
2 length(splitvalue) len,
3 substr(splitvalue,1,20) first_20
4 from test_table,
5 table(Split_new1(x,',')) t
6 /
OCCURENCE_ID LEN FIRST_20
1 1000 aaaaaaaaaaaaaaaaaaaa
2 1000 bbbbbbbbbbbbbbbbbbbb
3 1000 cccccccccccccccccccc
4 1000 dddddddddddddddddddd
5 1000 eeeeeeeeeeeeeeeeeeee
6 1000 ffffffffffffffffffff
7 1000 gggggggggggggggggggg
8 1000 hhhhhhhhhhhhhhhhhhhh
9 1000 iiiiiiiiiiiiiiiiiiii
10 1000 jjjjjjjjjjjjjjjjjjjj
11 1000 kkkkkkkkkkkkkkkkkkkk
OCCURENCE_ID LEN FIRST_20
12 1000 llllllllllllllllllll
13 1000 mmmmmmmmmmmmmmmmmmmm
14 1000 nnnnnnnnnnnnnnnnnnnn
15 1000 oooooooooooooooooooo
16 1000 pppppppppppppppppppp
17 1000 qqqqqqqqqqqqqqqqqqqq
18 1000 rrrrrrrrrrrrrrrrrrrr
19 1000 ssssssssssssssssssss
20 1000 tttttttttttttttttttt
21 1000 uuuuuuuuuuuuuuuuuuuu
22 1000 vvvvvvvvvvvvvvvvvvvv
OCCURENCE_ID LEN FIRST_20
23 1000 wwwwwwwwwwwwwwwwwwww
24 1000 xxxxxxxxxxxxxxxxxxxx
25 1000 yyyyyyyyyyyyyyyyyyyy
26 1000 zzzzzzzzzzzzzzzzzzzz
27 1000 AAAAAAAAAAAAAAAAAAAA
28 1000 BBBBBBBBBBBBBBBBBBBB
29 1000 CCCCCCCCCCCCCCCCCCCC
30 1000 DDDDDDDDDDDDDDDDDDDD
31 1000 EEEEEEEEEEEEEEEEEEEE
32 1000 FFFFFFFFFFFFFFFFFFFF
33 1000 GGGGGGGGGGGGGGGGGGGG
OCCURENCE_ID LEN FIRST_20
34 1000 HHHHHHHHHHHHHHHHHHHH
35 1000 IIIIIIIIIIIIIIIIIIII
36 1000 JJJJJJJJJJJJJJJJJJJJ
37 1000 KKKKKKKKKKKKKKKKKKKK
38 1000 LLLLLLLLLLLLLLLLLLLL
39 1000 MMMMMMMMMMMMMMMMMMMM
40 1000 NNNNNNNNNNNNNNNNNNNN
41 1000 OOOOOOOOOOOOOOOOOOOO
42 1000 PPPPPPPPPPPPPPPPPPPP
43 1000 QQQQQQQQQQQQQQQQQQQQ
44 1000 RRRRRRRRRRRRRRRRRRRR
OCCURENCE_ID LEN FIRST_20
45 1000 SSSSSSSSSSSSSSSSSSSS
46 1000 TTTTTTTTTTTTTTTTTTTT
47 1000 UUUUUUUUUUUUUUUUUUUU
48 1000 VVVVVVVVVVVVVVVVVVVV
49 1000 WWWWWWWWWWWWWWWWWWWW
50 1000 XXXXXXXXXXXXXXXXXXXX
51 1000 YYYYYYYYYYYYYYYYYYYY
52 1000 ZZZZZZZZZZZZZZZZZZZZ
53 1000 aaaaaaaaaaaaaaaaaaaa
54 1000 bbbbbbbbbbbbbbbbbbbb
55 1000 cccccccccccccccccccc
OCCURENCE_ID LEN FIRST_20
56 1000 dddddddddddddddddddd
57 1000 eeeeeeeeeeeeeeeeeeee
58 1000 ffffffffffffffffffff
59 1000 gggggggggggggggggggg
60 1000 hhhhhhhhhhhhhhhhhhhh
61 1000 iiiiiiiiiiiiiiiiiiii
62 1000 jjjjjjjjjjjjjjjjjjjj
63 1000 kkkkkkkkkkkkkkkkkkkk
64 1000 llllllllllllllllllll
65 1000 mmmmmmmmmmmmmmmmmmmm
66 1000 nnnnnnnnnnnnnnnnnnnn
OCCURENCE_ID LEN FIRST_20
67 1000 oooooooooooooooooooo
68 1000 pppppppppppppppppppp
69 1000 qqqqqqqqqqqqqqqqqqqq
70 1000 rrrrrrrrrrrrrrrrrrrr
71 1000 ssssssssssssssssssss
72 1000 tttttttttttttttttttt
73 1000 uuuuuuuuuuuuuuuuuuuu
74 1000 vvvvvvvvvvvvvvvvvvvv
75 1000 wwwwwwwwwwwwwwwwwwww
76 1000 xxxxxxxxxxxxxxxxxxxx
77 1000 yyyyyyyyyyyyyyyyyyyy
OCCURENCE_ID LEN FIRST_20
78 1000 zzzzzzzzzzzzzzzzzzzz
79 1000 AAAAAAAAAAAAAAAAAAAA
80 1000 BBBBBBBBBBBBBBBBBBBB
81 1000 CCCCCCCCCCCCCCCCCCCC
82 1000 DDDDDDDDDDDDDDDDDDDD
83 1000 EEEEEEEEEEEEEEEEEEEE
84 1000 FFFFFFFFFFFFFFFFFFFF
85 1000 GGGGGGGGGGGGGGGGGGGG
86 1000 HHHHHHHHHHHHHHHHHHHH
87 1000 IIIIIIIIIIIIIIIIIIII
88 1000 JJJJJJJJJJJJJJJJJJJJ
OCCURENCE_ID LEN FIRST_20
89 1000 KKKKKKKKKKKKKKKKKKKK
90 1000 LLLLLLLLLLLLLLLLLLLL
91 1000 MMMMMMMMMMMMMMMMMMMM
92 1000 NNNNNNNNNNNNNNNNNNNN
93 1000 OOOOOOOOOOOOOOOOOOOO
94 1000 PPPPPPPPPPPPPPPPPPPP
95 1000 QQQQQQQQQQQQQQQQQQQQ
96 1000 RRRRRRRRRRRRRRRRRRRR
97 1000 SSSSSSSSSSSSSSSSSSSS
98 1000 TTTTTTTTTTTTTTTTTTTT
99 1000 UUUUUUUUUUUUUUUUUUUU
OCCURENCE_ID LEN FIRST_20
100 1000 VVVVVVVVVVVVVVVVVVVV
101 1000 WWWWWWWWWWWWWWWWWWWW
102 1000 XXXXXXXXXXXXXXXXXXXX
103 1000 YYYYYYYYYYYYYYYYYYYY
104 1000 ZZZZZZZZZZZZZZZZZZZZ
104 rows selected.
SQL> As you can see, function works OK without DBMS_LOB on CLOB of 104103 bytes.
SY. -
database version 11.2.0.4
rac two node
CREATE INDEX MAXIMO.ACTCI_NDX3 ON MAXIMO.ACTCI
(DESCRIPTION)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('lexer global_lexer language column LANGCODE')
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: global_lexer
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366Like the error message says, you don't have a global_lexer. So, you need to create a global_lexer and that lexer must have at least a default sub_lexer, then you can use that global_lexer in your index parameters. Please see the demonstration below, including reproduction of the error and solution.
SCOTT@orcl12c> -- reproduction of problem:
SCOTT@orcl12c> CREATE TABLE actci
2 (description VARCHAR2(60),
3 langcode VARCHAR2(30))
4 /
Table created.
SCOTT@orcl12c> CREATE INDEX ACTCI_NDX3 ON ACTCI (DESCRIPTION)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS('lexer global_lexer language column LANGCODE')
4 /
CREATE INDEX ACTCI_NDX3 ON ACTCI (DESCRIPTION)
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-10700: preference does not exist: global_lexer
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 366
SCOTT@orcl12c> -- solution:
SCOTT@orcl12c> DROP INDEX actci_ndx3
2 /
Index dropped.
SCOTT@orcl12c> BEGIN
2 CTX_DDL.CREATE_PREFERENCE ('global_lexer', 'multi_lexer');
3 CTX_DDL.CREATE_PREFERENCE ('english_lexer', 'basic_lexer');
4 CTX_DDL.ADD_SUB_LEXER ('global_lexer', 'default', 'english_lexer');
5 END;
6 /
PL/SQL procedure successfully completed.
SCOTT@orcl12c> CREATE INDEX ACTCI_NDX3 ON ACTCI (DESCRIPTION)
2 INDEXTYPE IS CTXSYS.CONTEXT
3 PARAMETERS('lexer global_lexer language column LANGCODE')
4 /
Index created. -
Reporting Services R2 log entries have stopped generating on report execution.
Hi -
I have a new instance of a reporting server and the log files have quit generating on report execution.
When the services restart this is the log file:
rshost!rshost!8e8!01/22/2014-17:08:33:: i INFO: CLR runtime is initialized.
rshost!rshost!8e8!01/22/2014-17:08:33:: i INFO: Derived memory configuration based on physical memory as 3931704 KB
rshost!rshost!8e8!01/22/2014-17:08:33:: w WARN: Failed to initialize performance counters: ffffffff. Possible setup issue.
rshost!rshost!8e8!01/22/2014-17:08:33:: e ERROR: Failed to start service, error=1063.
We have logging turned on on the server. Report Server Mode is Native. Dont see anything in the application log about failed service.
Any ideas?Hi dwrco,
Have you recently install any update such as MS12-070 (KB2716440)? If so, it is a known issue for some patches for SQL Server. The reason is as follows:
When a .NET application starts up, the .NET Framework tries to check if the Microsoft assemblies are right and have not been modified, this is done through connecting to a server that has a revocation list in internet. When the framework tries to connect
to the server to check if it has access to internet with an elevated timeout, this makes that any other .NET application that has less timeout setting fails (such as SSIS or SSRS) with timeout error.
For example, the error message "The request failed or the service did not respond in a timely fashion." means that the SSRS timeout is lower than the timeout of the connection to the revoke list server established by .NET Framework.
To work around the issue, we usually use two approaches:
Increase the value of ServicesPipeTimeout registry key of Reporting Services
Disable generatePublisherEvidence element of ReportingServicesService.exe.config file
For the detailed steps, please see:
http://blogs.msdn.com/b/mariae/archive/2012/11/12/reporting-services-service-doesn-t-start-after-the-installation-of-ms12-070-security-patch.aspx
Regards,
Mike Yin
If you have any feedback on our support, please click
here
Mike Yin
TechNet Community Support -
Oracle error while using function dbms_lob.substr()
Following sql statement is causing error select dbms_lob.substr(clob_colum,32767) from Table* when the size of clob_column goes above 4 KB. The error message is given below
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1
The issue is getting resolved when reducing the size of the CLOB column.
Is this a limitation of oracle query? Can anybody please help me to resolve this error? Thanks in Advance.
Regards,
ShineHi.
>
We are using this query inside a package and the data is used to generate an XML file and it finally used to generate a pdf report. There exists many clob records with huge size and in that case report execution fails with the oracle message.
>
While the XML file is generated or PDF report?
Which message? ORA-06502: PL/SQL: numeric or value error: character string buffer too small ???
>
So we need to modify the query in a way that it executes fine even if the size is more than 4 KB(upto a possible size). I tried using substr function against the clob column but it does not returned any value.
>
Then, do you need the first 4 KB or the entire CLOB?
Can't you write CLOB directly?
Please post some example data as well as your desired output in order to understand completely your problem and test our ideas.
Regards. -
I am having a problem using substring to select/filter. The substring selection is not holding to the specified locations in the string. Instead, it finds any matching text in the entire string.
For reference, my web site intent is,
1. A single XML master data base contains all photographs for display. My XML data set does not have quotes.
2. Spry tabbed panels are used to select galleries (Spry regions) (e.g. roses, Big Sur Coast, etc) from the master data base. There are a dozen galleries.
3. Thumbnails of a gallery are displayed in the content panel.
4. Selecting a thumbnail displays a large view of the selected photo in a separate div (Spry detail region).
The galleries are filtered using spry:test, with the "subject" variable compared against a specified value (i.e. rose, Monterey, Salinas, etc.).
The "2010 Photographs" gallery is determined by the year of the photo. In the "name" variable, the first 6 digits are the date (month, day, year). I've set up the spry:test with substring as follows,
spry:test="'substring({name},5,2)'.search ('10 ') != -1;"
This is to obtain the 5th and 6th locations of "name" variable and compare it with the "10 ".
A sample of the "photo" node follows,
<photo>
<name>032010 Lover's Pt, Pacific Grove 02a web.jpg</name>
<width>599</width>
<height>400</height>
<thumbname>032010 Lover's Pt, Pacific Grove 02a thumbnail.jpg.</thumbname>
<thumbwidth>150</thumbwidth>
<thumbheight>100</thumbheight>
<subject>night</subject>
<description>West side of Lover's Point, Pacific Grove, Ca.; the surf was unusually calm. The glow reflecting on the clouds and the bay is from the town of Santa Cruz.</description>
</photo>
<photo>
<name>090609 Pelican over Pacific Grove 02a 8x10 web.jpg</name>
<width>500</width>
<height>400</height>
<thumbname>090609 Pelican over Pacific Grove 02a 8x10 thumbnail.jpg</thumbname>
<thumbwidth>125</thumbwidth>
<thumbheight>100</thumbheight>
<subject>animal</subject>
<description>Pelican caught in flight; using a flash, this photograph was taken at dusk; Pacific Grove, Ca.</description>
</photo>
Both of these nodes would be selected with the "10 " criteria. However the second one is not from the year 2010.
The full source code is shown below.
My search of these forums and the Internet have indicated that this should work. Please explain what I am missing or doing incorrectly in the code.
I thank you.
Scott
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EnvisionMoore</title>
<style type="text/css">
<!--
body {
background-color: #FFF;
text-align: center;
margin: 0px;
padding: 0px;
#wrapper {
width: 98%;
margin-top: 10px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
border: 0px dashed #F0F;
position: absolute;
left: 1px;
top: 1px;
height: 825px;
background-color: #FFE4CA;
#leftColumn {
float: left;
height: 700px;
width: 400px;
position: relative;
left: 0px;
top: 0px;
#header {
height: 125px;
font-size: 24px;
font-style: italic;
vertical-align: bottom;
padding: 0px;
text-align: center;
float: right;
width: 50%;
border: 0px solid #F00;
position: relative;
top: 0px;
right: 0px;
#selectedPhoto {
height: 600px;
font-size: 24px;
font-style: italic;
vertical-align: middle;
padding: 0px;
text-align: center;
margin-top: 135px;
width: 650px;
border: 0px solid #0F0;
position: absolute;
right: -1px;
bottom: 1px;
-->
</style>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
var name;
var width;
var height;
var thumbname;
var thumbwidth;
var thumbheight;
var subject;
var description;
var thumbnail;
var dsphoto;
var dsdata;
//-->
</script>
<script type="text/javascript">
var dsdata = new Spry.Data.XMLDataSet("EM_photo.xml", "/gallery");
var dsphoto = new Spry.Data.XMLDataSet("EM_photo.xml", "gallery/photos/photo");
</script>
<script type="text/javascript">
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
</script>
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="leftColumn">
<div id="TabbedPanels1" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">Welcome</li>
<li class="TabbedPanelsTab" tabindex="0">Mechanical Engineering</li>
<li class="TabbedPanelsTab" tabindex="0">Photography</li>
</ul>
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent">
<h1><br />
<br />
<br />
<br />Welcome!
<br />
</h1>
</div>
<div class="TabbedPanelsContent">Mechanical Engineering - Content 2</div>
<div class="TabbedPanelsContent"> <!-- Photography - Content 3 -->
<div id="TabbedPanels2" class="TabbedPanels">
<ul class="TabbedPanelsTabGroup">
<li class="TabbedPanelsTab" tabindex="0">2010 Photographs</li>
<li class="TabbedPanelsTab" tabindex="0">Roses</li>
<li class="TabbedPanelsTab" tabindex="0">Calla Lilies</li>
<li class="TabbedPanelsTab" tabindex="0">Other Blossoms and Leaves</li>
<li class="TabbedPanelsTab" tabindex="0">Pacific Grove Beach</li>
<li class="TabbedPanelsTab" tabindex="0">Monterey Harbor and Beach</li>
<li class="TabbedPanelsTab" tabindex="0">Big Sur Coast</li>
<li class="TabbedPanelsTab" tabindex="0">Salinas Valley</li>
<li class="TabbedPanelsTab" tabindex="0">Animals</li>
<li class="TabbedPanelsTab" tabindex="0">Night</li>
<li class="TabbedPanelsTab" tabindex="0">Church</li>
<li class="TabbedPanelsTab" tabindex="0">Other</li>
</ul>
<div class="TabbedPanelsContentGroup-2">
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'substring({name},5,2)'.search ('10 ') != -1;" ; onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat = "dsphoto" spry:test="'{subject}'.search (/rose/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/callalily/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = "{thumbwidth}px" height = "{thumbheight}px" onclick="dsphoto.setCurrentRow('{ds_RowID}');" spry:repeat="dsphoto" spry:test="'{subject}'.search (/blossom/) !=-1;" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = "{thumbwidth}px" height = "{thumbheight}px" onclick="dsphoto.setCurrentRow('{ds_RowID}');" spry:repeat = "dsphoto" spry:test="'{subject}'.search (/^p/) !=-1;" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/Monterey/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/bigsurcoast/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/Salinas/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/animal/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/night/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/church/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
<div class="TabbedPanelsContent-2">
<div spry:region="dsphoto dsdata"> <img src="{dsdata::thumbnail/@base}{thumbname}" width = {thumbwidth}px height = {thumbheight}px spry:repeat="dsphoto" spry:test="'{subject}'.search (/other/) !=-1;" onclick="dsphoto.setCurrentRow('{ds_RowID}');" /></div>
</div>
</div>
</div>
</div>
<!-- End "Photography Content 3" Tabbed Panels Content. -->
</div>
</div>
</div><!-- End div "leftColumn" -->
<div id="header">
<p>Envision Moore</p>
<p> Mechanical Engineering and Photography</p>
<p> Scott W. Moore</p>
</div><!-- End div "header". -->
<div id="selectedPhoto">
<div id="Selection" spry:detailregion = "dsphoto dsdata" >
<!-- Selected photographs are 400px tall. -->
<img src="Photo-Email/{name}" width = {width}px height = {height}px align="center" />
<br />
Description<br /><br />
<p> {dsphoto::email/base}{description} </p>
</div>
</div> <!-- End div "selectedPhoto". -->
</div> <!-- End div "wrapper" -->
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
//-->
</script>
</body>
</html>Moore6931 wrote:
Ben
I thank you but the change of the starting location did not correct the problem. I copied your script and pasted it into the source code but the results were the same set of thumbnails; several of the thumbnails are prior to (20)10.
In considering the results, I decided to try,
spry:test="'{name}'.search ('10 ') != -1;"
This filter gave the same result as,
spry:test="'substring({name},4,2)'.search ('10 ') != -1;"
I found out that the "4,2" arguments of substring should be "4,6". Each of these arguments are locations; other substring functions have location and length.
I updated the filter to,
spry:test="'substring({name},4,6)'.search ('10') != -1;"
The filter result was not changed. Are the location arguments being ignored or overwritten by a default setting? The symptom is that the first location is "0" and the second location is omitted.
I thank you for your help. This is rather fascinating!
Scott
Howdy,
When you take a closer look at your at your code you will notice that you actually wrapped the substring function inside a string. So you are actually performing a search on:
'substring(contents,4,6)'
So what i would suggest is to do:
spry:test="'{name}'.substring( 4,6 ).search( '10' ) != -1 "
And if that doesn't work, try to use a function::syntax instead, see API: function::<function name>
Maybe you are looking for
-
Error while applying temporary license on ECC system ?
Hi all, I tried to apply temporary license in my ECC 6.0 system as license was expired and i was not able to login in client 000 with sap* user so i tried for temp license at OS level but it throwed an error, when i used saplicense temp at command pr
-
Can't print to shared printer any more with Tiger
Hello, I upgraded to Tiger from Panther on a powerbook 12". My printers (hp 1700cp and hp 920c) are linked to my G5 dual 2ghz by USB, and shared in the sharing panel. I network the two together by ethernet (via a Farallon Netline broadband gateway ro
-
Is there any way to import dvds/dvd tv seasons onto itunes and ur ipod?
???
-
Predictive typing in JTextField
Hi All I am currently working on A GUI Swing interface. I want to create a textfield that could process predictive typing. For example, I have a vector of strings (allowed words to type in). As soon as the user starts entering some characters into th
-
Hi all, Any reason why the attached code would yield this in a trace? <comments> <mastercomment1/> <mastercomment2/> <mastercomment3/> <mastercomment4/> </comments> Your thoughts are much appreciated... -SyddyS