|
Dieses Gerät hat auch andere Anweisungen:
Anleitung Zusammenfassung
/*
set
up
SQLDA
fields
*/
sqlda.sqlnrow
=
MaxNbrColumns;
4
5
31
sqlda.sqlbuflen
=
sizeof(ColumnList);
sqlda.sqlrowbuf
=
ColumnList;
/*
Get
Column
List
from
SYSTEM.COLUMN
*/
EXEC
SQL
FETCH
ColumnList
USING
DESCRIPTOR
SQLDA;
4
5
32
if
(sqlca.sqlcode
!=
OK)
{
printf("\n
Problem
encountered
when
reading
SYSTEM.COLUMN!");
EXEC
SQL
SQLEXPLAIN
:SQLMessage;
printf("%s\n",SQLMessage);
goto
a9999;
}
switch
(TableList[i].LockMode)
{
4
5
33
case
1:
sprintf(OneLine,"\nCREATE
PUBLICREAD
");
break;
case
2:
sprintf(OneLine,"\nCREATE
PRIVATE
");
break;
case
3:
sprintf(OneLine,"\nCREATE
PUBLIC
");
break;
default:
sprintf(OneLine,"\nUnrecognized
Lock
Mode
");
break;
}
/*
end
switch
*/
sprintf(OneLine+strlen(OneLine),"TABLE
%s.%s
",OwnerName,TableName);
write(FileNum,OneLine,strlen(OneLine));
4
5
34
for
(j
=
0;
j
<
sqlca.sqlerrd[2];
j++)
{
ColumnList[j].ColName[19]
=
'\0';
strcpy(ColumnName,ColumnList[j].ColName);
if
(j==0)
sprintf(OneLine,"\n
(%s
",ColumnName);
else
sprintf(OneLine,"\n
(%s
",ColumnName);
switch
(ColumnList[j].TypeCode)
{
4
5
35
case
0:
if
(ColumnList[j].Length
==
4)
{
sprintf(OneLine+strlen(OneLine),"INTEGER
");
}
else
sprintf(OneLine+strlen(OneLine),"SMALLINT
");
break;
case
2:
case
8:
sprintf(OneLine+strlen(OneLine),"CHAR(
%2d
)",\
ColumnList[j].Length);
break;
Figure
8-12.
Program
cex10b:
Dynamic
Queries
of
Kno
wn
Format
(page
6
of
7)
8-52
Using
Dynamic
Operations
...Dieses Handbuch ist für folgende Modelle:
Software - MPE/iX 6.5 Operating System (1.21 mb)
Software - MPE/iX 7.0 Operating System (1.21 mb)
Software - MPE/iX 7.5 Operating System (1.21 mb)