sql + C
От | Esteban Gutierrez Abarzua |
---|---|
Тема | sql + C |
Дата | |
Msg-id | Pine.LNX.4.21.0110051531410.8484-100000@sauce.chillan.ubiobio.cl обсуждение исходный текст |
Ответы |
Re: sql + C
|
Список | pgsql-sql |
hi. who knows about C embebed (postgres + C)?I have the program: #include<string.h> EXEC SQL BEGIN DECLARE SECTION; VARCHAR base[50]; EXEC SQL END DECLARE SECTION; EXEC SQL INCLUDE sqlca; EXEC SQL DECLARE C77 CURSOR FOR select datname from pg_user,pg_database where usename= :user and datdba=usesysid; main () { EXEC SQL CONNECT TO mybase; if(sqlca.sqlcode < 0) { printf(" error"); exit(1); } // now I want to get results EXEC SQL OPEN C77;EXEC SQL FETCH IN C77 INTO :base; // here, it's the problem, I can't to get the result on the base variable. I think that can be the variable type. then how should be the data type for ":base" variable? ........ ....... ....... ..... ... . . . . pg_database has the attributes as follow: mybase=> \d pg_database Table "pg_database"Attribute | Type | Modifier -----------+---------+----------datname | name | --->I can't to get the "datname"......why?datdba | integer|encoding | integer |datpath | text | I hope than you understand! bye and thanks!
В списке pgsql-sql по дате отправления: