Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    Lima-Peru
    Posts
    7

    Unanswered: 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;

  2. #2
    Join Date
    Apr 2004
    Location
    Lima-Peru
    Posts
    7

    Re: what is wrong whis this sp?

    nobody wants to help?

  3. #3
    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)

    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;

  4. #4
    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

  5. #5
    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

Posting Permissions

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