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 > what is wrong whis this sp?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-04, 14:01
amanriquem amanriquem is offline
Registered User
 
Join Date: Apr 2004
Location: Lima-Peru
Posts: 7
what is wrong whis this sp?

os--> linux red hat 8.0
imformix versions--> ids 9

when i try to create it , it return "SYNTAX ERROR"

body:

create
procedure sp_error_GetText(ni_NroError numeric(6))
returning lvarchar(300),
varchar(1),
numeric,
numeric,
lvarchar(300),
varchar(30); <---------------------- HERE APPEARS THE ERROR MESSAGE
--
define vo_Descripcion lvarchar(300);
define vo_Ind_usuario varchar(1);
define no_ret numeric,no_sqlcode;
define vo_sqlerrm lvarchar(300);
define vo_spname varchar(30);
--
begin
on exception set no_sqlcode, vo_sqlerrm
if no_sqlcode = 100 then
let no_ret = 1;
else
let no_ret = -1;
end if
end exception
--
let no_ret = 0;
let vo_spname = 'sp_error_GetText';
--
select des_error,
ind_mens_usuario
into vo_descripcion,
vo_Ind_usuario
from adm_error_dbms
where nro_error = ni_NroError;
--
return vo_Descripcion,
vo_Ind_usuario,
no_ret,
no_sqlcode,
vo_sqlerrm,
vo_spname;
end
end procedure;
Reply With Quote
  #2 (permalink)  
Old 04-20-04, 16:12
amanriquem amanriquem is offline
Registered User
 
Join Date: Apr 2004
Location: Lima-Peru
Posts: 7
Re: what is wrong whis this sp?

nobody wants to help?
Reply With Quote
  #3 (permalink)  
Old 04-21-04, 12:49
ljarratt ljarratt is offline
Registered User
 
Join Date: Apr 2004
Posts: 3
Re: what is wrong whis this sp?

numeric is the problem. That is not valid in Informix. Change it to the following if you want a specific number of digits.

procedure sp_error_GetText(ni_NroError decimal(6,0))

or if not, you can just use

procedure sp_error_GetText(ni_NroError integer)

Quote:
Originally posted by amanriquem
os--> linux red hat 8.0
imformix versions--> ids 9

when i try to create it , it return "SYNTAX ERROR"

body:

create
procedure sp_error_GetText(ni_NroError numeric(6))
returning lvarchar(300),
varchar(1),
numeric,
numeric,
lvarchar(300),
varchar(30); <---------------------- HERE APPEARS THE ERROR MESSAGE
--
define vo_Descripcion lvarchar(300);
define vo_Ind_usuario varchar(1);
define no_ret numeric,no_sqlcode;
define vo_sqlerrm lvarchar(300);
define vo_spname varchar(30);
--
begin
on exception set no_sqlcode, vo_sqlerrm
if no_sqlcode = 100 then
let no_ret = 1;
else
let no_ret = -1;
end if
end exception
--
let no_ret = 0;
let vo_spname = 'sp_error_GetText';
--
select des_error,
ind_mens_usuario
into vo_descripcion,
vo_Ind_usuario
from adm_error_dbms
where nro_error = ni_NroError;
--
return vo_Descripcion,
vo_Ind_usuario,
no_ret,
no_sqlcode,
vo_sqlerrm,
vo_spname;
end
end procedure;
Reply With Quote
  #4 (permalink)  
Old 04-21-04, 12:55
amanriquem amanriquem is offline
Registered User
 
Join Date: Apr 2004
Location: Lima-Peru
Posts: 7
thanks

thanks for your help.
i tried with

procedure sp_error_GetText(ni_NroError decimal(6))
.....
with the same error

but not with

procedure sp_error_GetText(ni_NroError decimal(6,0))

i'll try it
Reply With Quote
  #5 (permalink)  
Old 04-22-04, 07:31
pathri pathri is offline
Registered User
 
Join Date: Apr 2004
Location: zxczxczxc
Posts: 52
Change the numeric to decimal and do not specify the length for lvarchar columns.

returning lvarchar(300) as lvarchar.


Bye.
__________________
zxczxczc
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