Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Why Dont Shared Hosting Accounts Provide Stored Procedures And Triggers?


i am searching for 3 days now for a reliable, fast hosting company, which supports stored procedures and triggers on mysql5. most of them dont support this, because mysql5 has a design-flaw in which it stores procedures and triggers on a root level-area (tables mysql information_schema). due this logic, most of the hosting companies wont allow you to create/run procedures and triggers. funny, that hosting companies forbid you to use new technologies and methods to build faster.




View Complete Forum Thread with Replies

Related Forum Messages:
Mysql And Triggers/stored Procedures
I have a question regarding the use of triggers. I have difficulties implementing trigger that let's say reacts before/after select statement (select of user), and increments the counter value (of the selected user). Is there a way to achieve this through triggers, or it's not possible?

View Replies !
Socket Programming With Stored Procedures/triggers
I'm currently working on a project where we may need publish/subscribe functionality (ie. a client registers an interest in a certain event, and the server will publish an update notice to the client when that event occurs).
One way I was thinking of doing this is to create an AFTER INSERT trigger on the table in question and get it to somehow notify either the middleware (a daemon running on localhost) or the client (a standalone java app running on a remote machine) that a change has occurred. To do this I'd most likely need to write to a socket from within the trigger or stored procedure.

Does anyone know if this is possible? I've had a brief look in the MySQL documentation and nothing seems to jump out at me.

View Replies !
Can Arrays Be Used In Stored Procedures And Triggers In Mysql?
I was trying to use arrays in stored procedures but it resulted in syntax errors.Is there any way to use arrays in stored procedures.

I have one more question,in triggers if we want to check each column of a table if updated ,is there any way that i can write then in a loop.

In the example given below I tried to check change for each column in a table.If there are 10 columns then I have to wirte 10 if statements.
Is there any way that I list all the columns of the given table with in a trigger and write loop that contain a if statement that works for all the columns.

create trigger updata after update on dataid_list for each row
BEGIN
if NEW.databaseid <>OLD.databaseid
then insert into view_changes
SET old=OLD.databaseid,new=NEW.databaseid, operation='UPDATE',column_name='databaseid'
end if;
if NEW.databasename <>OLD.databasename
then insert into view_changes
set old=OLD.databasename,new=NEW.databasename, operation='UPDATE',column_name='databasename'
end if;
END;

View Replies !
Exporting MySQL Database Including Stored Procedures And Triggers
How do I export a mysql database including all related triggers and stored procedures?

I want to make a copy of the entire thing into a new database for testing.

View Replies !
How Often Is Best To Create New Database, Migrate Data With Shared Hosting?
I have got a web site that I have ben working on since March, 2007. It is a news reporting web site. It is replacing an older web site.

I created a new database (it uses the MySQL database) last March when I started working on the new web site. I have migrated all of the news content from the old web site database to the new web site database.

I have a shared web hosting. It's my understanding that the hosting service provider fills up one server with databases then starts a new server with databases.

For example, the IP for the server that is hosting the current database for the new web site is 10.6.166.5

I just created a new database (the hosting allows you to have ten databases per shared hosting). The IP for the server for the recently created database for the new web site hosting is 10.6.166.92

If the servers are ordered sequentially there have been 87 new servers filled up with databases since last March (i.e. 10.6.166.92 recently created IP minus 10.6.166.5 March, 2007 IP equals 87 servers).

The problem with migrating the nine-month old database to the new database is that I have got over a thousand news stories and two thousand pictures stored in the database with the 10.6.166.5 IP address. I would have to copy and paste all of the data into the phpMyAdmin program or write a PHP script that would automate the process.

Is there any benefit to migrating the 10.6.166.5 March, 2007 IP database over to the more recently created 10.6.166.92 IP database? Would it be reasonable to expect the more recently created database to perform better over the next 12 to 18 months than the one created nine months ago?

View Replies !
Dont Start If The User Dont Have Administrator Privileges On The PC
I instaled MySQL in a computer (with widows XP) that not always is loged with a user withthe computer administrator privileges.

when a person whitout administrator privileges is the first person that
logs, the DataBase dont startup until an administrator logs on. What can i do to allways startup the DB without care the computer's administrator privileges?

View Replies !
Triggers Or Stored Functions
I am developing a membership system wherein every year, the status of all registered members would be changed to something else. I want this function to execute automatically. I think this has something to do with triggers but I can't find a tutorial that can clearly explain how to do it.

View Replies !
Stored Procedures V 5.0.18?
Is there an issue with stored procedure and mySQL v5.0.18 ?

We are programming an application that need stored procedures and triggers and our programmer can't make them work, is it a know issue or our programmer missed something?

View Replies !
IDE For Stored Procedures
I am trying to create stored procedures in MySQL. Does anyone have a
suggestion on a good IDE to use.

I have been working with the MySQL
Query Browser but it generates errors very often and is shut down by
Windows.

When I make changes to my procedure, it doesn't seem to
always change what is being executed. Furthermore, sometimes the
procedure just disappears from my database. I am starting to think
that the stored procedure language in MySQL is just not reliable. Am I
wrong on this?

View Replies !
C Api And Stored Procedures
i've been looking into using stored proecdures, and have got some up and running correctly from the command line,
i need to use them from within a c program using the c api.
i have the c api set up correctly, and connect to the db and can run queries fine.
but if i change my query to calling a stored procedure it doesn't work:

"mysql_real_query( mysql, query, strlen(query) )",
query = "CALL myStoredProc(21);"

can the c api even call a stored proc? i thought this would be okay as running a query is running a mysql query, and i assume this will execute any mysql statement.
however my stored proc ALWAYS returns 0 rows affected.
the help docs have something called prepared statements - though i think these are different from precompiled stored procs.

View Replies !
Stored Procedures In PHP
How can I call a stored procedure in PHP? I did it like this but it doesn't work.

@mysql_connect('lhost','user','pass')
or die("ERROR: Unbale to connect to MySQL.");
@mysql_select_db("asterisk");

$result = mysql_query("CALL select_all_vicidial_list()");
$num = mysql_num_rows($result);

View Replies !
No Stored Procedures
it looks like there's no support for stored procedures in 4 and lower versions of MySql... so when using the .NET connection to insert data into a table, I have to send some kind of command text insert statement??? is that the only way or is there another way to do this?

View Replies !
Stored Procedures Possible?
Does MySQL Support any type of Stored Procedures? I have a script that I want to run so often.

View Replies !
GUI For Stored Procedures In MySQL?
I have a website that is using MS SQL Server 2000 with ASP scripting. I want
to switch over to MySQL, but I'm just sticking my toes in the water at the
moment to see if it makes sense.

One of my favorites things about MS SQL is being able to use the Enterprise
Manager as a GUI in constructing VIEWS that I later turn into stored
procedures. EM makes it super simple to link tables and create a query. It
basically writes the source code for you as you go and you can test run it
interactively until you get the results you want. I then take the resultant
source code and paste it into a stored procedure, which in turn is called by
my website script. This allows a relative novice like me to manage a
somewhat complex database structure.

My question is: does the MySQL GUI allow for the management of stored
procedures in a similar manner? Can I create a view and just "cut-and-paste"
the source into a dialog box that will then create the stored procedure for
me? Does MySQL allow for the visual management of stored procedures within
its GUI?

View Replies !
Debugging Stored Procedures
Does there exist any debugger for the stored procedures in MySQL 5? If not is there some documentation of how debugging tips in general?

View Replies !
Extended Stored Procedures
Does MySQL have support for calling functions in C/C++ DLLs from trigger
scripts similar to the Extended Stored Procedures functionality provided in
SQL Sever?

View Replies !
MySQL 5 Stored Procedures
I've recently downloaded the Windows mySQL 5 binaries. Is there any GUI that
supports the creation of Stored procedures? I'm using mySQLcc 0.9.3 and this doesn't seem to like them (from a SQL window) unless there is a trick that I'm missing.

View Replies !
Dynamic Sql In Stored Procedures?
Is there a way to do this in mysql 5.0? in mssql they have the EXEC function for this purpose.

View Replies !
How To Write Stored Procedures?
1. i want to write a stored procedure using mysql 5.0.45 version.

2. when i tried with the following code ,i am unable to write ...

View Replies !
Creating Stored Procedures
I need information on "Creating Stored Procedures in MySql 5".
Like how it is created and accessed throught PHP....
To begin with lets take database table as "student" with columns

roll int(10) primary key + auto increment
name varchar(255)
address text

View Replies !
Export Stored Procedures
How can I export my stored procedures? I couldn't find anything in the documentation or on Google.

View Replies !
Stored Procedures Efficiency
We have a function that generates a large set of data based on certain business logic. Curretly this business logic is handle by php. A very complex php page is written to fetch data from mysql when client browser initiates the process, do the necessary calculations and then write to a new table and then display the output of that table on client browser. Whenw e ar edealing with about 250,000 records and between the time that user initiates the process and see the final result, there is along delay. I am juts wondering if PHP is the best application to use business logic in this type of scenario of is anyone things using mysql stored poceudures may help to handle the business logic.

My questions about mysql SPs:

1. Dooes anyone thing it provides more speed and efficiency over our current method.
2. Is it reliable o use SP in Mysql 5?
3. Why people use SP typically?

View Replies !
Run Stored Procedures As Root?
I want to run procedures but i am not able to run it with normal users, i need root access, i can run them without root?

Here is the error i am getting:

Warning: mysqli::mysqli() [function.mysqli-mysqli'>function.mysqli-mysqli]: (28000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /home/cmela/public_html/database/connections.php on line 4
Error connecting MySQL: Access denied for user 'root'@'localhost' (using password: YES)

I need to know can i run procedures without root?

View Replies !
Version Stored Procedures
while calling stored procedures from VB, it displays as

you have error in sql syntax..............near'{call spallocatedock1(61754444,",",1.00000000000000," )}at line 1

will odbc 3.51.12 support stored procedures with output parameters.

View Replies !
Stored Procedures And Source
I'm trying to script a stored procedure using a .sql file. Having no problems writing the same thing from the command line but I need to have all sp's under source control.

This is the syntax in the file I'm using:

USE db_1;

DROP PROCEDURE IF EXISTS test;

CREATE PROCEDURE test()
BEGIN
SELECT * FROM note;
END

View Replies !
STORED Procedures And FUNCTION
CREATE OR REPLACE FUNCTION zap_firm(p_id_firm IN INTEGER) RETURNS INTEGER IS
BEGIN
DECLARE v_zaplacono NUMBER;
FOR cur_fakt IN
(SELECT id_fakt FROM Faktury WHERE id_firm = p_id_firm)
LOOP
FOR cur_wpl IN
(SELECT * FROM Wplaty WHERE id_wplaty = cur_fakt.id_fakt)
LOOP
v_zaplacono = v_zaplacono + cur_wpl.kwota;
END LOOP;

END LOOP;
END;

View Replies !
Stored Procedures Versions?
1) Does the My SQL version numbers vary with operating systems (I mean does the MySQL 5.0 supports same features on linux and Windows)?

2)Do any version MySQL support the "Stored Procedures" on Redhat linux ver 9?

View Replies !
Stepping Through Stored Procedures
I have been working with stored procedures and would very much like to "step" through them, much as you can in the VBA module in microsoft Access.

It looks like there is functionality built into MySQL Query Browser but I cannot for the life of me work out how to create break points anywhere other than the beginning of my stored procedures.

I've tried using begin / end blocks but to no avail, not discounting the fact that I am doing something wrong with them.

View Replies !
Stored Procedures Result Set
Simple question, however I don't find answers anywhere, neither the reference.

I have a stored procedure that works fine, it's called from a script and returns a dataset with, for example, 100 rows.

Procedure is called, result set is returned, and from now on, ¿how can I access these rows from the same script?

I miss something like:

-- Sorry about this heresy!
SELECT OneColumn from (CALL MyProcedure())

View Replies !
Stored Procedures &amp; Transactions
I wonder whether it is possible to use transactions like this:

CREATE PROCEDURE testproc

BEGIN
START TRANSACTION;
CALL another_proc();
COMMIT;

END;

Or is there anything I need to take care of?

The reason I am asking is, I have a project with lots of SPs and I need to add transactions now.

View Replies !
Example Scripts For Stored Procedures?
I was wondering if there are somewhere example scripts available that make heavy use of stored procedures / triggers (InnoDB)?

It's easier to learn from examples than reading a book that will take forever to finish.

View Replies !
Transactions In Stored Procedures
I am handling transactions in stored procedures. Now, if due to some error in the middle of the stored procedure, control comes out of the stored procedure. But, my transaction that was started in the beginning of the procedure has not ended. Therefore, it is going to effect my application. Please tell me what should be done.

Whether some error handling is the solution just like in java, .net languages.

Or what else?

View Replies !
Alternative To Stored Procedures?
I would like to experiment with procedures, but in my shared hosting service I don't have write access to 'mysql.proc'.

Is there any alternative that I can use that doesn't require super user privileges? I'm just experimenting with "advanced features" right now, just to experiment. I wish I could make a BEGIN-END block outside a procedure, but apparently I can't. Ditto for DECLARE, WHILE and all the neat things that make procedures special.

View Replies !
Stored Procedures In MySql 4.17?
Am I correct in assuming that stored procedures are implemented in version 4.17 of Mysql?
If so, how come I don't see the proc table?

View Replies !
PHP5 And Stored Procedures
Not sure if this is the right forum as it's partly a PHP question. I have set up the mysqli extension and created all the correct permissions in the database.

The problem is that I have several queries on the page, only one of which is a stored procedure (the first one). As soon as I run the SP the other normal queries fail, with no error message. If i change back from the SP and replace it with a straight query everything works.

View Replies !
Stored Procedures In A Client
Does anyone know if you can gain access to OUT variables in a client application when calling a stored procedure through the C API. I could just use SELECT to pass the results of my query back and then use binding to get these, but I would love to use the OUT variables.

View Replies !
Variables In Stored Procedures
I need a stored procedure to accept a table name as an argument and create the table if it doesn't exist. When I use the following syntax the table created is named "TableName", not the value of the variable TableName. How do I do this?

CREATE DEFINER=`root`@`localhost` PROCEDURE `MakeTable`(TableName varchar(16))
BEGIN
CREATE TABLE IF NOT EXISTS TableName(FirstRow varchar(16));
END

View Replies !
How Many Stored Procedures In A Database?
i'm using MySql 5.0 and i wanna know how many Stored Procedures can i add to my DataBase, because until now only can create 2 SP. When i wanna create the third SP, it always delete SP created previously.

View Replies !
Building Stored Procedures?
Does any 1 know of a good webiste/tutorial (for beginners) on building stored procedures......

View Replies !
MySQL Stored Procedures With PHP
Is there any way to call a MySQL Stored Procedure or Function from PHP script?

View Replies !
Understanding Stored Procedures
I've never used stored procedures and need to understand what they are exactly. I want to know if a stored procedure can do this:

Looking at the picture above, is the stored procedure table placed in the database? I'd like a way to access the average ratings fast without bogging down my server. For instance, if the averaged ratings table is updated once an hour even once a day, I'd be happy. I just don't want the averages being calculated everytime any user wants to see another users average. Note that I may not need all of the users ratings all the time. I may just need one, five, or ten at a time. Think of these averages as the star ratings each book has on amazon.com. Their servers would crash if they had to keep calculating the exact star rating for each book.

Is this what stored procedures do? Someone please shed some light on the subject.

View Replies !
DB Structure And Stored Procedures
I`ve got a few questions about DB structure for which diagram I`ve attached to this post.

1. What do you think about it, generally

2. I expect a lot of records to be stored in News and Events tables, so how should I manage with the oldest ones? I think, to optimize receiving latest data, the oldest records should be removed from main tables News/Events to tables like ArchivedNews/ArchivedEvents. But what about tables: News_has_ImageFiles, Events_has_ImageFiles. They should be created together with Archived* ones?
Or maybe I got it to complicated. All I know is that all data is important and after a while they should be dropped into archives.

3. What do you think about stored procedures especially in case of simple queries like "select * from x". I study with guy who loves SP so much that he creates it for even such queries. He explains that all logic is on the DB side and that`s why it`s easier to manage and secure db. He is a C# + MSSQL programmer. But, how about SP in PHP+MySQL environment? On the one hand less data is sent by client to server. On the other hand DB is doing everything so it might be overloaded when too many requests are sent. What is your opinion about it?

View Replies !
Returning Msg From Stored Procedures
I`m learning how to use SP in MySQL and have some doubts about returning msg from SP. I`ve done sth like this:

SQL
DELIMITER $$ 
DROP PROCEDURE IF EXISTS `site`.`addContact` $$CREATE DEFINER=`root`@`localhost` PROCEDURE `addContact`(IN c_type VARCHAR(30)) 
BEGIN 
  DECLARE msg VARCHAR(100); 
  IF TRIM(c_type)<>'' THEN 
    IF (SELECT COUNT(*) FROM contacts WHERE `type`=c_type)=0 THEN      INSERT INTO `contacts` (type) VALUES (c_type);      SET msg='Successfuly added'    ELSE      SET msg='Already exists'    END IF; 
  ELSE    SET msg='Type name must be provided.'  END IF; 
  SELECT msg; 
END $$ 
DELIMITER ;

SP returns always one msg and it`s easy to use it later in app code i.e. PHP.
I`d like to ask if this aproach (with select returning msg) is acceptible? Or maybe I should use OUTPUT variable inside SP to get such info?

View Replies !
Question About Stored Procedures
I have never used stored procedures in the past. Just the other day I started to ponder if SPs are beneficial for getting around long query parsing. For example, on my website I have a query that is 300 characters in length and selects 30 columns. THIS IS A HUGE query; so I would assume that the database query parser has to do a heck of a job computing the query.
SELECT column1,column2...column30 FROM profiles WHERE user_id=[USER_ID] LIMIT 1
Also since the database is on different server, the PHP server has break it up into packets and then send the request to the database server. Then you know what happens from there.
But if Stored Procedures were to be used, then the the query would only be
CALL profiles([USER_ID]);
now this query is 16 chars in min and 22 in max (ranging from user_id 1 to 100,000+).

Soooooooo, when a stored procedure is setup in MySQL, is the original query just masked with a function? Or does MySQL optimize the query to a more native database request (something that the database can understand more efficiently than a regular query)?
And is this solution going to benefit me in any way?

View Replies !
Stored Procedures + Permissions
I'm on a shared host with MySQL 5.0.33. I want to use stored procedures and functions. Unfortunately I'm getting an error message when I try to create a new function. For example:

SQL
CREATE FUNCTION `gutenTag`()
    RETURNS varchar(20) CHARSET utf8
RETURN 'Guten Tag'

... ends with:

#1044 - Access denied for user 'blah'@'%' to database 'blahblah'

How can I check if I have permissions to create procedures/function?


View Replies !
ASP.net And MySQL And Stored Procedures
Hopefully this is simple and I'm making too much of it... here it goes...

First part of the question (which I'm hoping most can answer)

I have googled and googled and gave up in the end of trying to find a clear example of creating a stored procedure USING a parameter in MySQL.

ANY help or simple direction to a tutorial would be awesome.

Second...

I have downloaded the evaluation of Visual Studio 2005 to get used to asp.net. I'm using MySQL database, please note I have installed and patch all the revelant dot net components and plugins to get it to create a connection string to MySQL Server.

Though it doesnt look liek the VS GUI wants to communicate with MySQL leaves it up to you to create the SQL. (Which isn't a problem.)

But... I want it to work with Stored Procedures (you see Visual DOES let you use exisiting stored procedures contained within your database server)

.... Which points back to question one, but anyway the point of question two is has anyone else experience an attempt to get MS Visual Studio 2005 and MySQL working together?

Note: I can already pull in data from MySQL using coded connection string within the backend code of a .net page.


View Replies !
Debugging Mysql Stored Procedures
I serfed web to find some kind of mysql stored procedure
debugger. But I found nothing.
Last week at last a tool with integrated debugger was released.
It uses debug engine.

like an oracle dbms_debug, and supports breakpoints, watches, call
stack, and stepping through code facilities. May be it can help you
developing complex stored routines.

View Replies !
Huge INSERTs And Stored Procedures
Started with PHP and CSS this year and got into it quickly, so I was thinking of starting a big project (a statistics site for an MMO with about 10000 players) to teach myself MySQL(+Stored Procedures) and AJAX also.

The load of data turned out to be a higher bigger than expected, so I'd need some advice on how to handle bigger quantities of rows simultaneously.

The entire process is like this: ...

View Replies !
Stored Procedures & Filesystem Functions
I've seen this done with MSSQL, I'm wondering if there is a way to do it with MySQL 5.0.

I want to have a table where each record stores some meta data about a file. Instead of having a longblob column to store the binary of the file in, I'd prefer to just write each file to disk and name it with the auto increment value of the table.

If I delete a row, I want it to automatically delete the associated file from the disk as well.
The problem is that I don't see any filesystem functions. Is this functionality missing from MySQL?

View Replies !
MySQL 5 Stored Procedures Article
This is a great article for MySQL New features Stored Procedures. pdf

Author : Peter Gulutzan
Software Architect at MySQL AB


View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved