Home » Developer & Programmer » Forms » diffcult issue in accessing Lob object and functions? (Forms 6i)
diffcult issue in accessing Lob object and functions? [message #420544] |
Mon, 31 August 2009 04:38 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
mm_kanish05
Messages: 493 Registered: January 2007 Location: Chennai
|
Senior Member |
![mm_kanish05%40yahoo.co.in](/forum/theme/orafaq/images/yahoo.png)
|
|
Hi,
I had written a code in when list changed
Declare
Sqltxt clob;
Lnth Number;
Begin
Select Sql_text into sqltxt
From Sql_Collection where Rtrim(Short_Topic) = RTrim(:Replst1);
Fetch_param(sqltxt);
Show_Window('ParamWin');
End;
Fetch_program procedure
PROCEDURE Fetch_Param(sqltxt Clob) IS
Pos1 Number(5) := 1;
pos2 Number(5);
partstr Varchar(32767);
Val Varchar2(50);
i Number := 1;
Type P_arry is table of Varchar2(50) index by Binary_Integer;
Vp_arry P_arry;
Found Boolean;
BEGIN
Go_Block('Param');
Next_item;
Loop
Found := False;
Pos1 := dbms_lob.Instr(sqltxt,':',1,i);
Exit When Pos1 = 0;
Pos2 := Instr(dbms_lob.substr(sqltxt,Pos1,100),' ',1,1)-1;
Vp_arry(i) := dbms_lob.substr(sqltxt,pos1,pos2);
If Vp_arry.count is not null and i > 1 Then
For j in 1..Vp_arry.count-1 Loop
If Vp_arry(j) = dbms_lob.substr(sqltxt,pos1,pos2) Then
Found := True;
exit;
End If;
End Loop;
End If;
If not Found Then
set_item_property(:System.Cursor_item,prompt_text,dbms_lob.substr(sqltxt,pos1,pos2));
set_item_property(:System.Cursor_item,Prompt_font_style,Font_Underline);
next_item;
End If;
i := i + 1;
End Loop;
END;
Problem
The running form automatically closed when it access the line of the above procedure.
Pos2 := Instr(dbms_lob.substr(sqltxt,Pos1,100),' ',1,1)-1;
please help me, What is the problem.
kanish
|
|
|
Re: diffcult issue in accessing Lob object and functions? [message #420547 is a reply to message #420544] |
Mon, 31 August 2009 04:50 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
c.schoeberl
Messages: 22 Registered: August 2009
|
Junior Member |
|
|
mm_kanish05 wrote on Mon, 31 August 2009 04:38 | Hi,
I had written a code in when list changed
If Vp_arry.count is not null and i > 1 Then
For j in 1..Vp_arry.count-1 Loop
If Vp_arry(j) = dbms_lob.substr(sqltxt,pos1,pos2) Then
Found := True;
exit;
End If;
End Loop;
End If;
END;
|
Because you write If Vp_arry.count is not null and i > 1 Then so, i is 1 and you say if i > 1 but i = 1 you have to edit the if clause to
If Vp_arry.count is not null and i >= 1 Then
Regards
|
|
|
|
|
|
|
Re: diffcult issue in accessing Lob object and functions? [message #420558 is a reply to message #420544] |
Mon, 31 August 2009 05:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
mm_kanish05
Messages: 493 Registered: January 2007 Location: Chennai
|
Senior Member |
![mm_kanish05%40yahoo.co.in](/forum/theme/orafaq/images/yahoo.png)
|
|
when i
select sql_text into sqltxt from sql_collection where sql_id = 1
then
SELECT a.custcode,
a.custname,
a.invoiceno,
a.invoicedt,
basicrate,
a.chassisno,
a.engineno,
a.documentno,
b.documentdate
FROM (SELECT a.custcode,
c.custname,
a.invoiceno,
a.invoicedt,
b.chassisno,
b.engineno,
d.unitid,
d.periodid,
d.documentno,
basicrate
FROM invoice a, invoiceitem b, custmast c, chassisitem d
WHERE a.unitid = :Unit_id
AND a.invoicedt BETWEEN :Invoice_From_dt AND :Invoice_To_Dt
AND a.unitid = b.unitid
AND a.periodid = b.periodid
AND a.invoiceno = b.invoiceno
AND a.custcode = c.custcode
AND c.private_customer = ''Y''
AND b.chassisno = d.chassis_no
AND b.engineno = d.engine_no
AND a.unitid = d.unitid
AND b.unitid = d.unitid) a,
chassisarrival b
WHERE a.unitid = b.unitid AND a.periodid = b.periodid AND a.documentno = b.documentno
the above query is my value of sqltxt. And search for parameter are( where with ':').
kanish [EDITED by DJM: fixed mega-crappy formatting]
[Updated on: Mon, 21 September 2009 19:54] by Moderator Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Feb 13 12:41:43 CST 2025
|