RE: How to return resultset from MySQL Stored Procedure using prepared statement?

2013-03-13 Thread Rick James
prepared statement? DELIMITER $$ CREATE PROCEDURE List_IL() BEGIN DECLARE Project_Number_val VARCHAR( 255 ); DECLARE Temp_List_val VARCHAR(255); DECLARE Project_List_val VARCHAR(255); DECLARE FoundCount INT; DECLARE Project_Number INT; DECLARE db_Name VARCHAR(255); DECLARE

stored procedure and random table name - temp table, merge, prepared statement

2009-12-10 Thread Dante Lorenso
All, I have a stored procedure that I'm writing where I need to run a lot of queries against a particular table. The name of the table will be a parameter to the stored procedure ... example: CALL normalize_data('name_of_table_here'); Since I want to run queries against this table, I don't

RE: stored procedure and random table name - temp table, merge, prepared statement

2009-12-10 Thread Gavin Towey
@lists.mysql.com Subject: stored procedure and random table name - temp table, merge, prepared statement All, I have a stored procedure that I'm writing where I need to run a lot of queries against a particular table. The name of the table will be a parameter to the stored procedure ... example: CALL

Re: stored procedure and random table name - temp table, merge, prepared statement

2009-12-10 Thread D. Dante Lorenso
Lorenso [mailto:da...@lorenso.com] Sent: Thursday, December 10, 2009 3:20 PM To: mysql@lists.mysql.com Subject: stored procedure and random table name - temp table, merge, prepared statement All, I have a stored procedure that I'm writing where I need to run a lot of queries against a particular

Prepared statement cursors problem.

2008-07-29 Thread Carlos Savoretti
Hi all: I need to set a cursor for doing a SELECT (using the C API) According the documentation I did in order to setup the cursor. --- const unsigned long cursor_type = CURSOR_TYPE_READ_ONLY; if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_CURSOR_TYPE, (void *) cursor_type)) {

Prepared statement cursors problem.

2008-07-29 Thread Carlos Savoretti
Hi all: I need to set a cursor for doing a SELECT (using the C API) According the documentation I did in order to setup the cursor. --- const unsigned long cursor_type = CURSOR_TYPE_READ_ONLY; if (mysql_stmt_attr_set (mysql_stmt, STMT_ATTR_CURSOR_TYPE, (void *) cursor_type)) {

Prepared Statement, Select and Calls in C/C++ UDF

2006-04-15 Thread Miroslav Nachev
Hi, I want to make C User Defined Function where to do some data processing using the parameters and the data in the database and to return some BIGINT result after that. My questions are: Q1. Is it possible to use Prepared Statement, Select and Calls in C/C++ UDF? Q2. If, Yes, which MySQL

C API Prepared Statement Data types with unsigned int

2006-03-29 Thread 古雷
mysql desc MSGDB_20060330; +---+-+--+-+-+---+ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-+---+ | CREATETIME| char(14)| NO | |

Re: prepared statement problems

2005-08-22 Thread Gleb Paharenko
Hello. Use 4.1.13. Logging for prepared statements works as of that version. See: http://bugs.mysql.com/bug.php?id=8367 050822 17:28:13 122 Connect [EMAIL PROTECTED] on test 122 Prepare [1] select product from lth where

Re: prepared statement problems

2005-08-22 Thread Darrell Cormier
On Monday 22 August 2005 09:31, Gleb Paharenko wrote: Hello. Use 4.1.13. Logging for prepared statements works as of that version. See: http://bugs.mysql.com/bug.php?id=8367 SNIP Yes, thank you again. I had just upgraded and tested it about the time I got this message. The loggin is

Re: prepared statement problems [SOLVED]

2005-08-22 Thread Darrell Cormier
On Monday 22 August 2005 15:30, Darrell Cormier wrote: SNIP Yes, thank you again. I had just upgraded and tested it about the time I got this message. The loggin is working fine now. Now I get this for the log output: /usr/sbin/mysqld-max, Version: 5.0.11-beta-Max-log. started with: Tcp

Re: SQL statement generated from prepared statement

2005-08-19 Thread Gleb Paharenko
prepared statements properly. Darrell Cormier [EMAIL PROTECTED] wrote: Is there a way to get MySQL to report the SQL statement it receives from a prepared statement execution (from a program using the C-API )? I am wondering what the SQL statement looks like that is being generated from

Re: prepared statement problems

2005-08-19 Thread Gleb Paharenko
parameter buffers to prepared statement if (mysql_stmt_bind_param (stmt, parm_bind)) { cerr mysql_stmnt_bind_param() failed endl; cerr mysql_stmt_error(stmt) endl; exit(0); } /* Fetch result set meta information */ ps_meta_result

Re: SQL statement generated from prepared statement

2005-08-19 Thread Darrell Cormier
On Thursday 18 August 2005 16:37, Gleb Paharenko wrote: Hello. These links might be helpful: http://dev.mysql.com/doc/mysql/en/query-log.html http://dev.mysql.com/doc/mysql/en/debugging-client.html http://dev.mysql.com/doc/mysql/en/debugging-server.html Use a fresh version of

Re: prepared statement problems

2005-08-19 Thread Darrell Cormier
On Thursday 18 August 2005 17:52, Gleb Paharenko wrote: Hello. I've modified your source code, and it works now. Use diff to see the changes. snip Thank you, but I made the changes and I still get no returned data. Below is the contents of the logfile when I run my program. It appears

Re: prepared statement problems

2005-08-18 Thread Darrell Cormier
buffers to prepared statement if (mysql_stmt_bind_param (stmt, parm_bind)) { cerr mysql_stmnt_bind_param() failed endl; cerr mysql_stmt_error(stmt) endl; exit(0); } /* Fetch result set meta information */ ps_meta_result = mysql_stmt_result_metadata

RE: prepared statement problems

2005-08-18 Thread Sujay Koduri
Send the code if it is still not working. sujay -Original Message- From: Darrell Cormier [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 7:16 PM To: mysql_list Subject: Re: prepared statement problems Sujay Koduri said the following on 08/18/2005 12:31 AM: Hi, The problem

Re: prepared statement problems

2005-08-18 Thread Darrell Cormier
= (void*) lot; parm_bind[1].buffer_length = sizeof(lot); parm_bind[1].is_null=is_null[1]; parm_bind[1].length= str_length[1]; // Specify the data values for the parameters. //strmov(szData, (char *)venu); //bind parameter buffers to prepared statement if (mysql_stmt_bind_param (stmt

Re: prepared statement problems

2005-08-18 Thread Darrell Cormier
Sorry, the text of my message did not come through for some reason. I have included it below. DC Sujay Koduri said the following on 08/18/2005 08:48 AM: Send the code if it is still not working. sujay Not sure what you mean by send the code since it is included at the end of this

RE: prepared statement problems

2005-08-18 Thread Sujay Koduri
Koduri Subject: Re: prepared statement problems Sujay Koduri said the following on 08/18/2005 08:48 AM: Send the code if it is still not working. sujay Not sure what you mean by send the code since it is included at the end of this email. However, I have also attached the file

Re: prepared statement problems

2005-08-18 Thread Darrell Cormier
Sujay Koduri said the following on 08/18/2005 09:33 AM: hi, you should use strlen() instead of sizeof() to pass the length of input bind parameter, otherwise it will read past the actual parameter and tries to compare with the whole thing which is not intended. str_length[0]= sizeof(facility);

SQL statement generated from prepared statement

2005-08-18 Thread Darrell Cormier
Is there a way to get MySQL to report the SQL statement it receives from a prepared statement execution (from a program using the C-API )? I am wondering what the SQL statement looks like that is being generated from my program to help debug it. Thanks, DC -- Darrell Cormier [EMAIL

prepared statement problems

2005-08-17 Thread Darrell Cormier
Greetings, I am trying to figure out prepared statements in the C-API. The problem I am having is passing parameters to a prepared statement. If I hard code everything in my SQL statement, like: static char *sql_stmt = { select product from lth where facility

RE: prepared statement problems

2005-08-17 Thread Sujay Koduri
: Thursday, August 18, 2005 1:23 AM To: mysql_list Subject: prepared statement problems Greetings, I am trying to figure out prepared statements in the C-API. The problem I am having is passing parameters to a prepared statement. If I hard code everything in my SQL statement, like: static char

Re: modifying prepared statement parameters

2004-11-22 Thread Gleb Paharenko
Hello. You may use something like: prepare stmtl from 'select * from ren1 where yo like concat(%,?,%)'; set @a='1'; execute stmtl using @a; Nathan Coast [EMAIL PROTECTED] wrote: Hi, Is it possible to modify parameters passed to prepared statements? e.g. select

modifying prepared statement parameters

2004-11-20 Thread Nathan Coast
Hi, Is it possible to modify parameters passed to prepared statements? e.g. select ... where username like '%?%' I'd like to put wildcard chars '%' on either end of a parameter. Is this legal? or do I have to modify the parameter before passing it to mysql. thanks Nathan -- Nathan Coast

Prepared statement for MySQL 4.1

2004-11-11 Thread Scott Hamm
I've read the article about 'prepared statement' found in MySQL 4.1, and am not sure if I understood what 'prepared statement' does and how can it benefit us. Can anyone elaborate on what 'prepared statement' could do with examples where possible? Thanks, The Newbie Scott -- MySQL General

Re: Prepared statement for MySQL 4.1

2004-11-11 Thread Gleb Paharenko
Hello. As said at documentation: Prepared execution is an efficient way to execute a statement more than once. Good examples you can find in documentation to MySQL, and in tests/client_test.c. Scott Hamm [EMAIL PROTECTED] wrote: I've read the article about 'prepared statement' found

Re: Prepared statement for MySQL 4.1

2004-11-11 Thread Mark Maunder
Scott, http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html regards, Mark. On Thu, 2004-11-11 at 15:38, Scott Hamm wrote: I've read the article about 'prepared statement' found in MySQL 4.1, and am not sure if I understood what 'prepared statement' does and how can

RE: Prepared statement for MySQL 4.1

2004-11-11 Thread Scott Hamm
*THAT* one was what I already ready and could not understand it since English isn't my first language. -Original Message- From: Mark Maunder [mailto:[EMAIL PROTECTED] Sent: Thursday, November 11, 2004 12:45 PM To: Scott Hamm Cc: 'Mysql ' (E-mail) Subject: Re: Prepared statement for MySQL

Re: Prepared statement for MySQL 4.1

2004-11-11 Thread Fagyal Csongor
Scott, I've read the article about 'prepared statement' found in MySQL 4.1, and am not sure if I understood what 'prepared statement' does and how can it benefit us. Can anyone elaborate on what 'prepared statement' could do with examples where possible? In the simplest case, consider

RE: Prepared statement for MySQL 4.1

2004-11-11 Thread Kevin Cowley
: [EMAIL PROTECTED] Web: http://www.alchemetrics.co.uk -Original Message- From: Fagyal Csongor [mailto:[EMAIL PROTECTED] Sent: 11 November 2004 18:10 To: 'Mysql ' (E-mail) Subject: Re: Prepared statement for MySQL 4.1 Scott, I've read the article about 'prepared statement' found

Re: Prepared Statement questions/issues

2004-08-25 Thread Daniel Kasak
Ken Gieselman wrote: Hi Folks -- I'm running into some issues with large prepared statements, and would love some feedback about approaches or tweaks that I might have overlooked :) snipped Any suggestions as to how to do this more efficiently/faster? Or how to increase the buffer space for

Re: Prepared Statement questions/issues

2004-08-25 Thread Leonardus Setiabudi
Hi Ken.. this might not solve your problem.. but, did you really have to do this create table raddata ( granIDinteger not null, scanIDtinyint unsigned not null, fpID tinyint not null, c1smallint, c2

Prepared Statement questions/issues

2004-08-18 Thread Ken Gieselman
Hi Folks -- I'm running into some issues with large prepared statements, and would love some feedback about approaches or tweaks that I might have overlooked :) I'm working on a large-scale database for scientific data -- lots of individual detector values and whatnot, that unfortunately need to

C API Prepared Statement Interface - MYSQL_BIND

2003-11-19 Thread Richard Tibbetts
I am finding the documentation located at http://www.mysql.com/doc/en/C_API_Prepared_statement_datatypes.html on the C API Prepared Statement Interface to be a bit unclear. In the MYSQL_BIND datatype, when using mysql_bind_param() and mysql_excute() to pass parameters to a prepared statment, how

prepared statement vs multiple query

2003-07-30 Thread Vladimir Zheleznyak
Hello, Is prepared statement compatible with multiple query executilng? Best regards, Vladimir Zheleznyak -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

support for Prepared statement

2003-06-19 Thread Deepak Saini
Hi All, I am using MySQL 4.0.13 and using Connector/j jdbc drivers. What i am looking for is the support for Stored Procedures. Following is what Connector/J documentation says. PreparedStatements are implemented by the driver, as MySQL does not have a prepared statement feature. Because

prepared statement

2002-11-25 Thread Hamid Amjadi
Hi ; I am usein the following prepared statement: insertOne = dbConnection.prepareStatement( INSERT INTO appointment (apptId,providerId,patientId,serviceLocationId, dateTime, assistant, duration,state,statechange,memo,cancelMemo,dictationMarked, apptSeqId, clinicId, appSharing) values

Re: prepared statement

2002-11-25 Thread Mark Matthews
Hamid Amjadi wrote: Hi ; I am usein the following prepared statement: insertOne = dbConnection.prepareStatement( INSERT INTO appointment (apptId,providerId,patientId,serviceLocationId, dateTime, assistant, duration,state,statechange,memo,cancelMemo,dictationMarked, apptSeqId, clinicId

why doesn't prepared statement work?

2001-11-20 Thread yilmaz
Hi all, i have a strange situation here, i am trying to execute an sql insert via prepared statements. though it is a simple insert process, i am having a syntax error message. Doesn't mysql support this? can someone please tell me what is wrong with this query? String query=insert into

why doesn't prepared statement work?

2001-11-20 Thread yilmaz
Hi all, i have a strange situation here, i am trying to execute an sql insert via prepared statements. though it is a simple insert process, i am having a syntax error message. Doesn't mysql support this? can someone please tell me what is wrong with this query? String query=insert into

Re: why doesn't prepared statement work?

2001-11-20 Thread yilmaz
doesn't prepared statement work? maybe u should use '?' instead of ?. Btw, isn't that special char which need function htmlspecialchars() ? - Original Message - From: yilmaz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 1:11 AM Subject: why doesn't

Re: why doesn't prepared statement work?

2001-11-20 Thread DL Neil
list. Regards, =dn - Original Message - From: yilmaz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 20 November 2001 10:18 Subject: Re: why doesn't prepared statement work? Thanks Hans, when i replcaed ? with ? , this time i ma having java.lang.ArrayIndexOutOfBoundsException

Re: why doesn't prepared statement work?

2001-11-20 Thread yilmaz
: Tuesday, November 20, 2001 7:29 PM Subject: Re: why doesn't prepared statement work? Yilmaz, Recommend you simplify. Test on (say) the first five fields, then the next five,... and try to work out which field is causing the issue, then analyse by narrowing down until you figure it out. The data

Re: why doesn't prepared statement work?

2001-11-20 Thread yilmaz
prepared statement work? Thanks Neil, even with only one parameter it doesn't work. it keeps throwing: javax.servlet.ServletException: Syntax error or access violation: You have an error in your SQL syntax near '?)' at line 1 when i replace ? with '?' it throws

Re: why doesn't[sic] prepared statement work?

2001-11-20 Thread Mark Matthews
There have been issues with certain prepared statements and older versions of MM.MySQL. I suggest you upgrade to the latest (2.0.7) available from http://mmmysql.sourceforge.net/. You should not surround your ?'s with single quotes (leave them bare), and contrary to the previous messages, you do

Re: why doesn't prepared statement work?

2001-11-20 Thread Dan Nelson
In the last episode (Nov 20), yilmaz said: Well, i am answering my own question. It was keeping telling me that there is a syntax error. However, the real problem was at the bottom the preparedstatement code snippet stmt.executeUpdate(query); statement should have been