نمایش نتایج 1 تا 2 از 2

نام تاپیک: نوشتن Procedure در Firebird

  1. #1

    Smile نوشتن Procedure در Firebird

    با سلام
    دوستان عزیز من با جستجو به نتیجه ای نرسیدم لطفا اگر کسی کار کرده طریقه نوشتن Procedure رو در Firebird بگه

    ممنون

  2. #2
    کاربر دائمی آواتار SayeyeZohor
    تاریخ عضویت
    اسفند 1387
    محل زندگی
    ا-ص-ف-ه-ا-ن
    پست
    631

    نقل قول: نوشتن Procedure در Firebird


    Syntax:


    CREATE PROCEDURE procname
    [(<inparam> [, <inparam> ...])]
    [RETURNS (<outparam> [, <outparam> ...])]
    AS
    [<declarations>]
    BEGIN
    [<PSQL statements>]
    END


    <inparam> ::= <param_decl> [{= | DEFAULT} value]
    <outparam> ::= <param_decl>
    <param_decl> ::= paramname <type> [NOT NULL] [COLLATE collation]
    <type> ::= sql_datatype | [TYPE OF] domain
    <declarations> ::= See PSQL::DECLARE for the exact syntax


    /* If sql_datatype is a string type, it may include a character set */














    Example:


    create domain bool3
    smallint
    check (value is null or value in (0,1));


    create domain bigposnum
    bigint
    check (value >= 0);


    /* Determines if A is a multiple of B: */
    set term #;
    create procedure ismultiple (a bigposnum, b bigposnum)
    returns (res bool3)
    as
    declare ratio type of bigposnum; -- ratio is a bigint
    declare remainder type of bigposnum; -- so is remainder
    begin
    if (a is null or b is null) then res = null;
    else if (b = 0) then
    begin
    if (a = 0) then res = 1; else res = 0;
    end
    else
    begin
    ratio = a / b; -- integer division!
    remainder = a - b*ratio;
    if (remainder = 0) then res = 1; else res = 0;
    end
    end#
    set term ;#Example:


    create domain bool3
    smallint
    check (value is null or value in (0,1));


    create domain bigposnum
    bigint
    check (value >= 0);


    /* Determines if A is a multiple of B: */
    set term #;
    create procedure ismultiple (a bigposnum, b bigposnum)
    returns (res bool3)
    as
    declare ratio type of bigposnum; -- ratio is a bigint
    declare remainder type of bigposnum; -- so is remainder
    begin
    if (a is null or b is null) then res = null;
    else if (b = 0) then
    begin
    if (a = 0) then res = 1; else res = 0;
    end
    else
    begin
    ratio = a / b; -- integer division!
    remainder = a - b*ratio;
    if (remainder = 0) then res = 1; else res = 0;
    end
    end#
    set term ;#


تاپیک های مشابه

  1. مشکل در نوشتن procedure stodure
    نوشته شده توسط salmah در بخش ASP.NET Web Forms
    پاسخ: 1
    آخرین پست: یک شنبه 18 خرداد 1393, 12:42 عصر
  2. نوشتن stored procedure با مقدار بازگشتی
    نوشته شده توسط steager64 در بخش SQL Server
    پاسخ: 3
    آخرین پست: یک شنبه 15 اردیبهشت 1387, 11:40 صبح
  3. نوشتن و صدا زدن procedure
    نوشته شده توسط moohssenn در بخش برنامه نویسی در Delphi
    پاسخ: 5
    آخرین پست: جمعه 13 بهمن 1385, 15:43 عصر
  4. نوشتن Procedure در Access
    نوشته شده توسط razaghi در بخش Access
    پاسخ: 0
    آخرین پست: دوشنبه 15 خرداد 1385, 21:27 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •