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 > variable base substring

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-04, 10:41
localt localt is offline
Registered User
 
Join Date: Mar 2004
Posts: 16
variable base substring

Hi all,

I am trying to write a procedure to decode a message, but I'm running into a problem when I'm doing substring based on variable holding the start position or variable holding the length. I'm doing the following:

CREATE PROCEDURE (code VARCHAR(100))
DEFINE xi INTEGER;
DEFINE tag CHAR(4);
LET xi = 1;
LET tag = ex_emv_params[xi,4];
END PROCEDURE

When I run it I get a syntax error (-201) on the LET tag = ex_emv_params[xi,4]; line (where xi is present). If I change the xi to 1 it works....
Anyone knows work around?

Thanks,

Tal
Reply With Quote
  #2 (permalink)  
Old 06-03-04, 11:15
gurey gurey is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 780
Hi,

Please test:

CREATE PROCEDURE (code VARCHAR(100))
RETURNING varchar(4);
DEFINE xi INTEGER;
DEFINE tag CHAR(4);
LET xi = 1;
LET tag = substr(ex_emv_params,xi,4);
RETURN tag
END PROCEDURE

Gustavo.
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