Can't Update Database using Fujitsu SQL command 
Author Message
 Can't Update Database using Fujitsu SQL command

Quote:


>> Mike, I use MySQL 3.23.49a-max  with Fujitsu 6.1 & Powercobol.  The
> only error I get is 'S1C00' - Transactions not enabled.  I assume that
> my error is because I'm missing a config variable in the MySQL setup.
> I'm also using the Inno DB table type.

     Hi Kate, Nice to know I'm not the only nut that is trying to see
COBOL function with the WWW's most popular RDBMS MySql of the famous
LAMP (Linux/Apache/MySql/PHP). The problem I believe is with Fujitsu's
DLL (to ODBC Administrator) probably is from M$, which only uses
M$-SQL and Oracle (too popular to not include Oracle + makes M$-SQL
look cheap) or it could be User(me) SQLinf-utility file setup error. I
have my ICS computer (lets call it COMP1) = W2k with IIS 5.0
+PHP+(MySql 3.23.49a-max using the mysqld-max-nt driver [in my.ini
Setup on WinMySQLadimin) with innodb files setup] ). My
SIMPLE-MySql-test-file (innodb) works find with PHP via direct connect
to server (localhost) OR using ODBC-method (FSC 6.1 does not). COMP2
(Redhat 7.3) connects and browses directory files via COMP1's IIS
(works better than Samba-linneighborhood) and Queries COMP1 via
Index.html>PHP>MySql SIMPLE-MySql-test-file so it WORKS fine (NOT with
COBOL).
Below are methods, config-files and 1 cob (6 months old) code example
(dozens tried and failed) of what I have tried in vain to connect to
MySql. I will send Service Wise this but their page states only
M$sql/Oracle/access and if they don't add OSS DB's whom on Linux will
buy their compiler?
    File Data of SIMPLE-MySql-test-file  setup under MySql (in test
(DB)) row = [name=age, type=int(2),] innodb. Data=1,3,5,7,17,27,12.
Below are methods I have tried to confirm DB-setup-right to R/O COBOL
DLL error.
1.      Used PHP to make sure DB setup correct. Below code connects direct
to MySql Server (if you have MySql setup error this will help diagnose
it).
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Untitled</title></head><body>
<?php
$indexCount = 0;

if (!$dbAge) {
  echo( "</br> Failed mysql_connect statement" );
  exit();    }
mysql_select_db("test",$dbAge);

  echo( "</br> Failed mysql_select_db statement " );
  exit();                        }

if (!$result) {
  echo("</br> Failed mysql_query statement = " . mysql_error());
  exit();     }
while ( $row = mysql_fetch_array($result) ) {
  echo("</br> InndoTable ageRow $indexCount = " . $row["age"] .
"</p>");
  $indexCount ++;                           }
?> </body></html>

2.      Used MySqlODBC(name=testDB 3.51 driver  as above but used below
code
<body>

<? php
$connectS = odbc_connect("testDB", "mySelf", "myPassWord");
$queryS = "SELECT * FROM testt";         // point to **age row( 2-int)
table
$queryexe = odbc_do($connectS, $queryS); // load the **data (query)
odbc_result_all($queryexe, "BORDER=3");  // output HTML table with
border=3
odbc_close($connectS);                   // close the odbc
?>

3.      COBOL code/files

b.      age.inf



IDENTIFICATION DIVISION.
 PROGRAM-ID.    row1.
 ENVIRONMENT    DIVISION.
 DATA           DIVISION.
 WORKING-STORAGE SECTION.
  01 ageWK          PIC S9(2). *> COMP-5.

     EXEC SQL BEGIN DECLARE SECTION END-EXEC.
 01  age          PIC s9(2).
 01  SQLSTATE     PIC X(5).
 01  SQLMSG       PIC X(128).
     EXEC SQL END DECLARE SECTION END-EXEC.
 PROCEDURE DIVISION.
  P-START.
* CONNECT TO THE DATABASE ON THE DEFAULT SERVER.

     EXEC SQL
       CONNECT TO DEFAULT
     END-EXEC.

*need for mySql to enable transactions/ SET autocommit=0;

     EXEC SQL
       WHENEVER NOT FOUND GO TO :P-END
     END-EXEC.
* DECLARE CURSOR
     EXEC SQL
       DECLARE cur1 CURSOR FOR SELECT * from testt
     END-EXEC.
*        IF SQLSTATE = "01000" THEN
     IF SQLSTATE = "00000" then  *>Mike toggle SQLSTATE-COMP/ =
"S1COO" THEN
       DISPLAY "SUCCESSFUL CONNECTION WITH DATABASE."
       DISPLAY " "
     ELSE
       DISPLAY "UNSUCCESSFUL CONNECTION WITH DATABASE."
       DISPLAY "       SQLSTATE : " SQLSTATE
       DISPLAY "       SQLMSG   : " SQLMSG
       GO TO END-PROC
     END-IF.

* OPEN THE CURSOR.
     EXEC SQL
       OPEN cur1
     END-EXEC.  
 P-LOOP.
* FETCH THE DATA.
     EXEC SQL
       FETCH cur1
       INTO :age
     END-EXEC.  
     move age             to ageWK.
     DISPLAY " age    =  "  ageWK.
     GO TO P-LOOP.

 P-END.
* CLOSE THE CURSOR.
     EXEC SQL
       CLOSE cur1
     END-EXEC.  
* END THE TRANSACTION.
     EXEC SQL
     ROLLBACK WORK
     END-EXEC.
* DISCONNECT FROM THE DATABASE.
     EXEC SQL
       DISCONNECT DEFAULT
     END-EXEC.

   END-PROC.
     DISPLAY "END OF SESSION".
     STOP RUN
   4. Used Access2MySql to convert previous MySql databases to Access
and these have worked with FSC 6.1. (confirmed M$ theory). I will try
this as soon as my "Real world job" allows me.

I'm moving away from my once loved COBOL, however in PHP they use
"wrapping" to obscure code and prevent hackers. I thought if you could
set up a PHP CGI-bin with script only privileges and that called an
obscure dir CGI-COBOL (exe) /MySql query. No hacker in the world would
guess your methods (not the idiot ones at least) and you could deploy
and Safeguard most of your IP.  Please email me if you get yours
working.
Thanks Mike.



Thu, 27 Jan 2005 12:41:53 GMT  
 Can't Update Database using Fujitsu SQL command
OOPs! Take the "mess" off the end or you will get a parser error(it
was part of a comment line), or just no output (unless you use an
PHP-IDE like zend.com ). Just incase a lost psychotic PHP programmer
comes here? Not being a {*filter*} man I would bet against that. Mike


Fri, 28 Jan 2005 03:02:38 GMT  
 Can't Update Database using Fujitsu SQL command

Quote:

> Mike, I use MySQL 3.23.49a-max  with Fujitsu 6.1 & Powercobol.  The
> only error I get is 'S1C00' - Transactions not enabled.  I assume that

Do you mean that the only thing that you get is this error, or are you
saying that it all works fine except you get this error ?
Quote:
> my error is because I'm missing a config variable in the MySQL setup.  
> I'm also using the Inno DB table type.



Fri, 28 Jan 2005 10:19:03 GMT  
 Can't Update Database using Fujitsu SQL command

Quote:


> > Pls advise what is S1000 and how to go about the updating and deletion

>   No Idea what RDBMS or FSC version you are using. So as a non expert
> of an unknown RDBMS my best guess, it is probably your grant
> privileges or lack of setting them up that is denying your access. In
> your de{*filter*} set SQLSTATE/ SQLMSG/SQLINFOA to data-watch an it will
> help you.
> I convert my MySql databases to Access files with no permissions with
> Access2MySql converter that works with FSC 6.1. However MySql does not
> work with FSC as stated at http://www.*-*-*.com/ , So if are using  MySql
> to connect without err then please post here because myself being only
> a web programmer and MySql the most popular Linux RDBMS I will have to
> use other methods. If you have support from FSC Service Wise give them
> a chance as it is one of the best I've seen.  Also look at
> http://www.*-*-*.com/
>  Mike.

Hi Mike,

Thanks for your comment.

I'm using PostgreSQL in Linux server. I'm using PowerCOBOL v6.1 as
frontbase GUI interface, but connecting the database using COBOL97
commands
(i.e. EXEC SQL CONNECT TO DEFAULT END-EXEC)

I got the message when I'm doing the update. I haven't checked the
access right to the database yet. I will do that, at the same time,
could you please advise where can I look for those error messages
(i.e. S1000)?

Thank you.

Regards,
Calvin Chin



Fri, 28 Jan 2005 15:27:42 GMT  
 Can't Update Database using Fujitsu SQL command

Quote:

> Mike, I use MySQL 3.23.49a-max  with Fujitsu 6.1 & Powercobol.  The
> only error I get is 'S1C00' - Transactions not enabled.  I assume that
> my error is because I'm missing a config variable in the MySQL setup.
> I'm also using the Inno DB table type.

A Transaction Support error suggests the FJ/PowerCobol combo is using (the
equivalaent of, see below) explicit COMMIT and ROLLBACK statements, assuming
the DB both supports transactions and is not currently configured for
autocommit..

I have no idea how to do this in FJ/PowerCOBOL, but the SqlGetInfo API
supports a query for transaction support, a query for current autocommit
status (which may vary from connection to connection), and a function to
toggle the autocommit status (assuming the DBMS-driver combo supports this).

Your error sounds like FJ/PowerCOBOL EITHER...

1. Requires a DMBS-driver combo which supports transactions
OR
2. Assumes the above configuration and never attempts to adjust the
transaction handling on the connection, thus erroring out when issuing
SqlEndTran (the command issued to either COMMIT or ROLLBACK).

If you want to test your database, I have a little Win/32 program I wrote
which allows you to browse and select an ODBC data source and produce this
report (this one is against a Jet 4.0 driver/dbms):

06-04-2001                    ODBC DRIVER/DBMS REPORT
15:19:18

Connection String Attributes:
DSN=RA206
DBQ=C:\Software_Development\Testdata\remitaid\ra206.mdb
DriverId=25
FIL=MS Access
MaxBufferSize=2048
PageTimeout=5
UID=admin

Data Source Name:RA206
Database Name   :C:\Software_Development\Testdata\remitaid\ra206
DBMS Name       :ACCESS
DBMS Version    :04.00.0000
Driver Name     :ODBCJT32.DLL
Driver ODBC Ver :03.51

Supported Capabilities
Transactions (DML) : Y
CREATE TABLE       : Y
DROP   TABLE       : Y
ALTER  TABLE       : N
CREATE INDEX       : Y
DROP   INDEX       : Y
Nullable Columns   : N
Max Concurrent Stmt:  0 (Unable to determine)

           Datatypes Supported
 SQL Type     DBMS Literal     Column Size
 --------     ------------     -----------
     -11      GUID                     36
      -7      BIT                       1
      -6      BYTE                      3
      -4      LONGBINARY       1073741823
      -3      VARBINARY               510
      -2      BINARY                  510
      -1      LONGCHAR         1073741823
       1      CHAR                    255
       2      CURRENCY                 19
       4      INTEGER                  10
       4      COUNTER                  10
       5      SMALLINT                  5
       7      REAL                      7
       8      DOUBLE                   15
       9      DATETIME                 19
      12      VARCHAR                 255

*** END OF REPORT ***

This is not an "end-user-quality-user-proof" program, but you are welcome to
contact me via email and I'll send it to you to run against your MySQL DB -
PROVIDED.... you agree to send me the report (it's created as a text file)
to add to my collection. I have Jet, Oracle, SqlAnywhere, Paradox, Intersolv
and a few other DBMS reports, but strangely enough I do not have a report on
MySQL and I'd like one. (Yes, I would expect you to edit out the UID and PW
before sending the report file).

(Actually, I think I report a few more things in the current version of the
software).

--
Michael Mattias
Tal Systems, Inc.
Racine WI



Fri, 28 Jan 2005 19:52:03 GMT  
 Can't Update Database using Fujitsu SQL command

Quote:


> > Mike, I use MySQL 3.23.49a-max  with Fujitsu 6.1 & Powercobol.  The
> > only error I get is 'S1C00' - Transactions not enabled.  I assume that

> Do you mean that the only thing that you get is this error, or are you
> saying that it all works fine except you get this error ?

It works fine, with the exception of being stuck in "auto-commit" mode
where every statement is automatically executed after each SQL
statement.  For the current project, this is temporarily acceptable.
I simply screen out this error.

Katie



Fri, 28 Jan 2005 20:40:57 GMT  
 Can't Update Database using Fujitsu SQL command

Quote:

>could you please advise where can I look for those error messages
>(i.e. S1000)?

>In your de{*filter*} set SQLSTATE/ SQLMSG/SQLINFOA to data-watch an it >
> >willhelp you.

Calvin you didn't read my first reply, which was your answer! Query
your 01 SQLMSG pic x(128) Compiler-System-Variable which is between
your Working-strorage Exec****Declare statement.

Quote:
>I'm using PostgreSQL in *Linux server*. I'm using PowerCOBOL v6.1 as

Linux and PowerCOBOL? To establish functionality between the
PowerCOBOL (or any compiler), your need to setup PostgreSQL on your
developmental PC for simplicity, or is this an error statement? S1000
S/b user or password access denied, however depending when this
message occurred then there may be hope? Try take out all update
statements and do a simple read, if no error occurs after your connect
statement then your problem may be your update privileges? If you
successfully connect to PostgreSQL with read-only please post so here
as I will try it too. I almost bought a 2 year Oracle9i developers
license for $114, but who uses it for WWW/linux?

Richard: Kay and I cannot can not connect to MySql because a S1coo
error terminates the rest of Sql statements as there is no
communication between the MySql-ODBC and FSC crappy support for other
than M$ drivers. Does anyone make a runtime free COBOL compiler than
works with Linux, web-SQLs and CGI as your cannot charge a trial
download customer $ or add $1k runtime fee for a simple $20-50 web
product, or am I just trying to drill a hole with a hammer? Mike



Sat, 29 Jan 2005 02:20:20 GMT  
 Can't Update Database using Fujitsu SQL command
Katie I am confused by your statement below.
Quote:
>  It works fine, with the exception of being stuck in "auto-commit" mode
> where every statement is automatically executed after each SQL
> statement.  For the current project, this is temporarily acceptable.
> Simply screen out this error.

Do you mean you can fetch, read, update MySql data after you receive a
connect error message sc1c00'? Because I can't! If this is so please
look at my COBOL source code/ age.inf file in above reply and see if
you see my error? Or do you have a simple example you can post here or
email me if you like, as tutorials on FSC 6.1 to MySql don't exist. I
am new to COBOL RDBMS and only wish to use Windows/MySql/COBOL for
debugging to deploy to Linux and can live with a display error during
testing. Thanks Mike.


Sat, 29 Jan 2005 07:51:43 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Using SQL Update Instead of Clarion's Update

2. Using CGI module with 'canned queries'

3. SQL Fujitsu's COBOL V.3

4. using menu ring to select data out of database with SQL

5. I need some idea using Python with SQL / Access database

6. I need some idea using Python with SQL / Access database

7. Tcl/Tk 'update idletasks' command

8. SQL: Create the database on customer's computer

9. Selecting the first row in a table using SQL & updating a particular column in a SQL 2000 database

10. It's not bad canned meat...

11. It's not bad canned meat...

12. It's not bad canned meat...

 

 
Powered by phpBB® Forum Software