Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2012
    Posts
    15

    Unanswered: length of cursor name in "DECLARE <cursor_name> CURSOR"

    Hi

    Could some one please share what is the maximum length of cursor name in DB2 9.7.6 as I am facing a strange issue.

    the below command runs fine with a specific id

    Code:
    DECLARE CLAIM_TXN_HIST_CURSOR CURSOR FOR SELECT * FROM EWH.CLAIM_TXN_HIST_NICHE_VIEW   ORDER BY COMPANY_NO,CLAIM_NO,TRAN_DT,TRAN_TM_REF,TXN_CD   WITH UR
    but gives the below error when run with my id

    Code:
    DB21034E  The command was processed as an SQL statement because it was not a
    valid Command Line Processor command.  During SQL processing it returned:
    SQL0104N  An unexpected token "DECLARE CLAIM_TXN_HIST_CURSOR  CURSOR FOR SELE"
    was found following "BEGIN-OF-STATEMENT".  Expected tokens may include:
    "<space>".  SQLSTATE=42601

    with some trial and error found that the below query which is same as above except the length of the cursor name (18 chars) works fine with my id.

    Code:
    DECLARE CLAIM_TXN__CURSOR1 CURSOR FOR SELECT * FROM EWH.CLAIM_TXN_HIST_NICHE_VIEW   ORDER BY COMPANY_NO,CLAIM_NO,TRAN_DT,TRAN_TM_REF,TXN_CD   WITH UR
    Any length above 18 seems to be a problem.
    This keeps me wonderin if the cursor name is a user id/group based configurable parameter.

    Thanks
    Zulfi

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    according the doc the limit is 128
    client level ?
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •