× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Have found what would seem to be a SQL compiler error. Could be a
"feature" not sure.

I am trying to create a shorter version of field ctdtype as ctdtype4.
ctdtype is a field in file ctd.

this shell version of the program compiles just fine. The field ctdtype4
is defined using the clear statement.

D sq S
1024
D
D* DS FOR SQL INPUT
FIELDS
D DATA E DS
EXTNAME(CTD)
D CTDTYPE4
OVERLAY(CTDTYPE)
C clear CTDTYPE4
4
/FREE
EXEC SQL CLOSE
C1;
EXEC SQL PREPARE P1 FROM
:sq;
EXEC SQL DECLARE C1 SCROLL CURSOR FOR
P1;
EXEC SQL OPEN C1
;
EXEC SQL FETCH C1 INTO :DATA
;
/END-FREE
C seton lr


if instead I program it like this and define the field length of ctdtype4
on the d spec instead of the c spec
the compile listing has an additional field in the sql "fetch" data
structure
during debug you can watch it read in field sql_00044 (blanks) into field
ctdtype4 and wipe out the value in field ctdtype
no warnings on the compile listing.

D sq S
1024
D
D* DS FOR SQL INPUT
FIELDS
D DATA E DS
EXTNAME(CTD)
D CTDTYPE4 4
OVERLAY(CTDTYPE)
/FREE
EXEC SQL CLOSE
C1;
EXEC SQL PREPARE P1 FROM
:sq;
EXEC SQL DECLARE C1 SCROLL CURSOR FOR
P1;
EXEC SQL OPEN C1
;
EXEC SQL FETCH C1 INTO :DATA
;
/END-FREE
C seton lr

just thought you sql freaks might like to see it.


notes from the compile listing
fetch data structure from 1st program

D DS
FETCH
D SQL_00012 1 2B 0 INZ(128)
length of header
D SQL_00013 3 4B 0 INZ(5)
statement number
D SQL_00014 5 8B 0 INZ(0)
invocation mark
D SQL_00015 9 9A INZ('0')
data is okay
D SQL_00016 10 127A
end of header
D SQL_00017 129 129A
CTDRC
D SQL_00018 130 139A
CTDTYPE
D SQL_00019 140 149A
CTDTYPESB
D SQL_00020 150 158S 0
CTDNKEY1
D SQL_00021 159 163S 0
CTDNKEY2
D SQL_00022 164 193A
CTDAKEY1
D SQL_00023 194 223A
CTDAKEY2
D SQL_00024 224 233A
CTDMTHD
D SQL_00025 234 283A
CTDDESC
D SQL_00026 284 343A
CTDADDR
D SQL_00027 344 346A
CTDEBY
D SQL_00028 347 352S 0
CTDEMDY
D SQL_00029 353 358S 0
CTDEHMS
D SQL_00030 359 368A
CTDEJOB
D SQL_00031 369 378A
CTDEUSER
D SQL_00032 379 384A
CTDENBR
D SQL_00033 385 387A
CTDCBY
D SQL_00034 388 393S 0
CTDCMDY
D SQL_00035 394 399S 0
CTDCHMS
D SQL_00036 400 409A
CTDCJOB
D SQL_00037 410 419A
CTDCUSER
D SQL_00038 420 425A
CTDCNBR
D SQL_00039 426 432S 0
CTDCUST
D SQL_00040 433 434S 0
CTDCSTB
D SQL_00041 435 441S 0
CTDVEND
D SQL_00042 442 444S 0
CTDSLMN
D SQL_00043 445 447A
CTDEMP

the second program adds this line at the end of the data structure
D SQL_00044 448 451A
CTDTYPE4


Jim Horn

This email is intended only for the person or entity
to which it is addressed and may contain information
that is privileged, confidential or otherwise protected
from disclosure. If you are not the named addressee
or an employee or agent responsible for delivering
this message to the named addressee, you are not
authorized to read, print, retain copy, and disseminate
this message or any part of it. If you have received this
message in error please notify us immediately by email,
discard any paper copies and delete all electronic files
of this message.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.