Skip to main content

[Migrated content. Thread originally posted on 13 July 2005]

What would be nice for us is when Acu4GL was creating tables in SQL Server that it would check what version it was working with. If it is version 7.0 or greater rather than creating fields at "text" if the size is less than 8000 characters it could use the standard varchar.

We could create the table using a standard SQL script file but we have a number of tables with dynamic names only known at runtime so doing an open output is an easy way to create the table. I did have the idea of using SQL.acu to just do an "alter table" to change the column type but SQL Server does not allow text fields to be changed this way.

[Migrated content. Thread originally posted on 13 July 2005]

What would be nice for us is when Acu4GL was creating tables in SQL Server that it would check what version it was working with. If it is version 7.0 or greater rather than creating fields at "text" if the size is less than 8000 characters it could use the standard varchar.

We could create the table using a standard SQL script file but we have a number of tables with dynamic names only known at runtime so doing an open output is an easy way to create the table. I did have the idea of using SQL.acu to just do an "alter table" to change the column type but SQL Server does not allow text fields to be changed this way.
You could create a stored procedure thats creates the table and accepts a paramater for the table name. Then you would call this stored procedure with SQL.ACU passing the table name.

[Migrated content. Thread originally posted on 13 July 2005]

What would be nice for us is when Acu4GL was creating tables in SQL Server that it would check what version it was working with. If it is version 7.0 or greater rather than creating fields at "text" if the size is less than 8000 characters it could use the standard varchar.

We could create the table using a standard SQL script file but we have a number of tables with dynamic names only known at runtime so doing an open output is an easy way to create the table. I did have the idea of using SQL.acu to just do an "alter table" to change the column type but SQL Server does not allow text fields to be changed this way.
Dan, that sounds like a good idea and may be the best way to do it for now.

The advantage of AcuCOBOL doing that for us would be that we would not have to maintain the SQL file as well as the COBOL file definitions. When I said we had a few tables with dynamic names I realy meant over 300 !!

The other idea I had was trying to parse the xfd and generate the create table automatically but the more I looked at it the harder it seemed. Lots of "WHEN" clauses and different keys etc.

[Migrated content. Thread originally posted on 13 July 2005]

What would be nice for us is when Acu4GL was creating tables in SQL Server that it would check what version it was working with. If it is version 7.0 or greater rather than creating fields at "text" if the size is less than 8000 characters it could use the standard varchar.

We could create the table using a standard SQL script file but we have a number of tables with dynamic names only known at runtime so doing an open output is an easy way to create the table. I did have the idea of using SQL.acu to just do an "alter table" to change the column type but SQL Server does not allow text fields to be changed this way.
It also occurs to me that when a table is accessed by acu4gl it automatically looks for a stored procedure using tablename_fileio. For instance when a cobol start or read occurs on tableA then acu4gl will attempt to load and run stored procedure tableA_read. You can see this when you run a detailed trace file. Others I've seen in the trace file are tablename_insert, tablename_update, tablename_delete.
I'm just not sure if acu4gl does this for the create of a table, like tableA_create. You could try it. I don't think it does, but it might be a good enhancement request.