If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Inquiry of Creating Procedure in Informix 10

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-24-08, 04:58
kent_plaza kent_plaza is offline
Registered User
 
Join Date: Jan 2008
Posts: 3
Red face 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.
Reply With Quote
  #2 (permalink)  
Old 01-24-08, 10:32
ceinma ceinma is offline
Registered User
 
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).
________________________________________
Reply With Quote
  #3 (permalink)  
Old 01-24-08, 21:48
kent_plaza kent_plaza is offline
Registered User
 
Join Date: Jan 2008
Posts: 3
Thanks for you reply.
ceinma, what do you mean "create distinct data types" ?
Reply With Quote
  #4 (permalink)  
Old 01-25-08, 06:23
ceinma ceinma is offline
Registered User
 
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).
________________________________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On