# How to use CALLDBPROC

**URL:** <https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux, Natural-Database-Interfaces-on-Open-Systems\
**Created:** [October 10, 2006, 12:16am UTC](https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571 "2006-10-10T00:16:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![half-time](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@half-time](https://techcommunity.softwareag.com/u/half-time)\
**Post date:** [October 10, 2006, 12:16am UTC](https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571/1 "2006-10-10T00:16:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gyro\_Gearloose](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@Gyro\_Gearloose](https://techcommunity.softwareag.com/u/Gyro_Gearloose)\
**Post date:** [October 11, 2006, 4:47pm UTC](https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571/2 "2006-10-11T16:47:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![half-time](https://avatars.discourse-cdn.com/v4/letter/h/b38774/32.png) [@half-time](https://techcommunity.softwareag.com/u/half-time)\
**Post date:** [October 11, 2006, 6:58pm UTC](https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571/3 "2006-10-11T18:58:45Z")

</div>

Hi Gyro,

> [@](#):
>
> 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.

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.

> [@](#):
>
> It is not fully clear to me what you are going to do. Can you provide a small code fragment?

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.

---

<div class="post-metadata">

**Author:** ![Kevin\_Brown1](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@Kevin\_Brown1](https://techcommunity.softwareag.com/u/Kevin_Brown1)\
**Post date:** [May 16, 2012, 5:33pm UTC](https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571/4 "2012-05-16T17:33:06Z")

</div>

Have you fixed this issue?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/how-to-use-calldbproc/61571/5 "2021-04-02T14:40:53Z")

</div>

Closed on April 2, 2021, 2:40pm UTC


