The database name usually is part of the DB URL in your DB alias definition…possibly at the end with a “:DBNAME”…I am not sure of the exact syntax…It depends on the driver you are using…
On a separate but related note: I would NOT recommend using the “Insert” service…The performance is VERY bad…Every time it is invoked, it issues a separate query to the DB to read the table schema before executing the insert…The same is true for the other DB ops except for “execSQL”…
So if you care about performance you should always use “execSQL”…
Floyd, if you are having trouble connecting to the database, make sure that you have provided the proper database connection properties. Have you successfully tested your alias using the Administrator?
Tony, does every WmDB service (except pub.db:execSQL) read the table schema before executing or just the pub.db:insert service?
Thanks for your response.
Dan, yes, I had tested my DB Alias with Server Administrator, and it worked.
I try to insert rows over 60 columns, it is not convenient to use the exeSQL service.
Tony, Can I execute sql statement in different database with the same DB Alias?
If you are using the TYPE IV MS driver, then port 1433 is correct. If you are using Sequelink or other client/server DB driver, then you may want to look at it again. Sequelink is 19996.
In the WmDB interface that is accessible through the Admin console, you should be able to connect and obtain a list of tables. Then, you can run your sql statement against the specific table/tables through the web interface. If you cannot see the tables, check to make sure that the db user has permission.
If you cannot connect at all to the db, then start there.
Those parameters you mention for “insert” are all optional…If the “execSQL” works then the “insert” should work as well with just the $dbAlias and $dbTable inputs…
Dan,
I believe they all do…
It has been awhile since I looked at this (IS 4.6 version)…
In this case,
I can use a SQL statement such as
“insert into Northwind.dbo.table1 (col1) values (?)”
in a “exeSQL” service, which can point out which database (ex. Northwind) i want to insert.
But I don’t know how to (or I cannot) set the database name in “insert” service. Can you give me a simple example to show how to setup the database name? Thanks a lot!