Hi,
Using the document below, I was able to perform select/update/insert using rm/cobol to Postgres Database in linux.
https://www.microfocus.com/documentation/rm-cobol/1214/ISQLhelp/InstantSQLTableOfContents.htm
However, I am unable to create a table or drop a table using InstantSql. Below are the errors I see. I am unable to see any sample in the document above.
1.drop table
*********prepare query
MOVE "drop table persons1"
TO sql-QrySQL
SQL PREPARE QUERY sql-QueryHandle,
sql-ConnectionHandle,
sql-QrySQL.
IF NOT sql-OK
display "UNSUCCESFUL PREPARE!!!"
PERFORM WITH TEST AFTER UNTIL sql-EndOfData
SQL DESCRIBE ERROR
sql-Error-Description
IF NOT sql-EndOfData
PERFORM DISPLAY-ERROR-INFO
END-IF
END-PERFORM
GO TO Z
END-IF
*********start query
SQL START QUERY sql-QueryHandle.
IF NOT sql-OK
display "UNSUCCESFUL START!!!"
PERFORM WITH TEST AFTER UNTIL sql-EndOfData
SQL DESCRIBE ERROR
sql-Error-Description
IF NOT sql-EndOfData
PERFORM DISPLAY-ERROR-INFO
END-IF
END-PERFORM
GO TO Z
END-IF
**********Compilation success. But while running,
UNSUCCESFUL START!!!
Err Msg ERROR: syntax error at or near "drop" at character 29;
Error while executing the query
Err TypO
Err statement SQLExecute
ErrsqlSate HY000
err no {00007
2.table creation
*********prepare query
MOVE "CREATE TABLE Persn2(PersonID int)"
TO sql-QrySQL
SQL PREPARE QUERY sql-QueryHandle,
sql-ConnectionHandle,
sql-QrySQL.
UNSUCCESFUL START!!!
Err Msg ERROR: syntax error at or near "create" at character 28;
Error while executing the query
Err TypO
Err statement SQLExecute
ErrsqlSate HY000
err no {00007
However I am able to do these directly to my postgres database in linux.