Home > OS >  I am trying to connect HPLSQL with postgresql db
I am trying to connect HPLSQL with postgresql db

Time:10-13

The MAP OBJECT log TO gpadmin. Hive_task_log AT postgresql;

DECLARE
Start_time VARCHAR (20);
End_time VARCHAR (20);
Return_code INT.
The BEGIN
Start_time=SYSDATE | | ';
SELECT COUNT (1) FROM the default. Zhou_m;
Return_code=SQLCODE;
End_time=SYSDATE | | ';
INSERT INTO the log (` start_time `, ` end_time `, ` return_code `)
VALUES (start_time, end_time, return_code);
EXCEPTION WHEN OTHERS THEN
Return_code=SQLCODE;
End_time=SYSDATE | | ';
INSERT INTO the log (` start_time `, ` end_time `, ` return_code `)
VALUES (start_time, end_time, return_code);
DBMS_OUTPUT. PUT_LINE (' the execute SQL error, return code: '| | return_code);
END

When I running this query I am getting syntax error like
Org. Postgresql. Util. PSQLException: ERROR: syntax ERROR at or near "TABLE"
The at org. Postgresql. Core. The v3. QueryExecutorImpl. ReceiveErrorResponse (QueryExecutorImpl. Java: 1548)
The at org. Postgresql. Core. The v3. QueryExecutorImpl. ProcessResults (QueryExecutorImpl. Java: 1316)
The at org. Postgresql. Core. The v3. QueryExecutorImpl. Execute (QueryExecutorImpl. Java: 191)
The at org. Postgresql. Jdbc2. AbstractJdbc2Statement. Execute (AbstractJdbc2Statement. Java: 452)
The at org. Postgresql. Jdbc2. AbstractJdbc2Statement. ExecuteWithFlags (AbstractJdbc2Statement. Java: 337)
The at org. Postgresql. Jdbc2. AbstractJdbc2Statement. Execute (AbstractJdbc2Statement. Java: 329)
The at org. Apache. Hive. HPLSQL. Conn. The executeSql (Conn. Java: 110)
The at org. Apache. Hive. HPLSQL. Exec. The executeSql (Exec. Java: 596)
The at org. Apache. Hive. HPLSQL. Stmt. InsertValues (Stmt. Java: 800)
The at org. Apache. Hive. HPLSQL. Stmt. Insert (713) Stmt. Java:
The at org. Apache. Hive. HPLSQL. Exec. VisitInsert_stmt (Exec. Java: 1120)
The at org. Apache. Hive. HPLSQL. Exec. VisitInsert_stmt (Exec. Java: 52)
The at org. Apache. Hive. HPLSQL. HplsqlParser $Insert_stmtContext. Accept (HplsqlParser. Java: 10316)
The at org. Antlr. V4. Runtime. Tree. AbstractParseTreeVisitor. VisitChildren (AbstractParseTreeVisitor. Java: 70)
The at org. Apache. Hive. HPLSQL. Exec. VisitStmt (Exec. Java: 1013)
The at org. Apache. Hive. HPLSQL. Exec. VisitStmt (Exec. Java: 52)
The at org. Apache. Hive. HPLSQL. HplsqlParser $StmtContext. Accept (HplsqlParser. Java: 1011)
The at org. Antlr. V4. Runtime. Tree. AbstractParseTreeVisitor. VisitChildren (AbstractParseTreeVisitor. Java: 70)
The at org. Apache. Hive. HPLSQL. HplsqlBaseVisitor. VisitBlock (28) HplsqlBaseVisitor. Java:
The at org. Apache. Hive. HPLSQL. HplsqlParser $BlockContext. Accept (HplsqlParser. Java: 448)
The at org. Antlr. V4. Runtime. Tree. AbstractParseTreeVisitor. Visit (AbstractParseTreeVisitor. Java: 42)
The at org. Apache. Hive. HPLSQL. Exec. VisitException_block_item (Exec. Java: 1147)
The at org. Apache. Hive. HPLSQL. Exec. VisitException_block_item (Exec. Java: 52)
The at org. Apache. Hive. HPLSQL. HplsqlParser $Exception_block_itemContext. Accept (HplsqlParser. Java: 1597)
The at org. Antlr. V4. Runtime. Tree. AbstractParseTreeVisitor. VisitChildren (AbstractParseTreeVisitor. Java: 70)
The at org. Apache. Hive. HPLSQL. HplsqlBaseVisitor. VisitException_block (HplsqlBaseVisitor. Java: 77)


Both please help me to resolve this issue
  • Related