From: Pete Dashwood on


"Frederico Fonseca" <real-email-in-msg-spam(a)email.com> wrote in message
news:jllh32dusg0g8pnfoa59m2st6ckpsfe4l8(a)4ax.com...
> 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
>>news:jclf32h58f7qn008k25c28kh1f7cis53qv(a)4ax.com...
>>> On Sat, 08 Apr 2006 14:43:04 GMT, "Michael Mattias"
>>> <michael.mattias(a)gte.net> wrote:
>>>
> snip
>>> So if using ESQL the only way is to use a dynamic statement. (with FJ
>>> COBOL).
>>>
>> 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..."
>>
>
> snip
>>
>>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
>>in
>>your COBOL, and utilise the methods, properties, and events provided by
>>MicroSoft. This will allow full acces to ALL DDL statements (NOT just
>>CREATE
>>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.
>>
>>Pete.
>
> 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
> differently.
>
Sure... no problem :-)

Here's some code that meets the requirements you stated above:

....
EXEC SQL
BEGIN DECLARE SECTION
END-EXEC
01 TableName PIC x(30)
EXEC SQL
END DECLARE SECTION
END-EXEC

PROCEDURE DIVISION.

EXEC SQL
CONNECT TO DEFAULT
END-EXEC

MOVE "Whatever" to TableName
EXEC SQL
CALL CreateTable (:TableName)
END-EXEC

EXEC
SQL COMMIT
END-EXEC

EXEC SQL
DISCONNECT DEFAULT
END-EXEC
....

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
matter...)

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... :-)

Pete.



First  |  Prev  | 
Pages: 1 2 3
Prev: Link Fujitsu with ODBC
Next: ROSCOE tutorial needed