<?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[erweiterte Prozedur]]></title><description><![CDATA[<p>Hallo,</p>
<p>wer hat schon mal eine &quot;dll&quot; erstellt und diese als neue erweiterte Prozedur<br />
in den SQL-Server gepackt.<br />
Wie mach man es, weis jemand vieleich wo man ein beispiel runterladen kann<br />
Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/54194/erweiterte-prozedur</link><generator>RSS for Node</generator><lastBuildDate>Mon, 01 Jun 2026 15:50:14 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/54194.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Nov 2003 11:22:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to erweiterte Prozedur on Wed, 05 Nov 2003 11:22:49 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wer hat schon mal eine &quot;dll&quot; erstellt und diese als neue erweiterte Prozedur<br />
in den SQL-Server gepackt.<br />
Wie mach man es, weis jemand vieleich wo man ein beispiel runterladen kann<br />
Vielen Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/387099</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/387099</guid><dc:creator><![CDATA[007ski]]></dc:creator><pubDate>Wed, 05 Nov 2003 11:22:49 GMT</pubDate></item><item><title><![CDATA[Reply to erweiterte Prozedur on Wed, 05 Nov 2003 12:40:04 GMT]]></title><description><![CDATA[<p>Ich weis man kann mit dem Assistent eine Erweiterte Prozedur erstellen aber mein Problem ist wie kriege ich da ( in der dll ) par Parameter vor allem CString und wie gebe ich die wieder zurück ??<br />
Bitte um Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/387169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/387169</guid><dc:creator><![CDATA[007ski]]></dc:creator><pubDate>Wed, 05 Nov 2003 12:40:04 GMT</pubDate></item><item><title><![CDATA[Reply to erweiterte Prozedur on Thu, 06 Nov 2003 10:23:10 GMT]]></title><description><![CDATA[<p>So habe ich das ganze bis jetzt geschafft.<br />
Mein Problem ich kann keinen output Parameter angeben in die Prozedur und auch ausgeben als Datentyp</p>
<pre><code class="language-cpp">#include &lt;stdafx.h&gt;

#define XP_NOERROR              0
#define XP_ERROR                1
#define MAXCOLNAME				25
#define MAXNAME					25
#define MAXTEXT					255

#ifdef __cplusplus
extern &quot;C&quot; {
#endif

RETCODE __declspec(dllexport) xp_formel(SRV_PROC *srvproc);

#ifdef __cplusplus
}
#endif

RETCODE __declspec(dllexport) xp_formel(SRV_PROC *srvproc)
{	
	int a = 0;
	int b = 0,zehler = 0;
	int iLength,iType,iParamCount,i = 0;
	CString szText,szTemp,sInt;
	CString szOutBuffer = &quot;&quot;;

	//Get the number of parameters passed to the Extended stored procedure.

	iParamCount=srv_rpcparams(srvproc);
	if (iParamCount == -1)
	{        
        return (XP_ERROR);
	}
	// Parse for all parameters that have been Passed
	// Note SQL Extended stored procedure use start index 1 unlike 0 in C
	// but quite like Basic
	for (i = 1; i &lt;= iParamCount; i++) 
	{
		szText = _T(&quot;&quot;);
		//Retrieve the data length of the Extended stored procedure call parameter.
		iLength=srv_paramlen(srvproc,i);
		//Retrieve the data type of the Extended stored procedure call parameter.
		iType=srv_paramtype(srvproc,i);
		if(iLength &lt;= 0)
		{
			return (XP_ERROR);
		}
		else
		{
			switch(iType)
			{
				case SRVCHAR://character data type.
						szText.Format(&quot;%s&quot;,(const char *) srv_paramdata (srvproc,i));						
						break;							
				case SRVVARCHAR://Variable-length character data type.
						szText.Format(&quot;%s&quot;,(const char *) srv_paramdata (srvproc,i));										
						break;																	
				case SRVINTN://tinyint, smallint, or int data type, null values allowed.						
						sInt.Format(&quot;%d&quot;,*((int*) srv_paramdata (srvproc,i)));												
						zehler ++;
						if(zehler==1)
							a = atoi(sInt);
						if(zehler!=1)
							b= atoi(sInt);
						break;							
				//Handling for other data types
				default: 
						a=b=0;
						szText = &quot;&quot;;
						break;							

			}
		}
	}
	iLength = szOutBuffer.GetLength();		
	char buffer[20];
	long c = a+b;
	szOutBuffer = _ltoa(c,buffer,10);

	int status = srv_paramstatus(srvproc, i+1);

	//Defines the column Output_Info and source and destination data types for a specific column in a row.
	srv_describe(srvproc,1,&quot;Output_Info&quot;,255,SRVVARCHAR,iLength,SRVVARCHAR,iLength,(void *)(szOutBuffer.GetBuffer( iLength )));
	//Send the output result set to the SQL Server for viewing in clients like ISQLW
	srv_sendrow(srvproc);
	//Inform the Server that you are finsihed with the send
	//else subsequent ODS calls will cause an Invalid Cursor State 
	//as it is still waiting for the information
	srv_senddone(srvproc,SRV_DONE_FINAL,0,0);
	szOutBuffer.ReleaseBuffer();

	return XP_NOERROR ;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/387884</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/387884</guid><dc:creator><![CDATA[007ski]]></dc:creator><pubDate>Thu, 06 Nov 2003 10:23:10 GMT</pubDate></item></channel></rss>