473,274 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,274 software developers and data experts.

Block insert into mysql(5.0)

Is there a way to block insert into mysql(5.0) using c api of mysql
db..

i.e.

say there is a table with 2 columns, one contains char other int
then i want to insert 500 records at once,, as i explained below.

here i declare 2 arrays of char and int to store the values i want,

char *pzCol1[500*50];
int *piCol2[500];

then i fil abov 2 arrays wit values and then the PROBLEM...
Is there a way to above 500 records using below insert query usin' c
api of mysql db..

INSERT INTO table VALUES (?, ?)
PLS HLP me.........

Nov 1 '07 #1
4 3917
On Thu, 01 Nov 2007 05:07:25 -0700, Waruna <wa*******@gmail.com>
wrote:
>Is there a way to block insert into mysql(5.0) using c api of mysql
db..
<snip>
>i.e.

INSERT INTO table VALUES (?, ?)
What you are looking for is called "Embedded SQL", and is off topic in
this group. Try perhaps comp.databases.mysql...

--
PGP key ID 0xEB7180EC
Nov 1 '07 #2
Waruna wrote:
Is there a way to block insert into mysql(5.0) using c api of mysql
db..
mysql(5.0) is neither part of C++, nor of C, so you are off-topic in both
newsgroups you posted to. Try a newsgroup about sql. A quick look gives
comp.databases.mysql

Nov 1 '07 #3
>Is there a way to block insert into mysql(5.0) using c api of mysql
>db..
It is possible to use C to build up a query string and, using the
non-standard-C C MySQL API, get the query executed. That string
can be very long. sprintf() or repeated application of strcat()
might be appropriate here.
>then i fil abov 2 arrays wit values and then the PROBLEM...
Is there a way to above 500 records using below insert query usin' c
api of mysql db..
Yes, you can insert 500 records with one INSERT query, assuming the
values aren't so long that you exceed the maximum query length.
>INSERT INTO table VALUES (?, ?)
INSERT INTO table values
(55, 'spamming'),
(86, 'scamming'),
(137, 'Nigerian bank fraud'),
(872, 'Murder'),
....
(999, 'Income Tax Evasion');

You don't have to format the query with embedded newlines, but it's allowed.

Nov 2 '07 #4
On Nov 1, 5:13 pm, Rolf Magnus <ramag...@t-online.dewrote:
Waruna wrote:
Is there a way to block insert into mysql(5.0) using c api of mysql
db..

mysql(5.0) is neither part of C++, nor of C, so you are off-topic in both
newsgroups you posted to. Try a newsgroup about sql. A quick look gives
comp.databases.mysql
srry guys for the inconvenience...

Nov 2 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jack | last post by:
I have a text file of data in a file (add2db.txt) where the entries are already entered on separate lines in the following form: INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
11
by: grumfish | last post by:
I'm trying to add a row to a MySQL table using insert. Here is the code: connection = MySQLdb.connect(host="localhost", user="root", passwd="pw", db="japanese") cursor = connection.cursor()...
0
by: David Bordas | last post by:
Hi list, I've got a little bug with MySQL. I can insert a row into my table but this row will not appear in the table :( Server is under linux redhat, MySQL is 3.23.56 installed from binary...
0
by: Lars Rasmussen | last post by:
I tried that, but i dont work either. I need to insert a way that mysql doese'nt complain when i copy some records that have the same id (or that it just gives it an id according to the...
0
by: Rajesh Kapur | last post by:
I have a master slave configuration on linux machines running MySQL 4.0.21. Once every hour, a process deletes about 9000 rows and re-inserts fresh data on the master. The master process completes...
10
by: Python_it | last post by:
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable...
2
by: bballr | last post by:
I have a problem that I'm not sure if it can be done. I'm trying to use the MySQL C API to be able to use a normal sql insert statement that will send the data or file to a directory and NOT the...
2
josie23
by: josie23 | last post by:
Egad, I'm not a coder/programmer by nature or occupation but understand things like html and css and a small amount of perl. So, basically, I'm a perl/mysql imbecile. But, I've been trying to...
4
by: dirk | last post by:
Hey, I'm new to php and I'm trying to write some php code so that I can insert data into a mysql database using html forms. I've got two text forms and a submit button. When entering data and...
3
by: Waruna | last post by:
Is there a way to block insert into mysql(5.0) using c api of mysql db.. i.e. say there is a table with 2 columns, one contains char other int then i want to insert 500 records at once,, as i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.