docs.intersystems.com
Home / Class Definition Reference / Method Keywords / SqlName

Class Definition Reference
SqlName
Previous section           Next section
InterSystems: The power behind what matters   
Search:  


Overrides the default name of the projected SQL stored procedure. Applies only if this method is projected as an SQL stored procedure.
Usage
To override the default name used when the method is projected as an SQL stored procedure, use the following syntax:
ClassMethod name(formal_spec) As returnclass [ SqlProc, SqlName = sqlname ] 
{    //implementation }
Where sqlname is an SQL identifier.
Details
If this method is projected as an SQL stored procedure, then this name is used as the name of the stored procedure.
Default
If you omit this keyword, InterSystems IRIS determines the SQL name as follows:
CLASSNAME_METHODNAME
This default uses uppercase letters. You can use any case when you invoke the stored procedure, however, because SQL is case-insensitive.
Thus, in the following example, the default SQL name value is TEST1_PROC1. This default value is specified in the SELECT statement:
Class User.Test1 Extends %Persistent
{
ClassMethod Proc1(BO,SUM) As %INTEGER [ SqlProc ]
{
   ///definition not shown
}

Query Q1(KD As %String,P1 As %String,P2 As %String) As %SqlQuery
{
  SELECT SUM(SQLUser.TEST1_PROC1(1,2)) AS Sumd
  FROM SQLUser.Test1
}
}
See Also


Previous section           Next section
View this book as PDF   |  Download all PDFs
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA
Content Date/Time: 2019-04-23 13:43:22