How to write xml doc to file in PL/SQL

I have a function defined that uses xmlgen.getxml to generate an xml confirmation document. I am calling this function from a trigger and would like to have the returned xml document (a clob) written to an OS file. Can anyone help me with this issue?
Thanks,
John

declare
TYPE weak_cursor_type is REF CURSOR;
curOUT weak_cursor_type;
vOUT clob;
begin
open curOUT FOR SELECT xmlgen.getXML('select * from all_users',1) XML_TXT FROM DUAL;
fetch curOUT into vOUT;
sp_gen_util.output_clob(vOUT,80,'file');
sp_gen_util.output_str(vOUT, 250, 'screen');
end;
----part of package sp_gen_util----
------------- package variables --------------
SUBTYPE max_str_type is varchar2(32767);
wk_CR char:=chr(10);
MAX_STR_LEN constant number:= 32767;
--- driver routine. calls "open_file_function"
--- and "LOBPrint"
--- assumptions: that UTL_DIR has been set in INIT.ORA
--- to support any directories passed
--- inputs: CLOB for output
--- line_length (only affects screen output just now)
--- destination (currently allows "screen" and "file")
--- file_status ("a" append, "w" open for write)
--- dirname (directory path for file)
--- filename (file name for write or append)
PROCEDURE output_clob (
p_str clob,
p_line_length number DEFAULT 80,
p_destination varchar2 DEFAULT 'screen',
p_status varchar2 DEFAULT 'a',
p_dirname varchar2 DEFAULT '/tmp',
p_filename varchar2 DEFAULT 'write_host_file.log' ) IS
v_outfile utl_file.file_type;
begin
wk_substr_len:=p_line_length;
if p_destination='file' then
v_outfile := open_file_fun(p_status, p_dirname, p_filename);
end if;
LOBPrint(p_str,p_destination,v_outfile);
if p_destination='file' then
utl_file.fclose(v_outfile);
end if;
end output_clob;
--- loops through blocks of text by delimiter (carriage return)
--- and writes to either the screen or file
--- (output to screen needs work for clob...currently using
--- "output_str" instead for <32k strings instead)
--- inputs: CLOB for output
--- destination (currently allows "screen" and "file")
--- filehandle (open filehandle from openfile routine)
PROCEDURE LOBPrint(
p_str clob,
p_destination varchar2,
v_outfile utl_file.file_type default null ) is
---------------local working variables
wk_str max_str_type; --MAX=32767
wk_offset INTEGER := 1;
wk_clob clob;
wk_clob_len number;
wk_clob_len2 number;
wk_max_loops number:=70000;
begin
wk_clob_len:= dbms_lob.getlength(p_str);
if wk_clob_len <= MAX_STR_LEN
and p_destination='file' then
--- NOTE: dbms_lob.substr parameters are OPPOSITE of sql substr
utl_file.put_line(v_outfile, dbms_lob.substr( p_str, wk_clob_len, 1));
elsif wk_clob_len > MAX_STR_LEN then
dbms_lob.createtemporary(wk_clob, TRUE, dbms_lob.call);
--- wk_clob: LOB locator of the copy target.
--- p_str: LOB locator of source for the copy.
--- wk_clob_len: Number of bytes (for BLOBs) or characters (for CLOBs)
--- to copy.
--- 1: Offset in bytes or characters in the destination LOB
--- (origin: 1) for the start of the copy.
--- 1: Offset in bytes or characters in the source LOB
--- (origin: 1) for the start of the copy.
dbms_lob.copy(wk_clob, p_str, wk_clob_len, 1, 1);
LOOP
wk_str:=word_parse_trim_lob_FUN(wk_clob,wk_CR);
if p_destination='file' then
utl_file.put_line(v_outfile, wk_str);
elsif p_destination='screen' then
dbms_output.put_line(wk_str);
end if;
wk_clob_len2:= dbms_lob.getlength(wk_clob);
EXIT WHEN wk_clob is null ;
END LOOP;
end if;
END LOBPrint;
--- "function with side-effect"
--- input is CLOB, with is "returned" without leading field
--- additional parameter is field (or token) delimiter
--- value returned is leading field from input string
FUNCTION word_parse_trim_lob_FUN(o_str IN OUT NOCOPY clob,
p_delimiter IN varchar2) RETURN varchar2
IS
o_token max_str_type;
clob_len number;
next_pos number;
wk_clob clob;
BEGIN
clob_len:= dbms_lob.getlength(o_str);
next_pos:= dbms_lob.instr(o_str, p_delimiter, 1, 1);
if next_pos != 0 then
-- NOTE: dbms_lob.substr parameters are OPPOSITE of sql substr
dbms_lob.createtemporary(wk_clob, TRUE, dbms_lob.call);
o_token:= dbms_lob.substr( o_str, next_pos-1, 1);
-- o_str:= dbms_lob.substr(o_str,clob_len-next_pos,next_pos+1);
if next_pos = clob_len then
wk_clob := null;
else
--- wk_clob: LOB locator of the copy target.
--- o_str: LOB locator of source for the copy.
--- clob_len: Number of bytes (for BLOBs) or characters (for CLOBs)
--- to copy.
--- 1: Offset in bytes or characters in the destination LOB
--- (origin: 1) for the start of the copy.
--- next_pos+1: Offset in bytes or characters in the source LOB
--- (origin: 1) for the start of the copy.
dbms_lob.copy(wk_clob, o_str, clob_len, 1, next_pos+1);
end if;
else
o_token:= dbms_lob.substr( o_str, MAX_STR_LEN, 1);
end if;
o_str := wk_clob;
RETURN(o_token);
EXCEPTION
when others then
null;
-- dbms_output.put_line('Error:'||SQLCODE||',text:'||SQLERRM);
END word_parse_trim_lob_FUN;

Similar Messages

  • How to write to a log file within a JSP

    Hello everybody,
    do you know how to write to a log file within a JSP.
    my code is (/space/SP/tlf/ExcepcionJava.jsp):
    <html>
    <body bgColor=#C4E1FF>
    <%@ page import="java.io.*" %>
    <%
         FileWriter salida = new FileWriter(response.encodeURL("log.txt"));
         salida.write(request.getParameter("errorMsg"));
         salida.close();
    %>
    </body>
    </html>.. I run under Solaris, Jrun 2.3.3
    I have also test with getServletContext().getRealPath(), but I get /netsrv/nes/docs/ instead of /space/SP/tlf/

    Hi,
    Give the full path of the log file to the FileWriter. Such as;
    FileWriter salida = new FileWriter(response.encodeURL("/usr/local/tomcat/logs/testlogs/log.txt"));
    nurettin

  • How to write data to text file using external tables

    can anybody tell how to write data to text file using external tables concept?

    Hi,
    Using external table u can load the data in your local table in database,
    then using your local db table and UTL_FILE pacakge u can wrrite data to text file
    external table
    ~~~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2153251
    UTL_FILE
    ~~~~~~~~~
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_file.htm#sthref14093
    Message was edited by:
    Nicloei W
    Message was edited by:
    Nicloei W

  • How to store xml data into file in xml format through java program?

    HI Friends,
    Please let me know
    How to store xml data into file in xml format through java program?
    thanks......
    can discuss further at messenger.....
    Avanish Kumar Singh
    Software Engineer,
    Samsung India Development Center,
    Bangalore--560001.
    [email protected]

    Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
    i got a piece of code from the net which allows me to parse th file:
    import java.io.IOException;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    import org.apache.xerces.parsers.SAXParser;
    import java.lang.*;
    public class MySaxParser extends DefaultHandler
    private static int INDENT = 4;
    private static String attList = "";
    public static void main(String[] argv)
    if (argv.length != 1)
    System.out.println("Usage: java MySaxParser [URI]");
    System.exit(0);
    String uri = argv[0];
    try
    XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
    MySaxParser MySaxParserInstance = new MySaxParser();
    parser.setContentHandler(MySaxParserInstance);
    parser.parse(uri);
    catch(IOException ioe)
    ioe.printStackTrace();
    catch(SAXException saxe)
    saxe.printStackTrace();
    private int idx = 0;
    public void characters(char[] ch, int start, int length)
    throws SAXException
    String s = new String(ch, start, length);
    if (ch[0] == '\n')
    return;
    System.out.println(getIndent() + " Value: " + s);
    public void endDocument() throws SAXException
    idx -= INDENT;
    public void endElement(String uri, String localName, String qName) throws SAXException
    if (!attList.equals(""))
    System.out.println(getIndent() + " Attributes: " + attList);
    attList = "";
    System.out.println(getIndent() + "end document");
    idx -= INDENT;
    public void startDocument() throws SAXException
    idx += INDENT;
    public void startElement(String uri,
    String localName,
    String qName,
    Attributes attributes) throws SAXException
    idx += INDENT;
    System.out.println('\n' + getIndent() + "start element: " + localName);
    if (localName.compareTo("Machine") == 0)
    System.out.println("YES");
    if (attributes.getLength() > 0)
    idx += INDENT;
    for (int i = 0; i < attributes.getLength(); i++)
    attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
    if (i < (attributes.getLength() - 1))
    attList = attList + ", ";
    idx-= INDENT;
    private String getIndent()
    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < idx; i++)
    sb.append(" ");
    return sb.toString();
    }// END PRGM
    Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
    The next step is to write the data to the DB.
    Am sending an example of my file:
    <Start>
    <Machine>
    <Hostname> IPCServer </Hostname>
    <HostID> 80c04499 </HostID>
    <MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
    <CPU> UltraSPARC-IIi at 360 MHz </CPU>
    <Memory> RAM : 512 MB </Memory>
    <HostAdapter>
    <HA> kern.info] </HA>
    </HostAdapter>
    <Harddisks>
    <HD>
    <HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
    <HD2> ST38420A 8.2 GB </HD2>
    </HD>
    </Harddisks>
    <GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
    <NetworkType> hme0 : Fast-Ethernet </NetworkType>
    <EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
    <IPAddress> 149.51.23.140 </IPAddress>
    </Machine>
    </Start>
    Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
    Cal u tellme what to do!
    Even better- do u have a piece of code that will help me understand and implement the database writing portion?
    I badly need help here.
    THANX

  • How to write XML with attributes to a table in Oracle?

    I tried to find solutions over the internet. Some of the stuff I looked at:https://forums.oracle.com/thread/2182669 http://www.club-oracle.com/forums/how-to-insert-data-from-xml-to-table-t2845/
    In all these cases, the solution considers XML structure with only nodes and child nodes but not attributes. In fact, one of the solutions suggests transforming the XML into a canonical form with only nodes w/o attributes.
    This is a sample of xml structure I am working with:
    Sample XML
    <rep type="P" title="P List"> <as> <a id="3" /> <a id="4" /> </as> </rep>
    I am working with oracle client 11.2 and SQL developer
    My question is: how to write XML data into a table with attributes also as column values, beside the nodes?

    My question is: how to write XML data into a table with attributes also as column values, beside the nodes
    The question you should be asking is : "how do I access attributes in the XPath language?"
    and the answer to that is easily found in any XPath tutorial you may find over the Internet, it is not related to Oracle in particular.
    Short answer : you use an "attribute::" axis before the attribute name, or more commonly a "@", e.g. @type, @id etc.
    Using the method described in the first link, something like this will extract the root attributes :
    SELECT x.*
    FROM XMLTable(
           '/rep'
           passing <xmltype variable/column goes here>
           columns type  varchar2(1)  path '@type'
                 , title varchar2(30) path '@title'
    ) x ;
    For deeper levels, use additional XMLTable calls as described in the mentioned post.

  • How to write code for save file directory?

    how to write code for save file directory?

    how to find usa timezone code using java swing?
    i have some code help me
    public class ItsInitializer {
    private static boolean s_initialized = false;
    private ItsInitializer() {
    public static synchronized void initialize() {
    if (!s_initialized) {
    // Modifies default time zone, disables Daylight Saving Time.
    TimeZone l_defaultTimeZone = TimeZone.getDefault();
    int l_rawOffset = l_defaultTimeZone.getRawOffset();
    String l_id = l_defaultTimeZone.getID();
    SimpleTimeZone l_simpleTimeZone = new SimpleTimeZone(l_rawOffset,
    l_id,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0);
    TimeZone.setDefault(l_simpleTimeZone);
    s_initialized = true;
    2.
    long timeMillis = ...;
    long time = timeMillis / 1000;
    String seconds = Integer.toString((int)(time % 60));
    String minutes = Integer.toString((int)((time % 3600) / 60));
    String hours = Integer.toString((int)(time / 3600));
    for (int i = 0; i < 2; i++) {
         if (seconds.length() < 2) {
              seconds = "0" + seconds;
         if (minutes.length() < 2) {
              minutes = "0" + minutes;
         if (hours.length() < 2) {
              hours = "0" + hours;
    3.
    import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    5.import java.text.SimpleDateFormat;
    import java.util.Date;
    public class Convert {
    public String getDateTime(String pattern){
    SimpleDateFormat sdf = new SimpleDateFormat(pattern);
    return sdf.format(new Date());
    * @param args
    public static void main(String[] args) {
    Convert con = new Convert();
    System.out.println(con.getDateTime("hh:mm:ss"));
    [ November 23, 2005: Mess
    private Locale locale = Locale.US;
    private static final String[] tzStrings = {
    "America/New_York",
    "America/Chicago",
    "America/Denver",
    "America/Los_Angeles",
    Date now = new Date();
    for ( TimeZone z : zones) {
    DateFormat df = new SimpleDateFormat("K:mm a,z", locale);
    df.setTimeZone(z);
    String result = df.format(now);
    System.out.println(result);
    String date="05/19/2008 04:30 AM (EST)";
                   SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm aaa (z)");
                   TimeZone.setDefault(TimeZone.getTimeZone("PST"));
                   long millis = sdf.parse(date).getTime();
                   sdf.setTimeZone(TimeZone.getDefault());
                   System.out.println(sdf.format(new Date(millis)));
    [ November 23, 2005: Mes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to write XML into file using JSP

    Hello,
    I am parsing a XML file, then updating some of it content and trying to write back the updated file into the same location as an xml document but its not happening correctly....it gets written like this.
    &_lt;db_name&_gt;dataext&_lt;/db_name&_gt;
    Here is my code......somebody please advise
    <%@ page contentType="text/html"%>
    <%@ page import="java.io.*,
                        java.util.*,
                        org.jdom.*,
                        org.jdom.input.SAXBuilder,
                        org.jdom.output.*" %>
    <%
    String xml_file = "webapps/root/web-inf/admin.xml";
    SAXBuilder builder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
    Document l_doc = builder.build(new File(xml_file));
    Element root = l_doc.getRootElement();
    List admin = root.getChildren("db");
    Iterator loop = admin.iterator();
    while ( loop.hasNext()) {
         Element ele = (Element)loop.next();
         String state = ele.getChild("state").getText();
         String name = ele.getChild("db_name").getText();
         String ip = ele.getChild("db_ip").getText();
         if(state.equals("Florida")) {
              ele.getChild("db_ip").setText("209.11.111.1");
    XMLOutputter l_format = new XMLOutputter();
    String ls_result = l_format.outputString(l_doc);
    root.setText(ls_result);
    ls_result = l_format.outputString(l_doc);
    %>
    <html><head><title></title></head>
    <body>
    <%
         try {
              FileOutputStream ostream = new FileOutputStream("c:\\admin.xml");
              ObjectOutputStream p = new ObjectOutputStream(ostream);
              p.writeObject(ls_result);
              p.flush();
              ostream.close();
         catch(Exception e) {
              out.println(e.toString());
    %>
    </body>
    </html>     

    thanks amgandhi.....
    I found a solution for it, courtesy of this site:
    http://www.topxml.com/tutorials/main.asp?id=jdom&page=15
    <-********************************************************->
    import org.jdom.output.XMLOutputter;
    import org.jdom.*;
    import java.io.*;
    import java.util.*;
    // Write a program that creates document with a
    // single root element. Add a comment to the
    // root element, and assign the document's XML to
    // a local string. Finally, write the String to
    // System.out, and write the document to a text file.
    // For bonus points, allow the user to specify the
    // file name on the command line.
    public class ws3
    public static void main(String[] args)
    String filename = "default.xml";
    if(args.length > 0) filename = args[0];
    Element root = new Element("simple");
    Document doc = new Document(root);
    Comment cmt = new Comment("A bare document!");
    root.addContent(cmt);
    XMLOutputter outputter = new XMLOutputter(" ",
    true);
    String xml = outputter.outputString(doc);
    System.out.println(xml);
    writeToFile(filename, doc);
    private static void writeToFile(String fname,
    Document doc)
    try {
    FileOutputStream out =
    new FileOutputStream(fname);
    XMLOutputter serializer =
    new XMLOutputter(" ", true);
    serializer.output(doc, out);
    out.flush();
    out.close();
    catch (IOException e) {
    System.err.println(e);
    }

  • How to write a CLOB to file using UTF-8

    I'm new to java and I have the following problem.
    I need to write a CLOB to file using the UTF-8 characterset (I'm generating an xml file). My database characterset is WE8ISO8859P15.
    I've tried the code below but the resulting output fails validation in an xml editor due to an 'invalid character' error :
    create or replace
    and compile
    java source named "ClobUtil"
    as
    import java.io.*;
    import java.lang.*;
    import java.sql.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    import oracle.sql.*;
    public class ClobUtil {
    public static void save(CLOB clob, String filename) throws Exception
    Connection conn = DriverManager.getConnection("jdbc:oracle:kprb:");
    conn.setAutoCommit(false);
    InputStream is = clob.getCharacterStream();
    FileOutputStream os = new FileOutputStream(filename);
    int size = clob.getChunkSize();
    byte buffer[] = new byte[size];
    int length;
    while ((length = is.read(buffer, 0, size)) != -1) {
    os.write(buffer, 0, length);
    is.close();
    os.close();
    conn.close();
    I see that the getCharacterStream() method returns a Unicode character stream but how do I output this to file ??
    Thanks in advance

    File file = new File( "myfile.utf8" );
    FileOutputStream fos = new FileOutputStream( file );
    OutputStreamWriter osw = new
    OutputStreamWriter( fos, "UTF8" );
    Writer w = new BufferedWriter( osw );
    PrintWriter out = new PrintWriter( w );
    Or whatever you need. Note that this merely allows you to specify the encoding to be used in the output file, it does convert the encoding for you. I think in your case this will work since you already know the output stream will not contain the full range of UTF8 characters anyway.

  • How to catch XML Publisher bursted file from Workflow

    Hello,
    I have to catch xml publisher bursted file in oracle workflow and send it as the content of mail (not like attachment).
    Does anyone know if this is possible and how can I do it?
    Any help is appreciated, thanks in advance!
    Regards
    Ive

    oracle seeded XDO regions is available to integrate concurrent program in the page.
    You got to extend this RN oracle.apps.xdo.oa.common.DocumentViewerRn.xml
    And oracle.apps.xdo.oa.common.DocumentHelperAPI, should help you to download or View from the page
    Its straight forward , given in the doc i guess.
    Let me pull the metalink note for this.

  • Please help; how to write XML document with JSP?

    I try to write XML document with JSP...
    But I got wrong results everytime.
    The result is not XML file displayed in the browser,
    but HTML file.
    I even tried to use HTML special code for <, >, "
    but still display as HTML file not XML file.
    How to do this?
    Thanks in advance. I put my codes below.
    Sincerely,
    Ted.
    ================
    Here is code for the JSP (called stk.jsp):
    <%@ page contentType="text/xml" %>
    <%@ page import="bean.Stock" %>
    <jsp:useBean id="portfolio" class="bean.Portfolio" />
    <% java.util.Iterator pfolio = portfolio.getPortfolio();
    Stock stock = null; %>
    <?xml version="1.0" encoding="UTF-8"?>
    <portfolio>
    <% while (pfolio.hasNext())
    stock = (Stock) pfolio.next(); %>
    <stock>
    <symbol>
    <%=stock.getSymbol() %>
    </symbol>
    <name><%=stock.getName() %> </name>
    <price><%=stock.getPrice() %> </price>
    </stock>
    <% } %>
    </portfolio>
    =================
    Here is the code for bean.Stock:
    package bean;
    public class Stock implements java.io.Serializable
    String symbol, name;
    float price;
    public Stock(String symbol, String name, float price)
    this.symbol = symbol;
    this.name = name;
    this.price = price;
    public String getSymbol()
    return symbol;
    public String getName()
    return name;
    public float getPrice()
    return price;
    ===============
    And here is bean.Portfolio:
    package bean;
    import java.util.Iterator;
    import java.util.Vector;
    public class Portfolio implements java.io.Serializable
    private Vector portfolio = new Vector();
    public Portfolio()
    portfolio.addElement(new Stock("SUNW", "Sun Microsystem", 34.5f));
    portfolio.addElement(new Stock("HWP", "Hewlett Packard", 15.15f));
    portfolio.addElement(new Stock("AMCC", "Applied Micro Circuit Corp.", 101.35f));
    public Iterator getPortfolio()
    return portfolio.iterator();
    }

    Hi
    I'm not sure whta your query is but I tested your code as it is has been pasted and it seems to work fine. There is an XML output that I'm getting.
    Keep me posted.
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems
    http://www.sun.com/developers/support

  • How to read XML from UNIX file system

    Hi,
    I have this code with read a xml file from windows:
    Document doc = builder.build(new File(C:\\mywork\\src\\Contacts.xml));
    But how can I read the same file from UNIX? (The file is located in "\tmp\Contacts.xml")
    Thanks
    Kenny

    Hi,
    I have this code with read a xml file from windows:
    Document doc = builder.build(new
    File(C:\\mywork\\src\\Contacts.xml));
    But how can I read the same file from UNIX? (The file
    is located in "\tmp\Contacts.xml")
    Thanks
    KennyNo, the file is really located in "/tmp/Contacts.xml". You would writeDocument doc = builder.build(new File("/tmp/Contacts.xml"));Also, your original code would need quotes around the filename too.

  • Anyone know how to write to a RAW file format?

    Hello,
    Been trying to find out if there is any way to write a RAW format file from an array containing pixel values? Do I just use a file writer and save as *.raw?
    Also, what information must I include beyond the pixel values?
    Thanks!

    Well, I had found those already and they weren't of
    too much help to my problem (how to actually create
    the RAW file), but thanks.I'd imagine that you'd create the RAW file according to the specifications provided. The links provided give you information as to the format of the RAW file. In order to actually create the RAW file, you'd simply spit out the properly-formed data to a file (see a tutorial such as "Lesson: I/O: Reading and Writing (but no 'rithmetic)" for more info, if needed).
    What additional help are you looking for?

  • How to write data to existing file using spool command?

    Hi,
    I am calling a stored procedure from a shell script. This stored procedure is having a CLOB object as an OUT parameter. How to write the data in CLOB object a existing file which is there in my client system. Below is the shell and sql scripts.
    Shell script
    ( echo "hello" ) > /root/file.txt
    sqlplus -s $user/$pass@$tns @/root/proc.sql /root/file.txt << EOF
    EOFSQL script
    set pages 0
    set trimspool off
    set serveroutput off
    set feedback off
    set term off
    set echo off
    variable out CLOB
    define file='&1'
    begin
    pack.proc(:out);
    end;
    spool &file
    select :out from dual;
    spool offThis code writes contents of the OUT variable to file.txt, but my existing data ('hello') is lost. Please help me.
    I figured the it...Use append in the spool command... :)
    Edited by: Balaji on Jul 19, 2012 8:55 PM

    >
    Hi Balaji
    I figured the it...Use append in the spool command... :Please mark the thread as answered as per the FAQ.
    Paul...

  • How to write xml

    I'm a bit of a newbie to xml so apologies if I am going over old ground. I am trying to find the most productive way to write xml, every time I try and create an xsd from my file it keeps throwing up lots of validation errors, can anyone recommend the best way, by this i mean fastest and most time saving way to write xml using software to check my work as I type, does such a thing exist? thanks in advance for your replies.

    to answer your question, yes you can use software to make the job easier, most professional programmers would typically use something called an 'xml editor' for this kind of work, the one I use is [Liquid XML Editor|http://www.liquid-technologies.com/xml-editor.aspx] because it's cheap, you can get more expensive ones but it's all down to what you want it to do. However if you are having issues writing valid xml I would probably suggest you have a look at the [W3 website|http://www.w3.org] which covers all the standards for xml and [W3 schools |http://www.w3schools.com] which is basically an online resoure of learning materials for xml. There's a fairly good review site of xml editors here [http://www.xml-editors.info|http://www.xml-editors.info]

  • How to write IPTC metadata to files without opening the file?

    HI,
    I'm trying to run a script (preferably in JS) that allows me to write metadata to a file. I can acheive this very easily by opening the file, but I'd need to batch process many large images, so opening them would cause severe slowness. The purpose of adding the metadata to the files is to search upon them in Bridge.
    We're using CS5, but have CS6 if it's better to use.
    My Script
    // set current doc ref
    var docRef = app.activeDocument;
    // Set caption in active document
    docRef.info.caption = "Some Meta-Data";
    Do I need to use bridge to write the metadata without opening the file? Or can running the script in PS allow me to do so?
    Thanks,
    Tom

    Its easy if you use XMP metadata.
    app.activeDocument.info.caption (in photoshop script metadata)
    and it is the same field as:
         Dublin Core namespace
         namespace:     http://purl.org/dc/elements/1.1/
         Property:          description
    you change description on XMP = you are changing the same image.info.caption
    Your answer is here:
    http://forums.adobe.com/message/5743730#5743730

Maybe you are looking for

  • Putting tick mark into check box in smartform

    hi,    can any one please let me know if i can put a tick mark in the check box of the smartform.    for example: i need to select one among yes or no check box. how do i do it.    should i have to upload a graphic of the tick mark and then display o

  • How to include the not assigned nodes in Hierarchy structure

    Hi Experts, I am running a report which has got Hierarchy variable type. After execution of the query some of the nodes appear always under "not assigned". Please let me know is it possible to include these not assigned node under hierarchy structure

  • Wirelessly Connect Macbook to PC

    I just bought a Macbook (hasn't arrived yet, though) and want to connect it to my PC, where my files and internet are. I use linksys to connect 2 PCs already, and I share a printer between them. Will I be able to connect my PC and my Macbook without

  • Wiki Server - People - suppress for unauthenticated users

    With Wiki Server 4 (Server 10.8.1), unauthenticated users hitting the web server's default home page are presented with Wiki Server's default landing page listing: "My Documents" "All Activity" "Wikis" "People" If an unauthenticated user tries any of

  • Interactive image masking

    I want to be able to create a layer mask in director similar to the function in flash where an image is covered by a colour and using the mouse part of the image is reveled. I want to give the illution of a dark room and the user can move their mouse