Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
test3b.ec
Package: gnusql-0.7b5.1.tar.gz [view]
Upload User: dgyhgb
Upload Date: 2007-01-07
Package Size: 676k
Code Size: 2k
Category:
SQL Server
Development Platform:
Unix_Linux
- /*
- * $Id$
- *
- * This file is a part of GNU SQL Server
- *
- * Copyright (c) 1996, Free Software Foundation, Inc
- * Developed at Institute of System Programming of Russian Academy of Science
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Contacts: gss@ispras.ru
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include "tests.h"
- int
- main(int argc, char *argv[])
- {
- char COLNAME[20];
- int UNTABID,tab;
- short COLNO;
- short NCOLS;
- int NROWS;
- int NNULCOLNUM;
- char TABNAME[20];
- tab = 3;
- if(argc>1)
- tab = atoi(argv[1]);
- $ WHENEVER SQLERROR GOTO errexit;
- $ DECLARE CURS3 CURSOR FOR
- (SELECT COLNAME, UNTABID, COLNO
- FROM DEFINITION_SCHEMA.SYSCOLUMNS
- WHERE
- UNTABID = :tab and COLNO < 2
- )
- ;
- $ DECLARE CURST CURSOR FOR
- (SELECT UNTABID, TABNAME, NCOLS,NROWS, NNULCOLNUM
- FROM DEFINITION_SCHEMA.SYSTABLES
- )
- ;
- $ WHENEVER NOT FOUND GOTO exitt;
- $ open CURST;
- printf("n|--------------------------------------------|n");
- while(1)
- {
- $ fetch CURST into :UNTABID, :TABNAME, :NCOLS,:NROWS, :NNULCOLNUM;
- printf("| %3d | %18s | %3d | %3d | %3d |n",
- UNTABID, TABNAME, NCOLS,NROWS, NNULCOLNUM);
- }
- exitt:
- printf("|--------------------------------------------|n");
- fprintf(stderr,"End of Table SYSTABLESn");
- $ close CURST;
- $ WHENEVER NOT FOUND GOTO exit3;
- $ open CURS3;
- printf("n|--------------------------------|n");
- while(1)
- {
- $ fetch CURS3 into :COLNAME, :UNTABID, :COLNO;
- printf("| %3d | %18s | %3d |n",UNTABID,COLNAME,COLNO);
- }
- exit3:
- printf("|--------------------------------|n");
- fprintf(stderr,"End of Table SYSCOLUMNSn");
- $ close CURS3;
- $ commit work;
- return 0;
- errexit:
- return 0;
- }