PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Block insert into mysql(5.0)
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Block insert into mysql(5.0)

Réponse
 
LinkBack Outils de la discussion
Vieux 02/11/2007, 05h58   #1
Waruna
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.........

  Réponse avec citation
Vieux 02/11/2007, 12h55   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Block insert into mysql(5.0)

Waruna wrote:
> 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.........
>
>


SQL doesn't know anything about C arrays. But you can dynamically build
the INSERT statement string and have it insert as many values as you want.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 02/11/2007, 13h13   #3
Waruna
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Block insert into mysql(5.0)

On Nov 2, 3:55 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Waruna wrote:
> > 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.........

>
> SQL doesn't know anything about C arrays. But you can dynamically build
> the INSERT statement string and have it insert as many values as you want.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -


But the thing is...... what i've mentioned above is totally doable in
Oracle using its C API...

  Réponse avec citation
Vieux 02/11/2007, 14h20   #4
Pavel Lepin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Block insert into mysql(5.0)


Waruna <warunapww@gmail.com> wrote in
<1194002002.238390.268660@v29g2000prd.googlegroups .com>:
> On Nov 2, 3:55 pm, Jerry Stuckle <jstuck...@attglobal.net>
> wrote:
>> Waruna wrote:
>> > Is there a way to block insert into mysql(5.0) using c
>> > api of mysql db..

>>
>> > 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.

>>
>> > 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 (?, ?)

>>
>> SQL doesn't know anything about C arrays. But you can
>> dynamically build the INSERT statement string and have it
>> insert as many values as you want.

>
> But the thing is...... what i've mentioned above is
> totally doable in Oracle using its C API...


Good for Oracle.

You do realise you could've written that for() in quarter
the time you've spent buggering the good folks of
comp.lang.c++ and comp.databases.mysql, don't you? totally?

--
"I can't but wonder if you... don't know a hell of a
lot more about practically every subject than Solomon ever
did."
  Réponse avec citation
Vieux 02/11/2007, 14h34   #5
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Block insert into mysql(5.0)

On Fri, 02 Nov 2007 04:13:22 -0700, Waruna wrote:
> On Nov 2, 3:55 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> Waruna wrote:
>> > 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.........

>>
>> SQL doesn't know anything about C arrays. But you can dynamically build
>> the INSERT statement string and have it insert as many values as you want.
>>

> But the thing is...... what i've mentioned above is totally doable in
> Oracle using its C API...


I'll bet a nickle that the "block insert" is (or was) nothing but an
abstraction layer over a for-loop on that very passed-in array.

Or, you can look at it as "This is why Oracle cost US$10000, and MySQL
costs... nothing."

Or, with a historical nod, "If you want Oracle, you know where to find
it."

--
For why should my freedom be judged by another's conscience?
-- Paul (I Corinthians 10:29)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h16.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12339 seconds with 13 queries