How to use CALLDBPROC

Hi everyone,

I am trying to use CALLDBPROC on Windows and Unix and I have some problems (and doubts).

I have installed Natural 611 PL17, Entire Access 531 and Oracle 10g.

The application is using the statement standard, i.e., besides CALLDBPROC, the options: RESULT SETS and GIVING.

  1. The CALLDBPROC requires to use a DDM to address, but what this address means? Do I need to generate the DDM from the Oracle database? I have generated the DDM manually, and it seems that it worked. I just have definied on NATPARM the DBID to access Oracle.

  2. On CALLDBPROC statement, as I said, I am using RESULT SETS and GIVING options, but doesn’t matter the amount of the records that I access, an error -24333 occours. However, if I take out the options (Result sets and Giving) and the amount of the records is only one, the record is recoveried.

Do I using the statement correctly? Does anyone have any hint to use this statement?

I would appreciate it a lot if anyone could help me.

Thanks

Regards.

Hello xpto,

ad 1)
The DDM is the connection between your Natural application and the database. Especially, the DDM contains the DBID that refers to your NATPARM entry. So even if you do not use any of the fields from a DDM you’ll always need one to access the database.
Please ensure that you have your DBID defined properly in the NATPARM configuration utility together with a valid connect string. It is always a bad idea to create a DDM by hand, so try to generate one.

ad 2) It is not fully clear to me what you are going to do. Can you provide a small code fragment?

Gyro

Hi Gyro,

In this particular case, I have permission to access the file, but it seems that this file is hidden (when I try to generate the DDM), so, I must access the file using stored procedure. The NATPARM is already set to access Oracle databases.

You will be able to see below, an example how I am using CALLDBPROC.

DEFINE DATA LOCAL
1 ORAEMPL VIEW OF HR-EMPLOYEES
2 EMPLOYEE_ID
2 FIRST_NAME
2 LAST_NAME
2 EMAIL
01 #ID (N06)
01 #ORACLE
2 #FIRSTNAME (A20)
2 #LASTNAME (A25)
2 #EMAIL (A25)
*
01 #RESPONSE (I04)
01 #RESULT (I04) INIT<0>
*
END-DEFINE
*
CALLDBPROC ‘HR.RESULTSET1’ HR-EMPLOYEES
#FIRSTNAME (AD=A)
#LASTNAME (AD=A)
#EMAIL (AD=A)

  • RESULT SETS #RESULT
  • GIVING #RESPONSE

READ RESULT SET #RESULT INTO VIEW ORAEMPL FROM HR-EMPLOYEES
GIVING #RESPONSE
WRITE ‘RESULT SET…’ #RESULT #RESPONSE EMPLOYEE_ID FIRST_NAME
END-RESULT
PRINT #RESULT #RESPONSE ORAEMPL
*
END


If I have just one record and I take out the options RESULT SET and GIVING, I don’t have problem to get the record, it work, but if I have more than one record, I recieve an error -24333.

Do you have any idea how I can solve it?

Thanks, regards.

Have you fixed this issue?