View previous topic :: View next topic
|
Author |
Message |
anandkulkarni1
New User
Joined: 19 Sep 2005 Posts: 5
|
|
|
|
hi,
can somebody explain how does this dynamic cobol-sql works and how to use the cursor in the same.
anand. |
|
Back to top |
|
|
priya
Moderator
Joined: 24 Jul 2003 Posts: 568 Location: Bangalore
|
|
|
|
If you know the SQL statements at bind time, it's static sql. Else it's dynamic sql. |
|
Back to top |
|
|
anandkulkarni1
New User
Joined: 19 Sep 2005 Posts: 5
|
|
|
|
hi priya,
thanks for that but i need to know how to use cursor here.
anand. |
|
Back to top |
|
|
Rameshs
New User
Joined: 15 Jun 2005 Posts: 53 Location: India, Chennai
|
|
|
|
hi priya,
Can you give me some example code for dynamic sql ? |
|
Back to top |
|
|
babes
New User
Joined: 18 Oct 2005 Posts: 1
|
|
|
|
Dynamic sql statement is one which is known at run time.
you have four types of dynamic sql.
execute immediate
non-select dynamic sql
fixed select dynamic sql
varying select dynamic sql
EXECUTE IMMEDIATE
data division.
w-s-s.
10 ws-stg.
49 ws-stg-Len pic s9(4) comp.
49 ws-stg-text pic x(50).
procedure division.
main-para.
move +40 to ws-Len.
accept a.
exec sql execute immediate from :ws-stg end-exec.
stop run.
you can move any sql query depending upon your requirement .
but you can 't use SELECT for the first two types of dynamic sql |
|
Back to top |
|
|
|