implemented delete
This commit is contained in:
Binary file not shown.
BIN
project/bin/Release/libecpg.dll
Normal file
BIN
project/bin/Release/libecpg.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libgcc_s_dw2-1.dll
Normal file
BIN
project/bin/Release/libgcc_s_dw2-1.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libgcc_s_sjlj-1.dll
Normal file
BIN
project/bin/Release/libgcc_s_sjlj-1.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libiconv-2.dll
Normal file
BIN
project/bin/Release/libiconv-2.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libintl-8.dll
Normal file
BIN
project/bin/Release/libintl-8.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libpgtypes.dll
Normal file
BIN
project/bin/Release/libpgtypes.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libpq.dll
Normal file
BIN
project/bin/Release/libpq.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/libstdc++-6.dll
Normal file
BIN
project/bin/Release/libstdc++-6.dll
Normal file
Binary file not shown.
BIN
project/bin/Release/project.exe
Normal file
BIN
project/bin/Release/project.exe
Normal file
Binary file not shown.
BIN
project/bin/Release/release.zip
Normal file
BIN
project/bin/Release/release.zip
Normal file
Binary file not shown.
@@ -575,11 +575,54 @@ void updateQuestion(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void deleteCategory(){
|
void deleteCategory(){
|
||||||
|
/* exec sql begin declare section */
|
||||||
|
|
||||||
|
|
||||||
|
#line 356 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
int id ;
|
||||||
|
/* exec sql end declare section */
|
||||||
|
#line 357 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
|
||||||
|
cout << "Welche Kategorie? (ID)" << endl;
|
||||||
|
selectCategory();
|
||||||
|
cin >> id;
|
||||||
|
if(id){
|
||||||
|
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "delete from gr2 . test where \"ID\" = $1 ",
|
||||||
|
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
|
||||||
|
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
|
||||||
|
#line 362 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
|
||||||
|
if(!strcmp(sqlca.sqlstate, "23503")) cout << "Kategorie kann nicht geloescht werden! (Existieren noch Fragen mit der Kategorie?)" << endl;
|
||||||
|
else if(!strcmp(sqlca.sqlstate, "02000")) cout << "Kategorie existiert nicht!" << endl;
|
||||||
|
{ ECPGtrans(__LINE__, NULL, "commit");}
|
||||||
|
#line 365 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteQuestion(){
|
void deleteQuestion(){
|
||||||
|
/* exec sql begin declare section */
|
||||||
|
|
||||||
|
|
||||||
|
#line 371 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
int id ;
|
||||||
|
/* exec sql end declare section */
|
||||||
|
#line 372 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
|
||||||
|
cout << "Welche Frage? (ID)" << endl;
|
||||||
|
selectCategory();
|
||||||
|
cin >> id;
|
||||||
|
if(id){
|
||||||
|
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "delete from gr2 . testquestions where \"ID\" = $1 ",
|
||||||
|
ECPGt_int,&(id),(long)1,(long)1,sizeof(int),
|
||||||
|
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
|
||||||
|
#line 377 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
|
||||||
|
if(!strcmp(sqlca.sqlstate, "02000")) cout << "Frage existiert nicht!" << endl;
|
||||||
|
{ ECPGtrans(__LINE__, NULL, "commit");}
|
||||||
|
#line 379 "F:\\postgrachelor\\project\\dbclient.pgc"
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cinClear() {
|
void cinClear() {
|
||||||
|
|||||||
@@ -352,11 +352,32 @@ void updateQuestion(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void deleteCategory(){
|
void deleteCategory(){
|
||||||
|
EXEC SQL BEGIN DECLARE SECTION;
|
||||||
|
int id;
|
||||||
|
EXEC SQL END DECLARE SECTION;
|
||||||
|
cout << "Welche Kategorie? (ID)" << endl;
|
||||||
|
selectCategory();
|
||||||
|
cin >> id;
|
||||||
|
if(id){
|
||||||
|
EXEC SQL DELETE FROM gr2.test WHERE "ID" = :id;
|
||||||
|
if(!strcmp(sqlca.sqlstate, "23503")) cout << "Kategorie kann nicht geloescht werden! (Existieren noch Fragen mit der Kategorie?)" << endl;
|
||||||
|
else if(!strcmp(sqlca.sqlstate, "02000")) cout << "Kategorie existiert nicht!" << endl;
|
||||||
|
EXEC SQL COMMIT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void deleteQuestion(){
|
void deleteQuestion(){
|
||||||
|
EXEC SQL BEGIN DECLARE SECTION;
|
||||||
|
int id;
|
||||||
|
EXEC SQL END DECLARE SECTION;
|
||||||
|
cout << "Welche Frage? (ID)" << endl;
|
||||||
|
selectCategory();
|
||||||
|
cin >> id;
|
||||||
|
if(id){
|
||||||
|
EXEC SQL DELETE FROM gr2.testquestions WHERE "ID" = :id;
|
||||||
|
if(!strcmp(sqlca.sqlstate, "02000")) cout << "Frage existiert nicht!" << endl;
|
||||||
|
EXEC SQL COMMIT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cinClear() {
|
void cinClear() {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,13 +1 @@
|
|||||||
# depslib dependency file v1.0
|
# depslib dependency file v1.0
|
||||||
1489738282 source:c:\users\s_seedorf\desktop\cpp\project\dbclient.pgc
|
|
||||||
<iostream>
|
|
||||||
<stdlib.h>
|
|
||||||
|
|
||||||
1489959780 source:f:\postgrachelor\project\dbclient.pgc
|
|
||||||
<iostream>
|
|
||||||
<stdlib.h>
|
|
||||||
|
|
||||||
1489768344 source:f:\postgrachelor\postgrachelorcppapplication\project\dbclient.pgc
|
|
||||||
<iostream>
|
|
||||||
<stdlib.h>
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<ActiveTarget name="Debug" />
|
<ActiveTarget name="Debug" />
|
||||||
<File name="dbclient.pgc" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="dbclient.pgc" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
<Cursor>
|
<Cursor>
|
||||||
<Cursor1 position="5815" topLine="213" />
|
<Cursor1 position="10046" topLine="324" />
|
||||||
</Cursor>
|
</Cursor>
|
||||||
</File>
|
</File>
|
||||||
<File name="dbclient.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
<File name="dbclient.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
|
||||||
|
|||||||
Reference in New Issue
Block a user