2 messages in com.perforce.perforce-user[p4] p4sql & c++| From | Sent On | Attachments |
|---|---|---|
| Yoshimitsu, Stacy D. | 26 Feb 2003 10:25 | |
| wsue...@centonline.com | 27 Feb 2003 07:31 |
| Subject: | [p4] p4sql & c++![]() |
|---|---|
| From: | wsue...@centonline.com (wsue...@centonline.com) |
| Date: | 02/27/2003 07:31:51 AM |
| List: | com.perforce.perforce-user |
Hello,
Instead of the system function, you should probably look into popen, and read the stdout of the query. The result from system is the exit value of the p4sql program, not the result of the query. If you search, I'm sure that their are C++ classes that abstract all this for you, I just don't do enough in C++ to know of the top of my head.
You don't say what system this is on.... From a purely Unix perspective...
sh$ p4sql -i queries.sql < output here > sh$ echo $? < exit value of p4sql >
Bill Suetholz
On 26-Feb-03 Yoshimitsu, Stacy D. wrote:
Hello,
Does anyone know how to get a p4sql result into a c++ variable? For example:
my queries.sql file:
------------------------------------- SELECT count(*) FROM changes changes, files files WHERE changes.change = files.change AND ((changes.description Like'xxx%') AND (filespec = '//depot/ProductLine/....java') );
my genPackage.c file
-------------------------------- .... int rows = system("p4sql -i queries.sql");
That doesn't seems to work. Is there a way where I can store the result into a c++ ariable?
Thanks,
Stacy
_______________________________________________ perforce-user mailing list - perforce-user at perforce.com http://maillist.perforce.com/mailman/listinfo/perforce-user
---------------------------------- E-Mail: wsuetholz at centonline.com Date: 27-Feb-03 Time: 09:28:41
This message was sent by XFMail
----------------------------------




