Hello,
I just want to get some chars from a textfile to be shown via SQL+. My intention is to demonstrate the random access possibility to a LOB in Oracle.
Therefore I put a BFILE into a table and try to read and output a small part from the referenced textfile to the screen.
Here is my code:
CREATE TABLE PLSQL(
text_id NUMBER(5) PRIMARY KEY,
text_file BFILE)
CREATE OR REPLACE directory SAMPLES as 'C:\samples'
INSERT INTO PLSQL(text_id,text_file)
values(1,BFILENAME('samples','erle.txt'))
declare
locator_var BFILE:=BFILENAME('SAMPLES','erle.txt');
amount_var INTEGER;
offset_var INTEGER;
output_var VARCHAR2(10);
begin
amount_var:= 10;
offset_var:= 1;
select text_file into locator_var from PLSQL
where text_id = 1;
DBMS_LOB.OPEN(locator_var, DBMS_LOB.LOB_READONLY);
DBMS_LOB.READ(locator_var, amount_var, offset_var, output_var);
DBMS_OUTPUT.PUT_LINE('Begin of Erle: ' || output_var);
end;
/
COMMIT;
when I run the skript I get the following error message:
"SQL> start demo_plsql;
declare
*
FEHLER in Zeile 1:
ORA-22285: Verzeichnis oder Datei fr FILEOPEN-Vorgang ist nicht vorhanden
ORA-06512: in "SYS.DBMS_LOB", Zeile 672
ORA-06512: in Zeile 11"
The directory exists and the file is also there.
So where could be the problem?
In hope for any suggestions.
MaxSorry, can't read German... yet :)
However, it looks like your problem is here:
INSERT INTO PLSQL(text_id,text_file)
values(1,BFILENAME('samples','erle.txt'))
Input into BFILENAME first parameter needs to be upper case in order to match your specification in the CREATE DIRECTORY command.
JoeB
Showing posts with label possibility. Show all posts
Showing posts with label possibility. Show all posts
Wednesday, March 7, 2012
Friday, February 24, 2012
Beta program for Laguna?
Hi,
I'm interested in looking at SQL Server Mobile Edition (Laguna) and
wondered if there was a beta program for it, and the possibility of
getting on the program.
http://www.microsoft.com/sql/ce/productinfo/SQLMobile.asp
Thanks.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.htmlSorry, wrong newsgroup, please ignore.
Mark Allison wrote:
> Hi,
> I'm interested in looking at SQL Server Mobile Edition (Laguna) and
> wondered if there was a beta program for it, and the possibility of
> getting on the program.
> http://www.microsoft.com/sql/ce/productinfo/SQLMobile.asp
> Thanks.
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
I'm interested in looking at SQL Server Mobile Edition (Laguna) and
wondered if there was a beta program for it, and the possibility of
getting on the program.
http://www.microsoft.com/sql/ce/productinfo/SQLMobile.asp
Thanks.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.htmlSorry, wrong newsgroup, please ignore.
Mark Allison wrote:
> Hi,
> I'm interested in looking at SQL Server Mobile Edition (Laguna) and
> wondered if there was a beta program for it, and the possibility of
> getting on the program.
> http://www.microsoft.com/sql/ce/productinfo/SQLMobile.asp
> Thanks.
> --
> Mark Allison, SQL Server MVP
> http://www.markallison.co.uk
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
Sunday, February 12, 2012
Best way to extract part of a db and deploy it
Hi,
I'm using MSSQL2k and I have some customers in a customer table. I want to write a webapp and offer them the possibility to teach them using the app while having telephone contact with them. They can use the app on my server for some time and add data to it.
After a while when someone wants to buy the app I would like to distribute the app as an Intranet app to their own server and let them have the data they already have wrote into the db on my server.
Because there will be some customers with much data I'd like some guidance in how to plan the database to easily extract their own data and create a new db polutated with their data.
KennethThe easiest way that comes to mind would be to add some sort ofcustomer identifer to the primary database, and when you're ready toexport, run a script that copies the rows with that customer identiferfrom the primary database to a blank model database specific for thatcustomer.
All you'd have to do is write the script one, and them plug in the customer identifer when you're ready to export.
I'm using MSSQL2k and I have some customers in a customer table. I want to write a webapp and offer them the possibility to teach them using the app while having telephone contact with them. They can use the app on my server for some time and add data to it.
After a while when someone wants to buy the app I would like to distribute the app as an Intranet app to their own server and let them have the data they already have wrote into the db on my server.
Because there will be some customers with much data I'd like some guidance in how to plan the database to easily extract their own data and create a new db polutated with their data.
KennethThe easiest way that comes to mind would be to add some sort ofcustomer identifer to the primary database, and when you're ready toexport, run a script that copies the rows with that customer identiferfrom the primary database to a blank model database specific for thatcustomer.
All you'd have to do is write the script one, and them plug in the customer identifer when you're ready to export.
Subscribe to:
Posts (Atom)