Skip to content

set and reuse variables locally in sqlpage #49

@f8dca

Description

@f8dca

Would it be possible to add support to declaring local SQL variables and setting their value ?
something along these lines:

declare @max_inv varchar(10) ;
set  @max_inv = func_getMaxInv(); --this is a scalar function to get the latest invoice number

SELECT 'table' as component

select [id] , [invoice_no], [invoice_date], [cust_no] 
from SALES_HISTORY 
where invoice_no = isnull($invoice_no, @max_inv)

This snippet should either show the invoice passed in the parameter or the last one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions