<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Problem mit Datenbankabfrage]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;afxdb.h&gt;

class CNumber_Tbl: public CRecordset
{

public:

	CString m_ANZAHL;
	CString m_ALM_NAME;

	CNumber_Tbl(CDatabase *pdb): CRecordset(pdb)
	{
		m_ANZAHL = &quot;0&quot;;
		m_ALM_NAME = &quot;0&quot;;
		m_nFields = 2;
	}

	virtual void DoFieldExchange(CFieldExchange *pFX)
	{
		pFX-&gt;SetFieldType(CFieldExchange::outputColumn);
		RFX_Text(pFX, _T(&quot;[ANZAHL]&quot;), m_ANZAHL);
		RFX_Text(pFX, _T(&quot;[ALM_NAME]&quot;), m_ALM_NAME);
	}
};

//oben ist meine Headerdatei in welcher ich die Felder festlege
//hier ist die Abfrage
//select count(*) as ANZAHL, ALM_NAME from tb_a group by alm_name order by alm_name

//Nur wenn ich die Anzahl meiner datensätze wissen möchte (mit count(*)) 
//bekomme ich einen Oracle Fehler 
//ORA-01013: user requested cancel of current operation
//Die Abfrage funktioniert so aber mit dem SQL Navigator
//lasse ich das count(*) und die Gruppierung weg funktioniert die Abfrage im 
//C++ Programm
//also muss es am count(*) liegen
//hat jemand eine Idee woran es liegen kann, muss ich etwas in meiner Headerdatei ändern?
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/77045/problem-mit-datenbankabfrage</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 11:34:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/77045.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 17 Jun 2004 08:43:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 08:43:54 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;afxdb.h&gt;

class CNumber_Tbl: public CRecordset
{

public:

	CString m_ANZAHL;
	CString m_ALM_NAME;

	CNumber_Tbl(CDatabase *pdb): CRecordset(pdb)
	{
		m_ANZAHL = &quot;0&quot;;
		m_ALM_NAME = &quot;0&quot;;
		m_nFields = 2;
	}

	virtual void DoFieldExchange(CFieldExchange *pFX)
	{
		pFX-&gt;SetFieldType(CFieldExchange::outputColumn);
		RFX_Text(pFX, _T(&quot;[ANZAHL]&quot;), m_ANZAHL);
		RFX_Text(pFX, _T(&quot;[ALM_NAME]&quot;), m_ALM_NAME);
	}
};

//oben ist meine Headerdatei in welcher ich die Felder festlege
//hier ist die Abfrage
//select count(*) as ANZAHL, ALM_NAME from tb_a group by alm_name order by alm_name

//Nur wenn ich die Anzahl meiner datensätze wissen möchte (mit count(*)) 
//bekomme ich einen Oracle Fehler 
//ORA-01013: user requested cancel of current operation
//Die Abfrage funktioniert so aber mit dem SQL Navigator
//lasse ich das count(*) und die Gruppierung weg funktioniert die Abfrage im 
//C++ Programm
//also muss es am count(*) liegen
//hat jemand eine Idee woran es liegen kann, muss ich etwas in meiner Headerdatei ändern?
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/542134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542134</guid><dc:creator><![CDATA[SArkin]]></dc:creator><pubDate>Thu, 17 Jun 2004 08:43:54 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 10:00:29 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Wie wärs wenn du dir mal anschaust welche Foren hier zur Verfügung stehen und das nächste Mal überlegst in welches dein Thema wohl am besten past. Das ist auch in deinem Interesse denn dann bekommst du am schnellsten Hilfe, wenn denn jemand in der Lage ist dir zu helfen. Ums mal überspitzt auszudrücken: Die Leute die im ISO-C++ Forum sind haben überhaupt keine Ahnung von Datenbanken und geben schon auf wenn sie #inlclude&lt;afxdb.h&gt; sehen, da sie nie etwas von einem solchen Header gelesen haben, sie beschäftigen sich ja nur mit ISO-C++ und in der Standardlib existiert ein solcher Header nicht.</p>
<p>Ich denke du verstehst was ich meine. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/542178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542178</guid><dc:creator><![CDATA[prolog]]></dc:creator><pubDate>Thu, 17 Jun 2004 10:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 11:26:19 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=1" rel="nofollow">MFC mit dem Visual C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/542261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542261</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 17 Jun 2004 11:26:19 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 12:02:11 GMT]]></title><description><![CDATA[<p>Warum nimmst du nicht die Funktion GetRecordCount?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/542308</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542308</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Thu, 17 Jun 2004 12:02:11 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 12:47:57 GMT]]></title><description><![CDATA[<p>Ich benötige nicht die Gesamtzahl aller Datensätze, sondern die Anzahl von alm_name = 1, alm_name = 2 usw. Also zum Beispiel die Summe aller Einträge in der Datenbank für alm_name = 1, wenn es 100 Einträge sind, dann möchte ich auch die 100 herausbekommen. Mit GetRecordCount bekomme ich doch nur die Gesamtzahl aller Datensätze in der DB Tabelle, oder nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/542373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542373</guid><dc:creator><![CDATA[SArkin]]></dc:creator><pubDate>Thu, 17 Jun 2004 12:47:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 12:59:38 GMT]]></title><description><![CDATA[<p>Du bekommst du Gesamtanzahl der Datensätze, die du aktuell aus der DB geholt hast.</p>
<p>Wenn du jetzt ein select where ... machst, und dann GetRecordCount - dann hast du die Anzahl der Untermenge.</p>
<p>Oder du machst einen View der das zählen erledigt und liest den aus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/542400</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542400</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Thu, 17 Jun 2004 12:59:38 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 13:04:32 GMT]]></title><description><![CDATA[<p>Vielleicht liegt es daran das die Anzahl bei dir im CString ist aber die Anzahl als INT zurückkommt.</p>
<p>IMHO liefert GetRecordCount nur dann richtige Daten wenn die ganze Ergebnismenge geladen wurde. Also alle Datensätze bis zum letzten mit MoveNext durchgegangen wird. Ein MoveLast bringt auch nichts da die Anzahl beim durchgehen gezählt wird und das ist bei MoveLast nicht der Fall.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/542406</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542406</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Thu, 17 Jun 2004 13:04:32 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Datenbankabfrage on Thu, 17 Jun 2004 13:05:50 GMT]]></title><description><![CDATA[<p>Um solche Probleme nicht zu haben, hab ich mir deshalb auch eine Klasse egschrieben welches einen SQL-Query übernimmt und die Daten als CString zurückgibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/542408</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/542408</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Thu, 17 Jun 2004 13:05:50 GMT</pubDate></item></channel></rss>