Sqlexec is used to select, insert, update or delete a single record using a sql statement. Sqlexec executes the sql comand from within pcode bypassing the component processor and interacts dorectly with database server.
If you want to select, insert, update or delete a series of record then use getsql or createsql and then execute sql class method.
Above answer was rated as good by the following members: syedajmal
RE: What is the diffrence between SQLExec and CreateSQ...
SqlExec means it byepasses the component buffer and its directly contacts database to retrieve data. But it retrieves the data row by row and not possible for bulk insert.
But in the case of Create SQL we can able insert the data in bulk.
RE: What is the diffrence between SQLExec and CreateSQ...
Sqlexec is used to select insert update or delete a single record using a sql statement. Sqlexec executes the sql comand from within pcode bypassing the component processor and interacts dorectly with database server.
If you want to select insert update or delete a series of record then use getsql or createsql and then execute sql class method.
RE: What is the diffrence between SQLExec and CreateSQ...
Perhaps surprising to some...SQLExec EXECUTES the SQL you pass as a parameter right then and there: SQLExec( Update table set fieldA valA where fieldB valB );CreateSql CREATES an SQL object think Object Oriented Programming 'cause that's all it is. This object has properties and methods you can then execute such as execute(): Local SQL &sql CreateSQL( Select field from table where fieldA :1 x ); While &sql.fetch(&variable) ... do stuff with &variable end-While;
RE: What is the diffrence between SQLExec and CreateSQ...
There are two basic differences:
1st : If you want to delete insert or update a single record use the SQLExec along with corresponding PeopleCode record object method.
If you want to delete insert or update a series of records all of the same type use the CreateSQL or GetSQL functions not the Execute SQL class method.
2nd : SQLExec can only Select a single row of data. If your SQL statement (or your SQL.sqlname statement) retrieves more than one row of data SQLExec sends only the first row to its output variables. Any subsequent rows are discarded. If you need to SELECT multiple rows of data use the CreateSQL or GetSQL functions and the Fetch SQL class method.
RE: What is the diffrence between SQLExec and CreateSQL?
Create SQL is a people tool definition which can be created using application designer as well as using people code command create sql(). It is mainly used for reusability of the sql statemetns.
SQL Exec is a built-in function in people code. It is used to retrieve one row and can update multiple rows of data. It directly interact with the database.
RE: What is the diffrence between SQLExec and CreateSQL?
The main Difference Between SqlExec and CreateSql is SqlExec directly interactive with data base but Createsql not directly interactive with the data base