Thanks Jim and Claudia for the solution. I can now reduce the number of mouse 
clicks for finding out handle and collection details from dspace admin 
interface.

Example

dspace=> select handle,name from handle,collection where handle.resource_id = 
collection.collection_id;

    handle     |        name
---------------+---------------------
 123456789/11  | Chinese 
 123456789/12  | Economics
 123456789/113 | Information Studies

http://pgsqld.active-venture.com/tutorial-join.html

dspace=> \d handle;

                 Table "public.handle"
      Column      |          Type          | Modifiers
------------------+------------------------+-----------
 handle_id        | integer                | not null
 handle           | character varying(256) |
 resource_type_id | integer                |
 resource_id      | integer                |

dspace=> \d collection;

                  Table "public.collection"
         Column         |          Type          | Modifiers
------------------------+------------------------+-----------
 collection_id          | integer                | not null
 name                   | character varying(128) |
 short_description      | character varying(512) |
 introductory_text      | text                   |
 logo_bitstream_id      | integer                |
 template_item_id       | integer                |
 provenance_description | text                   |
 license                | text                   |
 copyright_text         | text                   |
 side_bar_text          | text                   |
 workflow_step_1        | integer                |
 workflow_step_2        | integer                |
 workflow_step_3        | integer                |
 submitter              | integer                |
 admin                  | integer                |



-----Original Message-----
From: Claudia Jürgen [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 11, 2007 7:25 PM
To: Jayan Chirayath Kurian
Subject: Re: [Dspace-tech] collection id and collection name

Hi Jayan,

this will give you the collection_id and the name for a given handle:

select distinct c.collection_id, c.name  from collection c, handle h 
where c.collection_id=(select resource_id from handle where 
handle='123456789/113');

Claudia Jürgen


Jayan Chirayath Kurian schrieb:
> Hi! Mika,
> 
> This gives collection id related with a community. I wish to get in the form  
> "AMIC Conference" for batch import. I believe 123456789/113 is the handle id 
> and "AMIC Conference" is the collection name. any help?
> 
> jayan
> 
> -----Original Message-----
> From: Mika Stenberg [mailto:[EMAIL PROTECTED] 
> Sent: Monday, June 11, 2007 5:05 PM
> To: Jayan Chirayath Kurian
> Cc: [email protected]
> Subject: Re: [Dspace-tech] collection id and collection name
> 
> If I understood you correctly, you can try something like this from the 
> command line:
> 
> su postgres -c "psql dspace -c 'select name, collection_id from 
> collection;'"
> 
> -Mika
> 
>> Hi!
>>
>>  
>>
>> Is there a way to find out collection id and collection name from 
>> postgresql. From dspace-admin we can find this out, but requires 
>> searching for each collection and corresponding id. Is there an easy way 
>> to find this for batch importing?
>>
>>  
>>
>> I searched HANDLE table and COLLECTION table but couldn't succeed.
>>
>>  
>>
>> Thanks,
>>
>> Jayan
>>
>>  
>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> DSpace-tech mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
> 
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to