Created
November 14, 2014 13:39
-
-
Save zguangyu/c4fcd8318cd76c36cd88 to your computer and use it in GitHub Desktop.
ECPG Select Multiple lines into an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
int i; | |
EXEC SQL BEGIN DECLARE SECTION; | |
int db_tar_id[20]; | |
EXEC SQL END DECLARE SECTION; | |
EXEC SQL CONNECT TO stars; | |
EXEC SQL SELECT tar_id INTO :db_tar_id FROM targets ORDER BY tar_id LIMIT 20; | |
for (i=0; i<20; i++) | |
printf("%d\n", db_tar_id[i]); | |
EXEC SQL COMMIT; | |
EXEC SQL DISCONNECT ALL; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment