Do Ingres and Vectorwise Databases support functionality similar to TRUNCATE table in SQL Server? If so, what is the syntax? - sql

Trying to find if there is something similar to TRUNCATE TABLE in these 2 database systems.

MODIFY mytable TO TRUNCATED
is the equivalent SQL for Ingres/Vector/ActianX

Related

Can I change postgresql data structure?

I've just been studying DBMS. There are a lot of programs for DB. (eg. Mysql, MariaDB etc..)
So I wonder in program, for example Postgresql, can I change data structure each table?
Most of programs are using B-tree, however I hope change data structure each table if I can.
Are you asking if you can change the table structure like adding or removing columns, altering the data type of a column, if yes, then it is possible.
Refer here for postgresql syntax
Refer here for SQL Server/MS SQL syntax
Refer here for MySQL syntax

How use sql in Teradata with Aster database?

Currenly I use Teradata Studio, and I want to use table in Aster, it's possible to create dblinks or other configuration to call tables from Aster database to Teradata database into Teradata Studio?.
Thanks.
In Aster you will be having a SQL-MR function name load_to_teradata you can use it to load tables from aster to teradatadb

How to capture truncate statement information in SQL Server 2012

I would like to capture the truncate statements information along with the user/Login information for all database in my production server.
Example:
Use mydb
go
truncate table deleteme_table
I would like to capture the information into the table like the below
Table Operation Database Login Time
deleteme_table Truncate mydb sandeep.pulikonda 17-12-2014 17:50:00
If the above scenario is not possible please suggest possible ways to capture it
I am using SQL Server 2012 Standard version. So granular level audit are not supported for that version.
you can use the SQL Server Audit functionality and add an audit for those queries.
this article explains in detail how to obtain this.
Another good way of profiling your SQL Server is using SQL Profiler. Here is a SO question similar to yours and an answer describing how to use SQL Profiler to achieve the results.
SQL Server Profiler - How to filter trace to only display TSQL containing a DELETE statement?

generate database & tables schema (ddl) on Oracle pl-sql

Anyone have a PL-SQL statement that i can use to generate database & tables schema for specific database on Oracle 10g? I need the schema in .sql file and if possible compatible with ANSI-92/99 sql implementation, so i can use the generated .sql directly on sql server 2005.
Already heard about exp/imp, but it seems generated dump file, what i need just a simple ddl on .sql file.
Thanks
You could try:
select dbms_metadata.get_ddl('TABLE',table_name,owner)
from dba_tables where owner='schema name';
It returns longs, so you may want to play with the long buffer.
More about dbms_metadata here: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm
If you just need to dump your schema, this free package does a very nice job. We use it in daily production.
http://sourceforge.net/projects/cx-oracletools
If you need to convert from Oracle to SQL Server, this software might do a better job. We've used it to convert between Oracle, MySql, and Postgreqsql.
http://www.spectralcore.com/fullconvert
I wrote oraddlscript which calls dbms_metadata.get_ddl (Pop's answer) for each database object owned by a user and writes the DDL to a file.
Update: Answered comment
Greetings, I'd recomend using Oracle SQL Developer Data Modeler since it's from Oracle, it can read the DDL information directly from the Data Dictionary. It creates an ERD and then you can produce DDL for SQL Server 2000/2005, some versions of DB2 and Oracle 9i/10g/11g.

sql select thru multiple postgres databases

is there a way to create a select statement that would retrieve data from multiple database in postgre?
i was thinking it would be something like this:
select * from dbname1.table1, dbname2.table2 where dbname1.table1.column1 = dbname2.table2.column1
Have a look at the "dblink" contrib module.
OTOH it's possible that you treat the databases in a PostgreSQL cluster as equivalent to the databases in... let's say MySQL. Which is incorrect - the PostgreSQL databases contain schemas and those are the equivalent of the databases in MySQL.
From here:
It is not possible to access more than
one database per connection.
Update: but see Milen's answer.