IUS, External C procedure and string parameter problem
Posted in 1997
hi,
I am unable to pass string from stored procedures to
external c functions. However, I am able to pass integer
over to. Below are my codes. Please advice. Thanks in advance.
dominic
=============== beginning of my c function
================================
#include <stdio.h>
void mail_out(char email[30], char msg[30], char subj[30], char
sender[30], int i){
printf( "Subject: %s\\n", subj);
printf( "From: %s\\n", sender);
printf( "To: %s\\n", email);
printf( "%s", msg);
printf( "%d\\n",i);
}
=============== end of my c function ================================
=============== beginning of my stored procedure
================================
CREATE PROCEDURE mail_out(char(30), char(30), char(30), char(30), int)
external name '/spring/IUS/mail.so'
language c
END PROCEDURE;=============== end of my my store
procedure================================
=============== beginning of my SQL ================================
EXECUTE PROCEDURE mail_out('test@nowhere.com.sg',
'this is a message','this is a title','from@nowhere.com.sg',33)=============== end of my SQL ================================
Result: only the integer is printed but not the rest.