Regarding insertion

Regarding insertion

Post by Prachi jai » Fri, 01 Nov 2002 18:25:48



Hii All,

I am trying to insert the answers, i m getting from a
questionnaire. My table design is to put the questions in
row and corresponding answers in adjacent row. But, i m
not able to think, how can i insert the values then. While
putting the questions in coloumns it was ok.

If suppose i have four columns named, questions, answer,
user, company. Questions are hardcoded in the questions
coloumn (something around 40 questions.) How can i insert
the appropriate answer for each question.

By doing something like this

Insert into ques_table (Answer,  User, Company) values
(ans, user, company)

I need to loop on the values. I am not able to think how??
Could you please give a hand??
I am working with my web application.

Thanks and regards,
Please reply.

 
 
 

1. Question regarding SQL, insertions

Hi,
    At the moment I am in the process of completing a task which involves
the transfer of data from Informix ( ancient version ), to SQL Server 7.
This works fine mainly, with one minor issue.

The select criteria I use on the informix size purposely orders the records
produced from my SQL, which is fine.
When I run them through a DTS package some of the records are ordered and
some aren't. There is no discernable difference between the rows ordered and
those not.

for example. I have two columns ( out of 16 ), which I build a key on.
bugno, rowcnt. These are in the table for data imported into by my DTS
Package. However as already mentioned they are out of sequence, i.e. I wouls
expexte the following:

Bugno        rowcnt
12                1
12                2
12                3
12                4
13                1
13                2
etc                etc

However I get

Bugno        rowcnt
12                1
12                2
13                1
12                4
13                1
12                3
etc                etc

I have tried creating a dummy table and inserting all records from a select
which is ordered but to no avail. The select itself work to display the
records no proble.

insert into file_out1
select * from file_out order by bugno, rowcnt

I know this is a long shot, but has anyone seen behaviour like this,
admittedly weird and with a strong potential to being my own fault.

Thanks

Tony.

2. IMS DBAs Needed in the Philadelphia Area!

3. Regarding The insertion of the Chinese Characters

4. US-MA,RI,CT Oracle DBA/Developer2000 Immediate Openings available

5. SQL Server Insertion rating

6. Enterprise Manager - Connect to db via VPN

7. SQL Server Insertion Rate...

8. TEMPDB Questions

9. Temporary table insertion errors

10. Regular insertions to multiple tables

11. SQLServer insertion peformance

12. BLOB insertion error

13. image insertion in database