1.) override vrtDataRecordExecuteNew in framework to insert CLOB type data from the client
public override SalBoolean vrtDataRecordExecuteNew(SalSqlHandle hSql)
{
return this.DataRecordExecuteNew(hSql);
}
public new SalBoolean DataRecordExecuteNew(SalSqlHandle hSql)
{
#region Local Variables
SalString sObjid = "";
SalString sObjversion = "";
SalString sValue = "";
SalBoolean bResult;
#endregion
#region Actions
using (new SalContext(this))
{
sValue = colsSectionText.Text;
if (((cDataSource)this).DataRecordExecuteNew(hSql))
{
if ((colsSectionText.EditDataItemStateGet() == Ifs.Fnd.ApplicationForms.Const.EDIT_Changed))
{
sObjversion = this.__lsObjversion;
if (((cSessionManager)this).DbClobWrite(hSql, "C_Sections_API.Write_section_text", this.__sObjid, ref sObjversion, sValue))
{
colsSectionText.EditDataItemStateSet(Ifs.Fnd.ApplicationForms.Const.EDIT_Empty);
__lsObjversion = sObjversion;
return true;
}
else
{
return false;
}
}
else
{
colsSectionText.EditDataItemStateSet(Ifs.Fnd.ApplicationForms.Const.EDIT_Empty);
return true;
}
}
else
{
return false;
}
}
#endregion
}
2.) override DataRecordExecuteModify in framework to Update CLOB type data from the client
public override SalBoolean vrtDataRecordExecuteModify(SalSqlHandle hSql)
{
return this.DataRecordExecuteModify(hSql);
}
public new SalBoolean DataRecordExecuteModify(SalSqlHandle hSql)
{
#region Local Variables
SalString sObjid = "";
SalString sObjversion = "";
SalString sValue = "";
#endregion
sValue = colsSectionText.Text;
Sal.SendMsg(this, Ifs.Fnd.ApplicationForms.Const.PM_DataRecordRefresh, Ifs.Fnd.ApplicationForms.Const.METHOD_Execute, 0);
sObjid = __colObjid.Text;
sObjversion = __colObjversion.Text;
DbClobWrite(cSessionManager.c_hSql, "C_Sections_API.Write_section_text", sObjid, ref sObjversion, sValue);
Sal.SendMsg(this, Ifs.Fnd.ApplicationForms.Const.PM_DataRecordRefresh, Ifs.Fnd.ApplicationForms.Const.METHOD_Execute, 0);
return 1;
}
3.) We are calling PLSQL method C_Sections_API.Write_section_text from DbClobWrite function.
Technically this will update table record which was already inserted
PROCEDURE Write_section_text(
objversion_ IN OUT NOCOPY VARCHAR2,
rowid_ IN ROWID,
lob_loc_ IN CLOB)
IS
rec_ c_Sections_Tab%ROWTYPE;
BEGIN
rec_ := Lock_By_Id___(rowid_, objversion_);
UPDATE c_Sections_Tab
SET section_text = lob_loc_,
rowversion = sysdate
WHERE rowid = rowid_
RETURNING rowversion INTO rec_.rowversion;
objversion_ := to_char(rec_.rowversion,'YYYYMMDDHH24MISS');
END Write_section_text;
0 comments:
Post a Comment