View previous topic :: View next topic
|
Author |
Message |
lakshmibala
New User
Joined: 16 Jun 2004 Posts: 47
|
|
|
|
Hi,
I have a doubt can i insert more than one row thry application program? is it possible?
Regards
Lakshmi |
|
Back to top |
|
|
thunder
New User
Joined: 03 Sep 2004 Posts: 3
|
|
|
|
hi lakshmi,
i think v cannot insert more than one row thru cobol . so far i had not came across such things. I shall try for it and reply soon.
|
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Dear Friend,
You can insert more than one rown from COBOL program. Try CURSOR technique. |
|
Back to top |
|
|
lkmona80
New User
Joined: 28 Sep 2004 Posts: 2 Location: bangalore
|
|
|
|
[quote="mcmillan"]Dear Friend,
You can insert more than one rown from COBOL program. Try CURSOR technique.[/quote]
If u dont mind can u pl gv a small example for it. |
|
Back to top |
|
|
vikas4u
New User
Joined: 12 Aug 2004 Posts: 14 Location: bangalore
|
|
|
|
hi,
if u want to retrive more than 1 row thru cobol program then u have to use CURSOR.
CURSOR :- The basic function is to retrieve more than 1 rows from the
table.
CURSOR BLOCK :-
There r 4 blocks in cursor.
1st the cursor need to be declared by using DECLARE cmd.
2nd the cursor has to be opened by using OPEN cmd.
3rd the cursor has to fetch the rows by using FETCH cmg.
lastly the cursor has to be closed by using CLOSE cmd.
syntax :-
DECLARE:-
DECLARE CURSOR <cursor name> FOR SELECT <selection query>
OPEN :-
OPEN CURSOR <cursor name >
-----------
---------- |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Here's 1 way to insert multi rows:
insert into newtbl
select *
from oldtbl
where acctno > 12345 |
|
Back to top |
|
|
ksivapradeep
New User
Joined: 30 Jul 2004 Posts: 95
|
|
|
|
hi vikas,
cant we retrive more than one row using SELECT query?
we can retrive only one row using CURSOR from the no.of rows which are retrived using SELECT query.i think CURSOR is only just like one pointer to the each row.becoz we will mention the host variables in the cursor it will retrive only one row by putting in loop it will retrive the rows one by one ok please check it out and if any thing is wrong let me know.
regards,
siva pradeep |
|
Back to top |
|
|
ConnoisseuR
New User
Joined: 06 Aug 2004 Posts: 8 Location: india
|
|
|
|
if you r making a full key select then the rows updated will be one.
but if you have a partial key then you can update multiple rows with a simple select query.
thanks
santosh |
|
Back to top |
|
|
|