diff --git a/project/bin/Debug/project.exe b/project/bin/Debug/project.exe index a4df791..e39a6d5 100644 Binary files a/project/bin/Debug/project.exe and b/project/bin/Debug/project.exe differ diff --git a/project/bin/Release/libecpg.dll b/project/bin/Release/libecpg.dll new file mode 100644 index 0000000..cb9c96b Binary files /dev/null and b/project/bin/Release/libecpg.dll differ diff --git a/project/bin/Release/libgcc_s_dw2-1.dll b/project/bin/Release/libgcc_s_dw2-1.dll new file mode 100644 index 0000000..35a54a3 Binary files /dev/null and b/project/bin/Release/libgcc_s_dw2-1.dll differ diff --git a/project/bin/Release/libgcc_s_sjlj-1.dll b/project/bin/Release/libgcc_s_sjlj-1.dll new file mode 100644 index 0000000..351add6 Binary files /dev/null and b/project/bin/Release/libgcc_s_sjlj-1.dll differ diff --git a/project/bin/Release/libiconv-2.dll b/project/bin/Release/libiconv-2.dll new file mode 100644 index 0000000..5a0f41c Binary files /dev/null and b/project/bin/Release/libiconv-2.dll differ diff --git a/project/bin/Release/libintl-8.dll b/project/bin/Release/libintl-8.dll new file mode 100644 index 0000000..baf011b Binary files /dev/null and b/project/bin/Release/libintl-8.dll differ diff --git a/project/bin/Release/libpgtypes.dll b/project/bin/Release/libpgtypes.dll new file mode 100644 index 0000000..5f89fec Binary files /dev/null and b/project/bin/Release/libpgtypes.dll differ diff --git a/project/bin/Release/libpq.dll b/project/bin/Release/libpq.dll new file mode 100644 index 0000000..e03a196 Binary files /dev/null and b/project/bin/Release/libpq.dll differ diff --git a/project/bin/Release/libstdc++-6.dll b/project/bin/Release/libstdc++-6.dll new file mode 100644 index 0000000..8e17b4c Binary files /dev/null and b/project/bin/Release/libstdc++-6.dll differ diff --git a/project/bin/Release/project.exe b/project/bin/Release/project.exe new file mode 100644 index 0000000..9184e25 Binary files /dev/null and b/project/bin/Release/project.exe differ diff --git a/project/bin/Release/release.zip b/project/bin/Release/release.zip new file mode 100644 index 0000000..92d031a Binary files /dev/null and b/project/bin/Release/release.zip differ diff --git a/project/dbclient.cpp b/project/dbclient.cpp index 4563c4c..2fe4080 100644 --- a/project/dbclient.cpp +++ b/project/dbclient.cpp @@ -575,11 +575,54 @@ void updateQuestion(){ } 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(){ + /* 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() { diff --git a/project/dbclient.pgc b/project/dbclient.pgc index 4df3575..7099021 100644 --- a/project/dbclient.pgc +++ b/project/dbclient.pgc @@ -352,11 +352,32 @@ void updateQuestion(){ } 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(){ - + 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() { diff --git a/project/obj/Debug/dbclient.o b/project/obj/Debug/dbclient.o index 3be44f7..9d93772 100644 Binary files a/project/obj/Debug/dbclient.o and b/project/obj/Debug/dbclient.o differ diff --git a/project/obj/Release/dbclient.o b/project/obj/Release/dbclient.o index 8f72e9b..75f4e0f 100644 Binary files a/project/obj/Release/dbclient.o and b/project/obj/Release/dbclient.o differ diff --git a/project/project.depend b/project/project.depend index 19a236d..c4ac310 100644 --- a/project/project.depend +++ b/project/project.depend @@ -1,13 +1 @@ # depslib dependency file v1.0 -1489738282 source:c:\users\s_seedorf\desktop\cpp\project\dbclient.pgc - - - -1489959780 source:f:\postgrachelor\project\dbclient.pgc - - - -1489768344 source:f:\postgrachelor\postgrachelorcppapplication\project\dbclient.pgc - - - diff --git a/project/project.layout b/project/project.layout index 86bfd0c..100c1f2 100644 --- a/project/project.layout +++ b/project/project.layout @@ -4,7 +4,7 @@ - +