Topic
1 reply Latest Post - ‏2013-04-22T18:53:01Z by krmilligan
fxnml
fxnml
1 Post
ACCEPTED ANSWER

Pinned topic FiledProcedures with C

‏2013-04-17T18:16:53Z |

Hello I am trying to implement a fieldProcedure using C.

I have alraedy made this steps:

  • Create a new Library: CRTLIB   LIB(PROGRAMS)
  • Create a source file : CRTSRCPF FILE(PROGRAMS/MYSRC)
  • Use STRPDM to create a member
  • Use option 15 to compile a module
  • Create the program: CRTPGM PGM(PROGRAMS/FP1) MODULE(PROGRAMS/FP1) ACTGRP(*CALLER)

Everything seems to be fine, but when I run the SQL command to alter the table I got errors:

ALTER TABLE FXN.employee ALTER SALARY SET FIELDPROC 'PROGRAMS/FP1(10)'  ----->  SQL0682

ALTER TABLE FXN.employee ALTER SALARY SET FIELDPROC PROGRAMS/FP1(10)   ----->  SQL5016

ALTER TABLE FXN.employee ALTER SALARY SET FIELDPROC PROGRAMS.FP1(10)     ---->  SQL0901

Can you give some advice of what I am missing.

Thank you!

  • krmilligan
    krmilligan
    352 Posts
    ACCEPTED ANSWER

    Re: FiledProcedures with C

    ‏2013-04-22T18:53:01Z  in response to fxnml

    Since you are using SQL Naming for the ALTER TABLE statement, the last statement contains the proper syntax.  SQL0901 usually indicates a defect in the IBM i operating system causing an error.  Before reporting the error to IBM Support, you should first verify that you have a recent version of the 7.1 Database Group PTF installed on your system. 


    You might want to verify your code with the C example in this article:

    http://www.ibm.com/developerworks/data/library/techarticle/dm-1101encryptenhance/index.html