Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Iam getting DBSQL_ARGUMENT_ERROR

yasu_1096
Explorer

Hi all,

Iam microsoftteams-image-4.png getting this error in the SQL message error as Number of Maximum input host variables (32768) exceed to 50987

can anyone please help out from this error what is course of action need to taken to resolve this ?

1 ACCEPTED SOLUTION

Abhishek_10
Participant
0 Kudos

Reduce the value of p_count and check. Hopefully this will work.

9 REPLIES 9

Abhishek_10
Participant
0 Kudos

Can you show me your select query code

yasu_1096
Explorer

abhishekchatt8240

Please refer this code i had written in my code iam getting the error on where clause

abhishekchatt8240

OPEN CURSOR WITH HOLD gv_cur FOR
SELECT * FROM (p_p_tab) WHERE (gt_dyn_where).
FETCH NEXT CURSOR gv_cur
INTO TABLE <fs_dynamic_tab> PACKAGE SIZE p_count.
IF sy-subrc <> 0.
CLOSE CURSOR gv_cur.
EXIT.

ENDIF.

yasu_1096
Explorer
0 Kudos

abhishekchatt8240

Please refer this code i had written in my code iam getting the error on where clause

abhishekchatt8240

OPEN CURSOR WITH HOLD gv_cur FOR
SELECT * FROM (p_p_tab) WHERE (gt_dyn_where).
FETCH NEXT CURSOR gv_cur
INTO TABLE <fs_dynamic_tab> PACKAGE SIZE p_count.
IF sy-subrc <> 0.
CLOSE CURSOR gv_cur.
EXIT.

ENDIF.

0 Kudos

what is the value of p_count?

Abhishek_10
Participant
0 Kudos

Reduce the value of p_count and check. Hopefully this will work.

0 Kudos

Thanks

Abhishek Chatterjee

Now it working fine thanks for your valuable support

0 Kudos

yasu_1096 In the end, could you tell us the old value of P_COUNT, and which new value works?

Sandra_Rossi
Active Contributor
0 Kudos

You may edit your question by menu Actions > Edit.

1) Better paste the text for better indexing.

DBSQL_ARGUMENT_ERROR

CX_SY_OPEN_SQL_DB

[ASE Error SQL2]ERROR: Number of maximum input host variables (32768) exceeded: 50897.

2) If not, at least embed the image rather than a hyperlink to an image.

Like this:

3) Paste your code with button [CODE] to indent and colorize it (for better reading it):

OPEN CURSOR WITH HOLD gv_cur FOR
    SELECT * FROM (p_p_tab) WHERE (gt_dyn_where).
    FETCH NEXT CURSOR gv_cur
    INTO TABLE <fs_dynamic_tab> PACKAGE SIZE p_count.
IF sy-subrc <> 0.
  CLOSE CURSOR gv_cur.
  EXIT.
ENDIF.

Sandra_Rossi
Active Contributor
0 Kudos

I feel that it's related to the contents of GT_DYN_WHERE. It possibly refers to a ranges table ("IN ranges_table") with many lines, which are transformed by the ASE database engine into host variables.

You may also contact SAP support (I couldn't find a SAP note).