Error:table exists in the database - sybase-ase

why is it that using exec() in SYBASE ASE while dropping a table if it exists eliminates the Error:Table exists in the database. Why this error doesn't appear in Sybase IQ.

Because Sybase/SAP ASE and Sybase/SAP IQ are completely different products. What works in one does not have to work in the other. You might as well ask why a statement in PL/SQL works in Oracle but does not work in MySQL.

Related

Is it okay to delete the standard pre-made databases in phpMyAdmin? [duplicate]

Ok this is more of a 'Keeping my house in order' question.
PHPmyAdmin is installed but it has a bunch of databases installed as default.
•cdcol (1)
•information_schema (37)
•mysql (24)
•performance_schema (17)
•phpmyadmin (8)
•test
•webauth (1)
I recently deleted a bunch of these but after that I had lots of issues accessing PHPmyAdmin and had to re-install. Anyway long story short can I happily delete these without effecting my system?
Not all of those listed databases are phpMyAdmin related. Some are required for MySQL to operate normally.
performance_schema http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
information_schema http://dev.mysql.com/doc/refman/5.5/en/information-schema.html
test http://dev.mysql.com/doc/refman/5.0/en/database-use.html
mysql http://dev.mysql.com/doc/refman/5.5/en//adding-users.html
cdcol Probably is for the cd collection sample database that comes with XAMPP. webauth is probably part of XAMPP as well.
The only phpMyAdmin related database (as you probably already guessed) is phpmyadmin, you can delete it, but letting it be there would improve performance, and add more functionality to the phpMyAdmin.
Delete the cdcol database; it is just a sample. For the other tables you mentioned, hide them from view by adding the following to config.inc.php.
$cfg['Servers'][$i]['hide_db']='^(information_schema|performance_schema|mysql|phpmyadmin|test|webauth)$';

Add mysql schema to MySQL Workbench?

If this is a super basic question I apologize; I'm still trying to grok MySQL and my options on interfacing with it.
I'm wondering if I'm able to add the mysql schema to MySQL Workbench? I can see and access it via PhpMyAdmin and the command line. I'm also able to query a mysql table (user, for example) from Workbench itself.
I'm mostly just curious if I can add it to the schema section in the lower left hand side of Workbench. I'm using version 6.3.
Thanks for your time and suggestions!
Edit: To better clarify, I'm just wondering if I can view the schema in Workbench like I can in PhpMyAdmin.
MySQL Workbench by default hides system tables (that is PERFORMANCE_SCHEMA, INFORMATION_SCHEMA and mysql). In the preferences (SQL Editor -> Show Metadata and Internal Schemas) you can enable them. After a restart of Workbench you will get them in the schema tree.
You can not have phpmyadmin and workbench synchronized. What you could do is to work on a site, and then export the schema

How to get recommendations for indexes in ASE?

I'm trying to optimize few queries that our application dynamically generates.
So far I'm using:
set option show_missing_stats on
However the setting only mentions missing statistics. Both MSSQL and Oracle give recommendations in terms of which indexes should be created to optimize query. Is there anything like that in Sybase ASE?
Sybase ASE unfortunately hasn't got a tool for indexes recommendation. As you said there is only show_missing_stats on Sybase ASE 15+.

Restoring MYSQL User Accounts to new Database

I am currently trying to combine two MYSQL Database installations into a single installation. I have already used a batch script to export each individual database to SQL files so they can be imported into the MYSQL that is being kept.
The problem is each individual database has a unique user assigned to it which also needs to be brought over. When doing this in the past, I imported the "mysql" database along with the result, and this caused corruption.
What is the best way to export ONLY the users from the "mysql" database and import them into a a different MySQL instance?
Use the --no-create-info option to mysqldump to keep it from dropping the old table on the target server.
If you have any overlap in the usernames on the two installations, use the --ignore option so that they will be ignored when merging.
So the command is:
mysqldump --no-create-info --ignore mysql user > user.sql
IF you are USING SQL yog then,
go to the TABLE which you need to export to other host/database
right click on the TABLE
SELECT copy TABLE TO different HOST/Database
Hope it is helpful

Porting stored procedures between MySQL servers

I have inherited a web-application project (PHP/MySQL) which makes extensive use of stored procedures, and I am unsure how to transfer these to my local machine for development.
Specifically, it is the exporting and importing of these stored procedures that I am facing difficulty with (with the ultimate aim of being able to automate installation of a "base" version of the application database, complete with stored procedures).
I shall state the bits and pieces that I believe I understand:
I can export the information_schema.ROUTINES table, but cannot import it (phpMyAdmin) onto my local server (I believe that information_schema is a system database?)
As I do not have shell/command-line access to the "online" MySQL servers, tools such as mysqldump are only of very limited use (to port to my local testing machine, but not vice versa)
The command SHOW CREATE PROCEDURE procedure_name; is supposed to output SQL that can be used to create the procedure, but I can't seem to get this functioning correctly (ERROR 1305 (42000): PROCEDURE delAddress does not exist)
Assuming that the the above works, the next step is to have it be looped to export all stored procedures (..and then be run via phpMyAdmin elsewhere, to import it)
Please correct anything that is incorrect, and provide guidance on how to automate porting between database servers.
Many thanks
Use MySQL Workbench's migration feature. The whole thing is free and it does an amazing job.
Turns out the solution was ridiculously simple.
On the export page, there is an Add CREATE PROCEDURE / FUNCTION / EVENT statement option.
By checking this box, it also exports the SQL necessary to import procedures at a later date/on another server.

Resources