GeekInterview.com
Series: Subject: Topic:
Question: 14 of 31

What is the diffrence between SQLExec and CreateSQL?

Asked by: Interview Candidate | Asked on: Oct 15th, 2006
Showing Answers 1 - 10 of 10 Answers
radhika.2784

Answered On : Oct 17th, 2006

View all answers by radhika.2784

HelloAccording to meCreateSQL is used to describe a query like &sql1=CreateSQl(" ur query");and SQLExec is used to execute that query like SQLExec(&sql1);I am not so sure abt this.

  
Login to rate this answer.
Nataraj

Answered On : Nov 8th, 2006

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.

  
Login to rate this answer.
RB

Answered On : Nov 23rd, 2006

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.

Yes  1 User has rated as useful.
  
Login to rate this answer.
Harish Mahanta

Answered On : Nov 28th, 2006

Ans:- SQLExec UPDATEs, INSERTs, and DELETEs go directly to the database server, not to the Component Processor. CreateSQL only retrive the data.

  
Login to rate this answer.
ME

Answered On : Dec 19th, 2006

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;

  
Login to rate this answer.
Guest

Answered On : Jan 6th, 2007

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.

Yes  2 Users have rated as useful.
  
Login to rate this answer.

shs

  
Login to rate this answer.

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.

  
Login to rate this answer.
suresh33.a

Answered On : Oct 21st, 2008

View all answers by suresh33.a

The main Difference Between SqlExec and CreateSql is SqlExec directly interactive with data base but Createsql not directly interactive with the data base

  
Login to rate this answer.
gouse

Answered On : Aug 15th, 2011

With the help of SQLExec, we can fetch only one row of multiple same rows.
with the help of CreateSql, we can fetch all the rows.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.