SQL Script with Progress JDBC

Posted by Rodrigo Dias on 15-Sep-2016 11:13

Hey Guys, 

I'm working in a script to run via JDBC and I want to use the command to declare a variable.

Ex.:

declare @cdn_funcionario int;
set @cdn_funcionario = ( select top 1 cdn_funcionario from PUB.hcm_int_success_evento where idIntegracao = '4066');

But I have a doubt if Progress JDBC recognizes the command "declare".

Could you help me?

All Replies

Posted by Brian K. Maher on 15-Sep-2016 11:18

Rodrigo,
 
You don’t say what version you are using nor do you say what language you are using JDBC with.
 
Given that, the SQL Development and SQL Reference manuals do not define a declare statement. Perhaps you are really trying to define a stored procedure.  If so, stored procedures are written in Java.
 
Brian

Posted by Rodrigo Dias on 15-Sep-2016 11:30

Sorry [mention:43713cf888d84bdcb3637e465ffa1de6:e9ed411860ed4f2ba0265705b8793d05]  !

I'm using JDBC driver from OpenEdge 10.2B and SQL Language in Squirell only to debug the code.

Posted by Brian K. Maher on 15-Sep-2016 11:40

Rodrigo,
 
I think your issue is really with how to use Squirell and unfortunately I have no experience with it.  Perhaps someone else does.
 
Brian

Posted by Rom Elwell on 15-Sep-2016 11:50

Rodrigo,

According to this KB, the DECLARE keyword should indeed work...

knowledgebase.progress.com/.../000035863

Posted by Rodrigo Dias on 15-Sep-2016 12:45

Thank you [mention:f501aa1c6ec240a7ae42d7a5ab50ee2a:e9ed411860ed4f2ba0265705b8793d05]  but I think DECLARE is not supported in JDBC.

Look: knowledgebase.progress.com/.../Is-it-possible-to-declare-a-variable-using-the-OpenEdge-SQL-language

Posted by marian.edu on 16-Sep-2016 02:44

That has really nothing to do with JDBC but with the SQL standard supported by the database vendor, ‘declare’ as in declare variable is a ‘procedural language’ thing (pl-sql, transact sql) and has nothing to do with the SQL standard hence not supported by OE SQL engine… we have the good old 4gl for that ;)


 
Marian Edu

Acorn IT 
+40 740 036 212

This thread is closed