I am very new to Db2 and also VBA to an extent. Could somebody help me out with below request.
I request somebody to help me with a sample code.... Say I have a table in db2...
Name and Employee Id
Now I have the details in Excel.... Say in sheet1.. Column A is Name and Column B is Emp ID
I require a code with which I can make a connection to my database and push the data to my tables in db2....(Probably with some explanation like code breakdown # important palces)
Please help me with this request.. Thousand thanks in advance....
I have done this before without any code using a simple process:
Create a new database in Microsoft Access.
Import the Excel spreadsheet into a new table in the new Access database.
Set up an ODBC datasource that points to the DB2 database you want to import into.
Use the ODBC connection from Access to export the table into DB2.
Related
I would like to export all the data from a database to a new one with SQL Server Manager studio.
I used import and export assistant (taks -> export data) but after the import when I try to save new data
I have insertion error due to identity column error when I try to insert data:
com.microsoft.sqlserver.jdbc.SQLServerException: Unable to insert null value in column 'id'
Although I specified to keep identity insert before the export.
I would like to export data in a new database with all the Identities column constraints.
If you want to move all data completely from a database. Task->Export is one Option(since the issue which you face is not clear) you can try other option to take backup(.bak file) and restore it to the new database.
Thank you for your help, the problem wasn't clear.
I actually needed to export an azure database to a SQL server database.
I used another export process : microsoft.github.io/AzureTipsAndTricks/blog/tip140.html and now the exported local database is working
I am new to this forum and already searched for 45 minutes to find a solution for my problem. I hope you can help me.
A Gateway to a remote Microsoft SQL Database was installed on a Oracle Server (Oracle 12c). The tsnnames.ora file was appropiately set up.
For the connection, I created a database link (In the Oracle DB) as follows:
CREATE DATABASE LINK TEL CONNECT TO "fb_B2C" IDENTIFIED BY "passwort" USING 'dg1msql';
When I now execute the Select statement:
SELECT "name" FROM "sys"."databases"#TEL
it shows me the according databases. Among others, I can see the AB_Colors database.
Now, I want to select a view in the AB_Colors database.
Due to the fact I can connect to this database via Excel, I know that in the database AB_Colors, there are 10 Views(A,B,C,..). I would like to select the View C from the database AB_Colors via the DB LInk.
Owner of the View is b2b.
How do i need to formulate the select statement to do it?
I already tried different writings:
SELECT * FROM b2b.C#TEL;
SELECT * FROM "AB_colors"."b2b"."C"#TEL;
SELECT * FROM [AB_Colors].[b2b].[C]#TEL;
The common error message is: View/Table does not exist
I highly appreciate your help,
Fedja
This is the correct format
SELECT * FROM "b2b"."C"#TEL;
The issue maybe because the database you want to select from is not the one specified in the gateway for dg1msql. You can't add the database name to the query so you must specify it in the gateway connection.
This is defined in
$ORACLE_HOME/dg4msql/admin/initdg4msql.ora
where you should check HS_FDS_CONNECT_INFO
I need to do a select on a number in Database A.Table A and also check if this Number exists in Database B.Table A
So far I have tried
select ID from Table A where ID in (select ID from UN/PW#//host:1521/SID.Table A)
I have no idea if this is the correct syntax.
I am currently writing this in Oracle Developer and then adding it to my perl code using DBI and DBD Oracle.
Help appreciated thanks.
Solved using CREATE DATABASE LINK
Open two separates DB connection which will point you to two different databases, then use first connection to obtain value from database A and second connection from database B, at the end compare what you got in PERL. In order to be able to query two different databases in a one query you need to use db link. Check this tutorial: http://docs.oracle.com/cd/B28359_01/server.111/b28324/tdpii_distdbs.htm#BABJDEED
I am working on Asp.net MVC 3 project, I need change the database name for the project I tried changing the database name in connection string & What happens is that when I pull the data it pulls from new DB where as when I try to insert data in some table it tries to insert in the old db. I am sure from where it is getting reference to the old DB name. Please HELP.
There must be a different connection string for the inserts. You should make a search in the entier solution after the database name or parts of the connection string to find that connection string and modify it too.
I have an application that uses an access 2000 database currently in distribution.
I need to update one of the recordsets with additional fields on my customer's computers.
My data controls work fine as I have them set to connect in access 2000 format. But, when I try to open the database in code, I get an unrecognized data format error.
What is the best way to replace or add to the database on their machines?
It is possible to update an Access database using VBScript, ADO and DDL.
strCon="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Example.mdb;" _
& "Jet OLEDB:Database Password=pass;"
Set cn=CreateObject("ADODB.Connection")
cn.Open strCon
strSQL="ALTER TABLE Example ADD COLUMN Example Text (20)"
cn.Execute strSQL
More connections strings: www.connectionstrings.com
I much prefer using DAO collections to updating BE database schemas as it gives you much more control over what you can do. For example you can easily delete or create tables, records, indexes and relationships. See the TempTables.MDB page at my website which illustrates how to use a temporary MDB in your app and has sample code to get you started.