Re: SPL Question about creating a flat file.
Posted in 1995
UNLOAD is not a statement in SQL or ESQL/C; it is provided as a high-level
add-on by ISQL and DB-Access and I4GL.
There is no built-in method in SPL for creating a flat file. Your
technique using SYSTEM within your SPL is the way I'd suggest going, though
if you want the data in UNLOAD format, I would use something other than ACE,
and that would probably either be one of my own ESQL/C programs which does
the job or a shell script which ran isql to do the job:
For example, the script might be run as:
unload -d dbase -t table -o outfile
which would run the script:
isql dbase - <<-! >/dev/null 2>&1
unload to "outfile" select * from table; !
This can get as fancy as you like.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
}From: raju@cs.fredonia.edu (Raju Matthew Kallarackal)
}Date: Fri, 13 Oct 1995 21:31:52 GMT
}X-Informix-List-Id: <news.17903>
}
} Would someone help me out on this one?
}
} I have Trigger activating a Stored Procedure. From the SP, I am
} attempting to generate a flat file. [Which is to be transfered to
} another node, parsed and processed into another database]
}
} I tried using an UNLOAD statement and got an error 201 - A syntax
} error has occured. Here is the test procedure I tried to create:
}
} ----------------------------------------------------
} create procedure proc1 (uname char(10))
}
} Unload to '/usr/users/fssystem/raju/trig/flat.dat'
} Select * from user_record
} where user_id = uname
}
}end procedure;
}--------------------------------------------------------------
}
} Here is my question which I also posed to Informix and got no answer.
} Can you use UNLOAD from SPL? If not, is there a built in mechanism
} to generate a flat file.
}
} The alternate way I am considering, if the above answers are NO,
} is to use the SYSTEM call within SPL to run an ACE report to do
} the job of creating my flat file. Or is that too convoluted??