473,394 Members | 1,699 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,394 software developers and data experts.

insert multipe records at once how_URGENT

35
hi i'm new to this issue

i'm developping a web application with an access database

in my application there's a loop that gets values of a form
like:

lastElt=request("numberOfItems")
for i=0 to lastElt
qty=request("qty" & i )
desc=request("desc" & i )
objConn.execute("insert into items values(" & qty & " , ' " & desc & " ' )" )
next

and i have to insert like 12-15 records
is there a way to insert them at the same time like a batch operation, or something instead of accessing the database multiple times

well im using a stored procedure that does the insert but i f there's a way to batch-insert i'll take it

need code PLEASE!!

another isuue:

i need to insert a row into a table whose PK is an autonumber and then get the PK value. I'm using aq stored procedure to do the insert and then the @@IDENTITY method to get this value(PK)
my question is : if there were 2 or more users executing the page at the same time, cab user1's inserted PK be seen by user2
ie. 2 ASO connections here , the @@IDENTITY does it depend on the connection calling it or does it retrieve the last inserted PK value no matter who or what connection did the insert or does a it return the value last inserted by the ADO connection issuing the @@IDENTITY call
Aug 9 '06 #1
2 1969
r_o
35
PS: im using ASP
Aug 9 '06 #2
PEB
1,418 Expert 1GB
Why do not try the follow:

objConn.execute("insert into items (F1_items, F2_items) SELECT qty, desc FROM numberOfItems;" )

Where F1_items and F2_items are fields you want to append in table items

Have a nice day!
Aug 31 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Roy Adams | last post by:
Hi forum I have three text fields set up on a page that when submitted I want them to be inserted in to a table but in differnt records at once. the code below only seems to insert the last field...
10
by: Mike | last post by:
I know this sounds strange but I am at a loss. I am calling a simple funtion that opens a connection to a SQL Server 2000 database and executes an Insert Statement. private void...
3
by: Bob Alston | last post by:
I have a routine to copy data to new versions of my app via insert into sql statements. Unfortunately, due to evolution of my app, sometimes the new version has more restrictive editing than an...
1
by: r_o | last post by:
i'm developping a web application with an access database in my application there's a loop that gets values of a form like: lastElt=request("numberOfItems") for i=0 to lastElt...
4
by: Bob | last post by:
Hi all, I'm trying to import data, modify the data then insert it into a new table. The code below works fine for it but it takes a really long time for 15,000 odd records. Is there a way I...
6
by: eighthman11 | last post by:
Hi everyone: Using Sql Server SQL 8 I'm trying to INSERT records into a "can software package" batch table. I have a work-table that mimics the batch table. After manipulating the records in...
0
chumlyumly
by: chumlyumly | last post by:
Hello scripters - OS: Mac OSX Language: PHP w/ MySQL database I've created an insert page where a user inputs his info, which then goes to four different tables in a MySQL database. The...
0
BenRatcliffe
by: BenRatcliffe | last post by:
Hi there, I was wondering if anyone could help me. I have a comlpex database with a number of forms that have data entered on them and then saved into the correct table etc. In this instance I am...
24
by: Henry J. | last post by:
My app needs to insert thousand value rows into a mostly empty table (data are read from a file). I can either use inserts, or use merge. The advantage of using merge is that in the few cases...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.