Highlighted
Absent Member.
Absent Member.
173 views

Database Parameters

how to check whether parameter are initialized?..I'm accessing Db and few columns returns null. when i save it in parameter(using correlation option) and later use for comparison if throw error saying its not initialized? how do i solve the problem?
0 Likes
4 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Database Parameters

Hi sanpal,

explicitelly assign the returned value to a local variable you create, I think it's possible, so define this variable to NULL (without quote) and if the DB return null the variable is initialized (as it is not overwritten with DB result NULL), and if returned value is defined, the lrd_assign function will set the varaible to the returned value.

--
david
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Database Parameters

Hi David,

I did try to declare variable and use variable in lrd_save_col, it throws error at run time saying invalid argument. I have to use only parameter . Even though this parameter is declared and intialised before assigining values in lrd_save_col, after this statement (lrd_save_col) execution , when i try to lr_eval_string with the param name it throws error saying parameter not initialised. When i say null in Db it mean, columns has no value, its not that we are inserting NULL value to column.Any further help will be appreciated.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Database Parameters

Hi,
as you could see in the documentation, the variable should a A pointer to an LRD_CURSOR structure. Do you have define it like that ??

--
david
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Database Parameters

Hi David,

i'm not getting much info on LRD_CUSOR in help index. i didn't declare variable of LRD_CURSOR. i tried with variable of type char[]. when i said i'm saving value of database col to parameter it is though , Grid->select col->right click->create corelation. It adds new statement lrd_save_col(). When Database col contains no values , this parameter is not assigned. So when i evaluate by Lr_eval_string(param name) it was throwing error. However i found soln to this problem by declaring parameter
lr_save_string("\0","Saved_LABEL4A");
and saving database coln value as
lrd_ora8_save_col(OraStm7,9,1,0,"Saved_LABEL4A") . Whenever coln contains no value, it don't return anything nor aborts with error message. Please do let know other better approach. Thank you for your time in answering my q.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.