From: Pete Dashwood on 10 Apr 2006 08:39
"Frederico Fonseca" <real-email-in-msg-spam(a)email.com> wrote in message
> On Sun, 9 Apr 2006 13:57:09 +1200, "Pete Dashwood"
> <dashwood(a)enternet.co.nz> wrote:
>>"Frederico Fonseca" <real-email-in-msg-spam(a)email.com> wrote in message
>>> On Sat, 08 Apr 2006 14:43:04 GMT, "Michael Mattias"
>>> <michael.mattias(a)gte.net> wrote:
>>> So if using ESQL the only way is to use a dynamic statement. (with FJ
>> I really HATE it when someone says "It's the ONLY way..." :-)
>>My experience (and it is extensive) is that when IT people say this, what
>>they really mean, is: "It's the ONLY way I can think of or know of, and if
>>there are other alternatives I can't be bothered exploring them..."
>>Frederico is absolutely correct when he says that the preferred way to
>>manipulate DDL in Fujitsu COBOL is by dynamic SQL, and Fujitsu do not
>>support ESQL CREATE.
>>However, dynamic SQL is NOT "the ONLY way".
>>You can get an even richer experience if you simply create an ADOX object
>>your COBOL, and utilise the methods, properties, and events provided by
>>MicroSoft. This will allow full acces to ALL DDL statements (NOT just
>>TABLE) and it also allows cube access as well as flat tables.
>>And it is not limited to Fujitsu COBOL; it will work with any COBOL that
>>supports ActiveX or COM objects.
> I also hate when someone does not read the full sentence.
> I said " ... if using ESQL ...".
> Now as far as I know ESQL standard is NOT ADOX or COM/ActivX.
> Now if you do not use ESQL then you can use the others, which I also
> mentioned on another reply.
> And as you know I did bother looking for alternatives. (see my ADO
> coding on this and other threads, and on the tek-tips faq I mention in
> one of them). I could have also provided an example in DAO/RDO, but I
> have choosen not to do it as its old technology.
> As for ADOX, very similar to ADO in how it would work. my example with
> ADO can be used as the basis for such code.
> If someone is desesperate for ADOX code and cant do it on their own
> then I may do a sample program.
> Regarding ESQL, if you can find a way of doing the create table using
> ONLY ESQL (AND NOT DYNAMIC SQL) with FJ cobol V7 or lower. (Not sure
> V8 will allow it. havent tried it yet), then I am sure many
> programmers will be happy with it. And this using the ESQL
> pre-compiler supplied by FJ, as other venders will do things
Sure... no problem :-)
Here's some code that meets the requirements you stated above:
BEGIN DECLARE SECTION
01 TableName PIC x(30)
END DECLARE SECTION
CONNECT TO DEFAULT
MOVE "Whatever" to TableName
CALL CreateTable (:TableName)
The above will work for any RDBMS that supports stored procedures, and where
you have stored a general procedure that creates any table known to the
database, given the table name. (A series of selectable CREATE TABLE
statements. They might just as well be DROP or ALTER; it really doesn't
It is ESQL. And it works on Fujitsu V7.
The point I am trying to make is that just because the manual says you can't
use ESQL to write DDL statements, doesn't mean that you 'can't'. It simply
means the syntax for those statements is not directly supported. I think
Michael was expressing the same idea in his mail to this thread.
And, BTW, my observations were not intended to be personal and I wouldn't
suggest that you personally didn't bother to explore solutions. I have seen
some of your posts in the Tek forum and I know you are giving good advice.
(In fact I refrained from posting there because I saw you had it covered on
a couple of occasions :-))
But all of us should be careful to qualify the statement "It's the ONLY
way..." [I can think of...] or, better still, just don't use it... :-)