Nonstop Database, HiRDB Version 9 UAP Development Guide
When a UAP is created, the labelling rules, SQL coding rules, and SQL syntax rules must be followed.
Labels must be assigned according to the C language rules. These types of labels cannot be used:
For naming embedded variables, indicator variables, and branching destination labels, the labeling and the C language rules must be followed.
EXEC SQL SQL-statement;
#define X USER.MEMBER EXEC SQL SELECT NAME INTO MANNAME FROM X;
EXEC SQL SELECT MEM INTO :NAME FROM TABLE;
exec sql select MEM into :NAME from TABLE;
exec SQL SELECT MEM Into :NAME From TABLE;
EXEC SQL BEGIN DECLARE SECTION; ... EXEC SQL END DECLARE SECTION; EXEC SQL SELECT... ;
EXEC SQL
BEGIN
DECLARE SECTION;
:
EXEC SQL
END
DECLARE SECTION;
EXEC \
SQL
SELECT ... ;EXEC SQL
BEGIN DECLARE SECTION;
short SALES;
EXEC SQL
END DECLARE SECTION;
...
EXEC SQL
SELECT PRICE INTO :SALES
FROM TABLE;short SALES,
QUANTITY;
short SALES; short QUANTITY;Table 7-1 Items that can be described in an embedded SQL declaration section
| Described Item | Description within embedded declaration |
|---|---|
| Note | D |
| C language instruction statement | -- |
| C language control statement | -- |
| SQL statement | -- |
| Embedded variable declaration | D |
| Indicator variable declaration | D |
short SALES, QUANTITY; 1 short XSALES, XQUANTITY; 2
Table 7-2 Locations where SQL statements can be described
| Description location within a line | SQL statement description | |
|---|---|---|
| C language and instruction statement | Front | -- |
| Middle | -- | |
| Back | -- | |
| C language control statement | Front | -- |
| Middle | -- | |
| Back | -- | |
| Label | Front | -- |
| Back | D | |
| Comments | Front | D |
| Middle | -- | |
| Back | D | |
| SQL statement# | Front | -- |
| Middle | -- | |
| Back | -- | |
#include <afx.h> EXEC SQL INCLUDE HIRDB_HEADERS ;
| Usage | Processing | Environment#1 | Reserved words |
|---|---|---|---|
| Type qualifier or type specifier#2 | Treated as a type qualifier or type specifier during syntax analysis | Windows | __int8,__int16,__int32, __int64,_int8,_int16, _int32,_int64 |
| UNIX | __volatile__, __builtin_va_list, __complex__, __signed__ |
||
| Other | Ignored because the word is treated during syntax analysis as meaningless | Windows | __based,__cdecl, __export,__far, __fastcall, __forceinline, __inline,__near, __pascal,__ptr32, __ptr64,__stdcall, __unaligned,__w64, _based,_cdecl, _export,_far,_fastcall, _forceinline,_inline, _near,_pascal, _stdcall__declspec, __pragma, _declspec__try, __except, __finally__asm,_asm |
| UNIX | __const,__const__, __extension__, __inline,__inline__, __restrict, __attribute__, __asm__ |
All Rights Reserved. Copyright (C) 2011, Hitachi, Ltd.