TComandante
asked on
FRM-1403: ORA-01403 No Data Found when calling TEXT I/O procedure
Hello Forms6i experts,
I've been trying to resolve this problem for 2 days now. Our oracle database is version 9.206. I checked the filenames, the sql in my cursor and it
returns data. But when I call this from forms6i, I'm getting a no data found. I don't understand it. There's another option of creating an XML file. I can
call & create the XML file from a stored procedure, but I don't know how to do it. Can someone give me the logic?
Below is my TEXT I/O procedure:
PROCEDURE XML_FILE_UPDATE
IS
l_in_file TEXT_IO.FILE_TYPE;
l_id NUMBER := name_in('ORGANIZATIONS.ORG _ID');
l_cmp_id NUMBER := name_in('ORGANIZATIONS.ORG _ID');
l_event VARCHAR2(1) := 'I';
l_filename VARCHAR2(200) := l_id||'_'||l_cmp_id||'.xml ';
l_the_file VARCHAR2(1000) := 'C:\TEMP\PW_XML\'||l_filen ame;
l_output_line VARCHAR2(2000);
CURSOR c_company IS
SELECT '<DBEvent'||CHR(10)||' '
||'<Master>'||'C'||'</Mast er>'||CHR( 10)||' '
||'<ID>'||to_char(l_id)||' </ID>'||CH R(10)||' '
||'<CompID>'||to_char(l_cm p_id)||'</ CompID>'|| CHR(10)||' '
||'Event<>'||'U'||'</Event >'||CHR(10 )
||'</DBEvent>'
FROM organizations
WHERE org_id = l_id;
BEGIN
/* Initialize and open the file for writing */
l_in_file := text_io.fopen(l_the_file, 'w');
/* Get all the records and write to file */
OPEN c_company;
FETCH c_company
INTO l_output_line;
text_io.put_line(l_in_file ,l_output_ line);
/* Close the cursor */
CLOSE c_company;
/* Close the file */
text_io.fclose (l_in_file);
END;
Thanks,
Terry
I've been trying to resolve this problem for 2 days now. Our oracle database is version 9.206. I checked the filenames, the sql in my cursor and it
returns data. But when I call this from forms6i, I'm getting a no data found. I don't understand it. There's another option of creating an XML file. I can
call & create the XML file from a stored procedure, but I don't know how to do it. Can someone give me the logic?
Below is my TEXT I/O procedure:
PROCEDURE XML_FILE_UPDATE
IS
l_in_file TEXT_IO.FILE_TYPE;
l_id NUMBER := name_in('ORGANIZATIONS.ORG
l_cmp_id NUMBER := name_in('ORGANIZATIONS.ORG
l_event VARCHAR2(1) := 'I';
l_filename VARCHAR2(200) := l_id||'_'||l_cmp_id||'.xml
l_the_file VARCHAR2(1000) := 'C:\TEMP\PW_XML\'||l_filen
l_output_line VARCHAR2(2000);
CURSOR c_company IS
SELECT '<DBEvent'||CHR(10)||' '
||'<Master>'||'C'||'</Mast
||'<ID>'||to_char(l_id)||'
||'<CompID>'||to_char(l_cm
||'Event<>'||'U'||'</Event
||'</DBEvent>'
FROM organizations
WHERE org_id = l_id;
BEGIN
/* Initialize and open the file for writing */
l_in_file := text_io.fopen(l_the_file, 'w');
/* Get all the records and write to file */
OPEN c_company;
FETCH c_company
INTO l_output_line;
text_io.put_line(l_in_file
/* Close the cursor */
CLOSE c_company;
/* Close the file */
text_io.fclose (l_in_file);
END;
Thanks,
Terry
Be sure that move the declaration before begin and initialization after the begin.
ASKER
I'm sure I'm getting the values of all the attributes because I did some Messages in the form and it returns all the values including the full filename.
It seems that it cannot write to a file. Is there a changed in Forms 6i using Oracle 9.206 in Text I/O?
Or is there a way to create an XML file from a package or stored procedure?
Thanks,
Terry
It seems that it cannot write to a file. Is there a changed in Forms 6i using Oracle 9.206 in Text I/O?
Or is there a way to create an XML file from a package or stored procedure?
Thanks,
Terry
That is very much possible. You can see the examples as in here and you post questions if you dont seem to be understanding any.
http://www.oracle.com/technology/oramag/oracle/03-may/o33xml.html
http://www.oracle.com/technology/oramag/oracle/03-may/o33xml.html
ASKER
All I need is just a simple XML File:
master := "C' -- for Company
id := 25; -- from organizations table
comp_id := 10; -- from organizations table
event := 'I' -- for Insert
Example below is an XML File to be written to a file ( C:\temp\pw_xml\25_10.xml )
<DBEvent>
<Master>C</Master>
<ID>25</ID>
<CompID>10</CompID>
<Event>'I'</Event>
</DBEvent>
master := "C' -- for Company
id := 25; -- from organizations table
comp_id := 10; -- from organizations table
event := 'I' -- for Insert
Example below is an XML File to be written to a file ( C:\temp\pw_xml\25_10.xml )
<DBEvent>
<Master>C</Master>
<ID>25</ID>
<CompID>10</CompID>
<Event>'I'</Event>
</DBEvent>
ASKER
I know what the problem is on this. It's just permission to a file server where I'm writing the file to.
I can give 50 points to RAM 0128 for givimg some comments on this.
Thanks,
Terry
I can give 50 points to RAM 0128 for givimg some comments on this.
Thanks,
Terry
ASKER
This can be closed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
instead of this line,
l_id NUMBER := name_in('ORGANIZATIONS.ORG
have this line,
after the begin statement.
l_id NUMBER := NVL(name_in('ORGANIZATIONS