Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Posts
    3

    Red face Unanswered: Inquiry of Creating Procedure in Informix 10

    I am facing some difficulty to use procedure in IBM Informix 10 database.

    When I creating a new procedure, I need to specify the return datatype(bold) :-

    --------------------------------------------------------------------------
    CREATE FUNCTION gl_contingent_get()
    RETURNING VARCHAR(2) as contingent_id,VARCHAR(20) as contingent_name

    DEFINE v_contingent_id VARCHAR(2);
    DEFINE v_contingent_name VARCHAR(20);
    --------------------------------------------------------------------------

    I would like to know is it any method able to refer column datatype rather than specify each.

    For example in Oracle, we can use TableName.ColumnName%Type to refer particular datatype of a column.



    Thank you.

  2. #2
    Join Date
    Apr 2007
    Location
    Jundiai / SP - Brasil
    Posts
    311
    Unfortunately i think this is not possible...

    What you can do is create distinct data types and uses them...
    ________________________________________
    César Inacio Martins
    Jundiai / SP - Brasil
    http://www.imartins.com.br/informix - em Português
    http://www.imartins.com.br/informix - English (translated by Google).
    ________________________________________

  3. #3
    Join Date
    Jan 2008
    Posts
    3
    Thanks for you reply.
    ceinma, what do you mean "create distinct data types" ?

  4. #4
    Join Date
    Apr 2007
    Location
    Jundiai / SP - Brasil
    Posts
    311
    Code:
    create distinct type myDataType_cod as integer
    ;
    create distinct type myDataType_txt as char(100)
    ;
    create table xyz (
      cod   myDataType_cod,
      txt     myDataType_txt
    );
    
    create function xyz() returning myDataType_cod as COD , myDataType_txt as TXT
    ...
    ..
    ________________________________________
    César Inacio Martins
    Jundiai / SP - Brasil
    http://www.imartins.com.br/informix - em Português
    http://www.imartins.com.br/informix - English (translated by Google).
    ________________________________________

Posting Permissions

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