You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Yang Sun <ae...@gmail.com> on 2006/04/29 17:12:37 UTC

What is sqldb.map?

Hi,

I am a new user for Torque. It is really a great tool.

Now, my task is to transfer a database on postgresql to mysql. And my plan
is to:
1) dump the database structure with "ant jdbc" task.
2) dump the datadtd with "ant datadtd" task.
3) dump the data in the database with "ant dumpdata" task.
4) create the sql ddl for mysql database with "ant create-db" task.
5) create the sql file for inserting the existing data with "ant datasql"
task.

It works well for the first 3 tasks. But for step 4 and step 5. I met
problems.

For step 4, it creates a sql file called create-db.sql. But it only contains
two statements.
/-----------------------------------------
drop database if exists postgres;
create database postgres;
------------------------------------------/
I have not naming the new database postgres. I do not know where the
database name "postgres" comes out. Could you give me some information on
this issue?

The other issue is for step 5. When I run "ant create-db", it always
complain that the application cannot find the "sqldb.map". Could you tell me
what the usage of that file and how to create it?

Thanks for your kind help.
Yang Sun

Re: What is sqldb.map?

Posted by Thomas Fischer <tf...@apache.org>.

On Sat, 29 Apr 2006, Yang Sun wrote:

> Hi,
>
> I am a new user for Torque. It is really a great tool.
>
> Now, my task is to transfer a database on postgresql to mysql. And my plan
> is to:
> 1) dump the database structure with "ant jdbc" task.
> 2) dump the datadtd with "ant datadtd" task.
> 3) dump the data in the database with "ant dumpdata" task.
> 4) create the sql ddl for mysql database with "ant create-db" task.
> 5) create the sql file for inserting the existing data with "ant datasql"
> task.
>

"ant create-db" is the wrong task for 4). Use "ant sql" instead.

> It works well for the first 3 tasks. But for step 4 and step 5. I met
> problems.
>
> For step 4, it creates a sql file called create-db.sql. But it only contains
> two statements.
> /-----------------------------------------
> drop database if exists postgres;
> create database postgres;
> ------------------------------------------/
> I have not naming the new database postgres. I do not know where the
> database name "postgres" comes out. Could you give me some information on
> this issue?
>

it probably comes either from your schema.xml file (attribute "name" of 
element "database"), or (less likely) from your build.properties file.

> The other issue is for step 5. When I run "ant create-db", it always
> complain that the application cannot find the "sqldb.map". Could you tell me
> what the usage of that file and how to create it?
>

It is a map filename -> database name. If you run "ant sql" it is 
automatically created for the generated sql files. I thought it would be 
the same for "ant datasql", but I have no experience there. Maybe you can 
generate the file manually and give its location to the ant task (read 
the build-torque file on how to do that).

    Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org