db2 - Using @ on Variable Names -


googling i've found db2 function declaration:

create function qgpl.split (  @data     varchar(32000),  @delimiter varchar(5) ) 

whats means @ symbol before variable name?

regards,

pedro

the @ character first character of sql identifier [variable name] naming parameter defined arguments of user defined function (udf); reformatted [because @ first glance thought revision might make at-symbols appear more conspicuously part of name, though think not]:

 create function qgpl.split  ( @data      varchar(32000)  , @delimiter varchar(5)  ) returns ... 

put simply, use of @ character in identifier highly discouraged; use of such variant characters, although supported in standard object naming, can cause great pains , difficulties, including insurmountable:

http://www.ibm.com/support/knowledgecenter/api/content/ssw_ibm_i_71/db2/rbafzch2iden.htm

identifiers
identifier token used form name. identifier in sql statement sql identifier, system identifier, or host identifier. note: $, @, #, , other variant characters should not used in identifiers because code points used represent them vary depending on ccsid of string in contained. if used, unpredictable results may occur. [...]

[edit-addendum 17may2015]

http://www.ibm.com/support/knowledgecenter/api/content/nl/en-us/ssepgg_10.5.0/com.ibm.db2.luw.admin.dbobj.doc/doc/c0004625.html

naming rules in multiple national language environment
basic character set can used in database names consists of single-byte uppercase , lowercase latin letters (a…z, a…z), arabic numerals (0…9) , underscore character (_).

list augmented 3 special characters (#, @, , $) provide compatibility host database products. use special characters #, @, , $ care in multiple national language environment because not included in multiple national language host (ebcdic) invariant character set. characters extended character set can used, depending on code page being used. if using database in multiple code page environment, must ensure code pages support elements extended character set plan use. [...]

[/edit-addendum 17may2015]


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -