Hi Marvin,

The code is at [dspace-src]\dspace-api\src\main\java\org\dspace\handle, and the 
queries are:

sql = "update handle set handle = '" + newH + "' || '/' || handle_id " +
                      "where handle like '" + oldH + "/%'";

sql = "UPDATE metadatavalue SET text_value= (SELECT 'http://hdl.handle.net/' || 
" +
                      "handle FROM handle WHERE handle.resource_id=item_id AND 
" +
                      "handle.resource_type_id=2) WHERE  text_value LIKE 
'http://hdl.handle.net/%';";

I can probably give a more straightforward SQL statement for each, if it would 
be useful.  

B--

>>> On 4/15/2011 at 1:28 PM, in message <[email protected]>, Marvin 
>>> Weaver
<[email protected]> wrote:
> Running dspace 1.6.2 on Oracle11/Solaris10
> We got a handle from CNRI and I tried: /dspace/bin/update-handle-prefix 
> 123456789 10825
> and got:
> If you continue, all handles in your repository with prefix 123456789
> 
> will be updated to have handle prefix 10825
> 
> 11545 items will be updated.
> 
> Have you taken a backup, and are you ready to continue? [y/n]: y
> Updating handle table... 11545 items updated
> Updating metadatavalues table... Exception: ORA-00911: invalid character
> 
> java.sql.SQLException: ORA-00911: invalid character
> 
>          at 
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
>          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
>          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
>          at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
>          at 
> oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216
> )
>          at 
> oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.j
> ava:955)
>          at 
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:
> 1168)
>          at 
> oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStat
> ement.java:3316)
>          at 
> oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatem
> ent.java:3400)
>          at 
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingP
> reparedStatement.java:102)
>          at 
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingP
> reparedStatement.java:102)
>          at 
> org.dspace.storage.rdbms.DatabaseManager.updateQuery(DatabaseManager.java:460
> )
>          at 
> org.dspace.handle.UpdateHandlePrefix.main(UpdateHandlePrefix.java:95)
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>          at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>          at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
> java:25)
>          at java.lang.reflect.Method.invoke(Method.java:597)
>          at 
> org.dspace.app.launcher.ScriptLauncher.main(ScriptLauncher.java:212)
> -bash-3.00$
> I'm guessing it is either unhappy with quotes (single or double somewhere) 
> or / in handles or http://hdl/handle.net/12345678/xx in metadata values. It 
> did not update the handles in the table Handle.
> Does anyone know where the code is? or where all handles are used in tables 
> so I can write my own sql*plus?
> I searched a number of what seemed relevant jars in /dspace/lib.  It would 
> be nice if it told me what the invalid character was...
> 
> Marvin
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Benefiting from Server Virtualization: Beyond Initial Workload 
> Consolidation -- Increasing the use of server virtualization is a top
> priority.Virtualization can reduce costs, simplify management, and improve 
> application availability and disaster protection. Learn more about boosting 
> the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev 
> _______________________________________________
> DSpace-tech mailing list
> [email protected] 
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to