I need to list all of the tables in a schema in dashDB (Db2 Warehouse on Cloud on IBM Cloud).
Is this possible using just a SQL statement or do I need a CLI tool for this?
If it is possible using a SQL statement, please let me know what it is.
Please DON'T provide the CLI statement.
The following should do:
select tabname from syscat.tables
where tabschema='yourSpecificSchemaName'
Note that information like the above can be found in the Knowledge Center for dashDB in the roadmap to catalog views. The view used above is SYSCAT.TABLES.
Related
I've gotten SQL Developer to be able to connect to my RedShift cluster but I can only see the tables. I can't see any of the views? Does anyone know if that's possible or if I should just be considering a different tool to work with Redshift?
If I use other tools (i.e. Aginity) I can see the views so I know it's not a DB permission thing, it must be a JDBC+SQL-Develop thing.
What tool do you use for RedShift?
Our redshift support is presented for a singular use case: copying/moving your data to the Oracle Autonomous Data Warehouse (ADW)
Can you connect and browse to a redshift instance? Yes. But that's not the desired use case.
I'm new be to DB2/AS400. I know writing sql queries to insert/update in the database but not sure how could i perform same thing in DB2/AS400.Can any body guide me how could i write the sql insert/stored procedure queries in db2 database
STRSQL as suggested previously would work fine but it is a green screen (5250 emulation) option; if you are not familiar with that environment, I would recommend you use the 'Run SQL Script' function from either IBM i Access Client Solutions or IBM i Navigator, whichever is available to you.
On the AS400 command line issue the following command.
STRSQL
Start Here and this is typical IBM documentation. It leaves you guessing why am I here.
Is it possible to get the table structure like db2look from SQL?
Or the only way is from command line? Thus, by wrapping a external stored procedure in C I could call the db2look, but that is not what I am looking for.
Clarification added later:
I want to know which tables have the non logged option from SQL.
It is possible to create the table structure from regular SQL and the public DB2 catalog - however, it is complex and requires some deeper skills.
The metadata is available in the DB2 catalog views in the SYSCAT schema. For a regular table you would first start off by looking into the values in SYSCAT.TABLES and SYSCAT.COLUMNS. From there you would need to branch off to other views depending on what table and column options you are after, whether time-travel tables, special partitioning rules, or many other options are involved.
Serge Rielau published an article on developerWorks called Backup and restore SQL schemas for DB2 Universal Database that provides a set of stored procedures that will do exactly what you're looking for.
The article is quite old (2006) so you may need to put some time in to update the procedures to be able to handle features that were added to DB2 since the date of publication, but the procedures may work for you now and are a nice jumping off point.
I want to connect two database and establish a relationship between them in tableau. One from sql sever and another from Microsoft excel sheet. How to do that?
I have goggled a lot for that but could not get a suitable answer.
You are speaking about Data Blending -
And for connecting cross database data
Cross Database Querying is a Flagship Upgrade to Tableau 10.0
However, you cannot use cross-database joins with these below connection types:
Tableau Server
Firebird
Google Analytics
Microsoft Analysis Services
Microsoft PowerPivot
Odata
Oracle Essbase
Salesforce
SAP BW
Splunk
Teradata OLAP Connector
You just need to connect to each database separately and make sure they have the same column names. When creating a sheet when you switch between datasources you will see a chain on the linked fields.
Do note that this is not properly joined but is just blended data, it would be best to create another table in your sql database for the excel sheet.
Is there a way to query an Information Schema from DB2 and dump the contents(tables - structure only),into another database? I'm looking for a way to create a shell model of a database schema from DB2 into a SQL Server database?
Thanks
You can use db2look to get the table structure (DDL) out of db2.
Once you've got it, however, I'm afraid you'll have to manually replace any db2-specific syntax (datatypes, storage parameters, etc.) with it's corresponding SQL Server syntax.
It doesn't look like Microsoft's Migration Tool works for db2 yet. :(