MySQL INSERT SELECT from PROCEDURE ANALYSE

2013-04-21  Source: Original Site  Category:MySQL  Views:0 

Advertisement

I need to get setup to use MySQL to do some poor-man's data profiling. So, I want to iterate through and run PROCEDURE ANALYSE on a bunch of tables and append the results into a single table. So, I first created a destination table as below.

CREATE TABLE `analysis_table` (
`Field_name` VARCHAR (255),
`Min_value` VARCHAR (255),
`Max_value` VARCHAR (255),
`Min_length` BIGINT (11),
`Max_length` BIGINT (11),
`Empties_or_zeros` BIGINT (11),
`Nulls` BIGINT (11),
`Avg_value_or_avg_length` VARCHAR (255),
`Std` VARCHAR (255),
`Optimal_fieldtype` VARCHAR (3051)
);

then I ran

INSERT INTO analysis_table SELECT * FROM table2scan PROCEDURE ANALYSE(10000, 4000);

and got a rather non-informative:
Error Code : 1221
Incorrect usage of PROCEDURE and non-SELECT

Am I doing something wrong, or can I not use a procedure to feed into an INSERT INTO?

Related articles
  • MySQL INSERT SELECT from PROCEDURE ANALYSE 2013-04-21

    I need to get setup to use MySQL to do some poor-man's data profiling. So, I want to iterate through and run PROCEDURE ANALYSE on a bunch of tables and append the results into a single table. So, I first created a destination table as below. CREATE T

  • MySQL Odd results from PROCEDURE ANALYSE 2013-11-17

    I've just found out about procedure analyse but either I'm reading the docs wrong or it's not working as advertised . . . (I posted this in the Saklia database forum too) In the docs it says, analyse([max_elements,[max_memory]]) max_elements (default

  • MySQL Odd result from PROCEDURE ANAYLSE 2012-03-01

    I've just found out about procedure analyse but either I'm reading the docs wrong or it's not working as advertised . . . (this may be the wrong forum for this of course??) In the docs it says, analyse([max_elements,[max_memory]]) max_elements (defau

  • MySQL Drop table from procedure 2014-01-01

    I can't drop table from procedure. Can anybody help me? The problem is in this procedure: create procedure deletelayer(IN idl int) BEGIN DECLARE tabnam varchar(50); SELECT attribute_table INTO tabnam FROM JanLayer WHERE idLayer=idl; /*read the name o

  • MySQL Insert-select order is not the same as select order 2014-01-28

    There is a usual table: mysql> select * from item; +--------+------------+-----------+---------+-----------+ | ItemID | ItemName | SectionID | ItemTop | ItemOrder | +--------+------------+-----------+---------+-----------+ | 1 | Apple | 2 | 1 | 2

  • MySQL Insert a Stored Procedure Result Into a Temporary Table 2014-07-02

    I have problems inserting the result of a stored procedure into a temporary table, Create Temporary Table T (cdsplanta Integer); Insert into T call sp_tsml_plantas_ConsHijosXCod('concreteras'); Select dsplanta, dsnomrequisito, dsnumarticulo, dsarticu

  • MySQL Inserting Data from different database 2015-02-28

    I'm struggling with an insert statement. I need to insert data for one column in a table and this data comes from a similar column in another table in another database. Lets say, there are 2 database A and B with one table each. A.A1 and B.B1 A1 Colu

  • MySQL INSERT SELECT - how I do that multiple row with 2 fields? 2012-02-19

    I use INSERT SELECT to copy a several parent ID from TABLE1 into a foreign field ID TABLE2.ID_T1 - I use this working statement: $sql = "INSERT INTO table2 (id_t1) SELECT table1.id FROM table1 WHERE field1 IN ('" .implode("', '", $_POST['checkbox'])

  • multiByte characters insertion/selection from oracle database problems 2013-08-02

    i must supoport some character sets which are: Chinese, Hebrew, Japanese, Koean. I have done some researchs and these are the results found: 1- oracle provide NCAHR and NVARCHAR2 types for attributes to be persisted in multibyte characters, 2- we mus

  • MySQL insert/select query 2014-08-18

    I need to do an insert statement into a database but the logic is based on a select query and is pretty complex im selecting from a db with columns attrib1, attrib1value, attrib2, attrib2value, etc out to 50 all values can be null except the key whic

  • MySQL simple select from another server 2015-04-18

    Is there a simple syntax specification for mysql commands to be able to operate on other servers? MSSQL Server does this and while it may not be wise nor efficient in an up and running production environment, it is useful for cleanup tasks and otherw

  • Oracle High PX Deq: Q table Normal time in Insert select from 2015-04-24

    Hi, we are seeing exorbitantly high wait events in Oracle 10.2.0.4 on HP/UX for an insert /* APPEND */ into table 1 select from table2,table3, etc. We tried alter session enable parallel dml after seeing this high wait. The select is a 16 table join

  • MySQL slow select from ndbcluster 2015-05-31

    Please help me: Select from ndbcluster engine takes over 5 min, but from MyISAM - 0.01 sec select graph_templates_item.id, data_template_rrd.id as data_template_rrd_id, data_template_rrd.data_template_id from (graph_templates_item,data_template_rrd)

  • Oracle how to insert values from procedure to table directly? 2013-10-03

    is there any way to insert the the procedure results into table like insert into tbl test_sp('val1','val2','val3'); i am getting error can any one help ma on this?

  • MySQL Insert data from excel files to database table 2014-11-10

    is there any way to Insert data from excel files to database table directly without editing the data in order to avoid the mistakes when editing it ?? there is over 50,000 lines of data in the excels file. So, it really took quite a long time for me

  • MySQL Concurrent Inserts & Selects From Same Table 2015-01-02

    I'm writing a simulation application using MySQL to store the result data and we're running into some severe performance issues. We have a simulation engine written in C++ running multiple (up to 5) concurrent simulations and inserting the results in

  • MySQL sp: select from INFORMATION_SCHEMA => read lock 2012-01-15

    Why the read lock? Isn't this a bug? Script started on Mon Dec 5 11:16:44 2005 $ cat test.sql SELECT version(); DESCRIBE tmp; DELIMITER // CREATE PROCEDURE addcolumn_ifnx () BEGIN IF NOT EXISTS( SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE (TABLE_N

  • insert/select from same php page 2013-04-14

    Greetings all, I was wondering (and I suspect I already know the answer) if it's possible to insert data into a mysql table and select that same data from within the same php page.

  • mysql insert/select question 2013-10-15

    I'm inserting a row into a MYSQL table that already exsists. I'm wondering if it's possible to return the unique id of the new row with one statement. For example instead of saying: "INSERT INTO table (first_name, last_name) values ('$name[0]', '$nam

  • MySQL INSERT items from one table into multiple tables 2015-02-13

    OK this is the scenario.. I have a "raw data" table which contains a list of products, their prices, descriptions, stock, category etc I want to take this data, and update the tables used by my online store (uses ZenCart) every day, refreshing things