Working on whilerow.
This commit is contained in:
parent
9977ca188c
commit
a09e370e57
33
__whilerow.cpp
Normal file
33
__whilerow.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
#include "__whilerow.h"
|
||||
#include "Exception.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace jet {
|
||||
|
||||
__whilerow::__whilerow(coreutils::ZString &in, coreutils::MString &parent, Global &global) : Tag(in, parent, global) {
|
||||
|
||||
if(!variableDefined("host"))
|
||||
throw coreutils::Exception("host must be specified for mysql tag.");
|
||||
if(!variableDefined("database"))
|
||||
throw coreutils::Exception("database must be specified for mysql tag.");
|
||||
if(!variableDefined("user"))
|
||||
throw coreutils::Exception("user must be specified for mysql tag.");
|
||||
if(!variableDefined("password"))
|
||||
throw coreutils::Exception("password must be specified for mysql tag.");
|
||||
|
||||
while ((count != 0) && sql[sqlsession].row) {
|
||||
processContainer(container);
|
||||
|
||||
sql[sqlsession].row = mysql_fetch_row (sql[sqlsession].result);
|
||||
sql[sqlsession].fieldlen = mysql_fetch_lengths (sql[sqlsession].result);
|
||||
|
||||
--count;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
19
__whilerow.h
Normal file
19
__whilerow.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef ____whilerow_h__
|
||||
#define ____whilerow_h__
|
||||
|
||||
#include "Tag.h"
|
||||
#include "ZString.h"
|
||||
#include "MString.h"
|
||||
|
||||
namespace jet {
|
||||
|
||||
class __whilerow : public Tag {
|
||||
|
||||
public:
|
||||
__whilerow(coreutils::ZString &in, coreutils::MString &parent, Global &global);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -5,7 +5,9 @@
|
||||
$[nonexistant]
|
||||
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
|
||||
<sql sessionid="1">select * from testdata</sql>
|
||||
$[1.id] $[1.text] $[1.value]
|
||||
<whilerow name="index" count="10" sessionid="1">
|
||||
$[1.id] $[1.text] $[1.value]
|
||||
</whilerow>
|
||||
</mysql>
|
||||
<set name="ix" value="1" />
|
||||
<set name="theexpr" expr="SUBSTRING('abcdefg', 1, 3)" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user