XSL must be an external file ? (PL/SQL)
this my problem in PL/SQL :
I have an XML and an XSL inside a table as CLOBs.
I want to transform my XML with the XSL, but it seems
like there is no function to do it. I've found some but the xsl
must be external, not in a table...
this is a sample of what I'm trying to do :
queryCtx := DBMS_XMLQuery.newContext(xml_Lob);
DBMS_XMLQuery.setDateFormat(queryCtx,'yyyy/MM/dd');
DBMS_XMLQuery.setXSLT(queryCtx,xsl_Lob);
DBMS_XMLQuery.setDateFormat(queryCtx,'yyyy/MM/dd hh:mm:ss');
xml_Lob := DBMS_XMLQuery.getXML(queryCtx,null); ---crash here.---
DBMS_XMLQuery.closeContext(queryCtx);
Am I doing something wrong ?
With this code, we can transfer a xml file with a xsl file
inside a database.
tools xslprocessor.Processor;
result varchar2(32000);
doc_src xmldom.DOMDocument;
style xslprocessor.Stylesheet;
xmldoc xmldom.DOMDocument;
newsheet xslprocessor.Stylesheet;
xmldoc := xml.parse(clob_xml);
newsheet := xslprocessor.newStylesheet(xmldoc,NULL);
tools := xslprocessor.newProcessor;
xslprocessor.processXSL(tools ,newsheet, doc_src ,result);
xslprocessor.freeProcessor(tools);
For more informations,you can consult the book "Builiding Oracle
XML Applications" ......by 'Steve Muench' .....
Thanks...
Similar Messages
-
Adding a link to an external file into SQL table
I would like to add a link to an external file (picture stored on my local hard drive) into SQL table. Then use C# to query data from SQL table and export to Excel. I got everything working ok except the link to external file. I would like to export
this link to Excel and user can click on the link to open the file. How can I accomplish this? Thank you very much in advance for your help!In that case the Filetable feature could be of interest to you. With this feature the file can be part of the database, and still be accessible from tools outside SQL Server.
I don't really have any good examples handy, but if anyone knows of a good blog post that could help Nhan, please feel free to add.
Here is a link to the description in Books Online:
http://msdn.microsoft.com/en-us/library/ff929144.aspx
Erland Sommarskog, SQL Server MVP, [email protected] -
Create a cursor from a PL/SQL variable or an external file
Dear friends,
is there a way for me to make Oracle Forms read a cursor from a PL/SQL variable, or an external file? Let's suppose we have the code below:
DECLARE
cursor c_values is select * from my_table;
r_values c_values%ROWTYPE;
BEGIN
for r_values in c_values loop
do_something;
end loop;
END;
In the situation described above, could I create "select * from my_table" from a PL/SQL variable (it could be something like p_cursor = 'select * from my_table'), or an external file - for example, make my form read the contents of c:\my_select.sql , where we see the "select * from my table" text?
My question comes because I need to export data from select instructions that were dinamically created inside the form - that is, via PL/SQL -, and I don't want to rewrite it, but I'll have to do it if I have no choice. Your help will be greatly appreciated.
Best regards,
Franklin
Edited by: franklinbrasil on 12/03/2009 11:33
Edited by: franklinbrasil on 12/03/2009 11:35Dear friends,
I am using DBMS_SQL package, which solved my problem. Please let me explain it better, if it's not clear.
I have some PL/SQL blocks inside my form, which creates SQL queries dinamically, and a dinamically created SQL is stored into a VARCHAR2 variable. These SQL queries are exported for use in Oracle Graphics, but since OG is not being developed by Oracle anymore then I am trying to find a substitute for it.
So I thought about creating an option for the final user: he/she can choose exporting data into Microsoft Excel, and user does what he/she wants, creating a customized graphic. Exporting into Excel works finely, with no problems at all - I could find a routine by searching on the web.
My goal was to use the same queries created above to export data dinamically to Microsoft Excel, and I absolutely don't want to rewrite all these dinamically created queries - one which works dinamically, other with no flexibility inside my form. Worse than it, I have many other dinamically created queries, and I obviously don't want to rewrite them all - any maintenance in this form would be terrible, with each SQL instruction written twice.
Since all dinamically created SQL instructions are stored inside a VARCHAR2 variable, I thought about reusing the same SQL, as explained above - and here we have your suggestions about using a ref cursor, execute immediate, and so on. And (answering Andreas) query structure is always based on the same table, but its structure changes a lot, depending on what the final user chooses in a drop-down list (it's a list of graphics options, where final user chooses one option, and form must mount SQL dinamically, based on user's choice).
By using your explanations, I could find DBMS_SQL solution here: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg09dyn.htm#26799
. Please notice that I had to change DBMS_SQL.native into 1 for it to work in my form. I'll mark all your answers as helpful because I can use them both for database and form purposes.
If my message was not clear enough, please tell me and I'll try to make it more clear.
Best regards,
Franklin -
How to execute command(program) from external file in Oracle SQL developer
Hi,
Does anyone know, Oracle SQL developer version 1.0.0.14.67 got any function that can execute command from an external file?
Example, i have 100 insert SQL inside a text file,
and i want to use Oracle SQL developer to execute it. How do i read from my text file? Thanks a lots.If you're new to Oracle, do yourself and us a favour: read some tutorials and manuals. What sqldev's worth, better download the latest version (1.1.2), lots of fixes and enhancements...
Now for the big popper: to run an external file: @file
Best of luck,
K. -
Reading the Blob and writing it to an external file in an xml tree format
Hi,
We have a table by name clarity_response_log and content of the column(Response_file) is BLOB and we have xml file or xml content in that column. Most probably the column or table may be having more than 5 records and hence we need to read the corresponding blob content and write to an external file.
CREATE TABLE CLARITY_RESPONSE_LOG
REQUEST_CODE NUMBER,
RESPONSE_FILE BLOB,
DATE_CRATED DATE NOT NULL,
CREATED_BY NUMBER NOT NULL,
UPDATED_BY NUMBER DEFAULT 1,
DATE_UPDATED VARCHAR2(20 BYTE) DEFAULT SYSDATE
)The xml content in the insert statement is very small because of some reason and cannot be made public and indeed we have a very big xml file stored in the BLOB column or Response_File column
Insert into CLARITY_RESPONSE_LOG
(REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
Values
(5, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
Insert into CLARITY_RESPONSE_LOG
(REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
Values
(6, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
Insert into CLARITY_RESPONSE_LOG
(REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
Values
(7, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
Insert into CLARITY_RESPONSE_LOG
(REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
Values
(8, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
Insert into CLARITY_RESPONSE_LOG
(REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
Values
(9, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');THe corresponding proc for reading the data and writing the data to an external file goes something like this
SET serveroutput ON
DECLARE
vstart NUMBER := 1;
bytelen NUMBER := 32000;
len NUMBER;
my_vr RAW (32000);
x NUMBER;
l_output UTL_FILE.FILE_TYPE;
BEGIN
-- define output directory
l_output :=
UTL_FILE.FOPEN ('CWFSTORE_RESPONCE_XML', 'extract500.txt', 'wb', 32760);
vstart := 1;
bytelen := 32000;
---get the Blob locator
FOR rec IN (SELECT response_file vblob
FROM clarity_response_log
WHERE TRUNC (date_crated) = TRUNC (SYSDATE - 1))
LOOP
--get length of the blob
len := DBMS_LOB.getlength (rec.vblob);
DBMS_OUTPUT.PUT_LINE (len);
x := len;
---- If small enough for a single write
IF len < 32760
THEN
UTL_FILE.put_raw (l_output, rec.vblob);
UTL_FILE.FFLUSH (l_output);
ELSE
-------- write in pieces
vstart := 1;
WHILE vstart < len AND bytelen > 0
LOOP
DBMS_LOB.READ (rec.vblob, bytelen, vstart, my_vr);
UTL_FILE.put_raw (l_output, my_vr);
UTL_FILE.FFLUSH (l_output);
---------------- set the start position for the next cut
vstart := vstart + bytelen;
---------- set the end position if less than 32000 bytes
x := x - bytelen;
IF x < 32000
THEN
bytelen := x;
END IF;
UTL_FILE.NEW_LINE (l_output);
END LOOP;
----------------- --- UTL_FILE.NEW_LINE(l_output);
END IF;
END LOOP;
UTL_FILE.FCLOSE (l_output);
END;The above code works well and all the records or xml contents are being written simultaneously adjacent to each other but we each records must be written to a new line or there must be a line gap or a blank line between any two records
the code which I get is as follow all all xml data comes on a single line
<?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7369</empno><ename>James</ename><job>Manager</job><salary>1000</salary></emp><?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7370</empno><ename>charles</ename><job>President</job><salary>500</salary></emp>But the code written to an external file has to be something like this.
<?xml version="1.0" encoding="ISO-8859-1"?>
<emp>
<empno>7369</empno>
<ename>James</ename>
<job>Manager</job>
<salary>1000</salary>
</emp>
<?xml version="1.0" encoding="ISO-8859-1"?>
<emp>
<empno>7370</empno>
<ename>charles</ename>
<job>President</job>
<salary>500</salary>
</emp>Please adviceWhat was wrong with the previous answers given on your other thread:
Export Blob data to text file(-29285-ORA-29285: file write error)
If there's a continuing issue, stay with the same thread, don't just ask the same question again and again, it's really Pi**es people off and causes confusion as not everyone will be familiar with what answers you've already had. You're just wasting people's time by doing that.
As already mentioned before, convert your BLOB to a CLOB and then to XMLTYPE where it can be treated as XML and written out to file in a variety of ways including the way I showed you on the other thread.
You really seem to be struggling to get the worst possible way to work. -
Problem attaching mdf file in sql server 2008
hi...!
I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
Fail to retrieve data for this request.
An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
Thanks in advancehi...!
I have an mdf file of sql server 2005 database now i want it to attach in sql server 2008 R2 but when i try to attach it, it gave me error saying.
Fail to retrieve data for this request.
An exception occur while executing a Transact-SQL statement or batch.(Microsoft.sqlServer.connectionInfo)
C:\program files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\file6.mdf is not a primary database file. (Microsoft SQL Server, Error:5171)
Thanks in advance
Hello,
As the message says the file is not primary data file ,i guess it must be ndf(secondary data file) or some other file you might have selected by mistake.PLease select primary data file and try attching you will succed
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Writing agents o/p to external file and if i run the agent again it should
Hi All,
i want to run a agent and that result should be displayed in external file system.and i achieved this by using writing VB script and in agents i used actions in that we have invoke server script.And i got the perfect output but what 's my scenario is when i run the agnent again it should create another file with below requirements.
The file name must contain a suffix containing the date in yyyymmdd format. In cases where the file stored more than once per day, a sequence number must also be provided within the filename.
(i.e. v1_yyyymmdd, v2_yyyymmdd, v3_yyyymmdd, v4_yyyymmdd, v5_yyyymmdd…)
And my VB script is like below
'#####=========================================================================
'## Title: Export Report
'## Rev: 1.0
'## Author: Paul McGarrick
'## Company: Total Business Intelligence / http://total-bi.com
'## Purpose:
'## 1. This script takes a file from OBIEE and saves to the file system
'## 2. Creates a reporting subdirectory if not already present
'## 3. Creates a further subdirectory with name based on current date
'## Inputs (specified in Actions tab of OBIEE Delivers Agent):
'## 1. Parameter(0) - This actual file to be exported
'## 2. Parameter(1) - The filename specified within OBIEE
'## 3. Parameter(2) - Report sub directory name specified within OBIEE
'#####=========================================================================
Dim sBasePath
sBasePath = "E:\reports\reports"
Dim sMasterPath
sMasterPath = sBasePath & "\" & Parameter(2)
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'check whether master directory exists, if not create
Dim objMasterDir
If Not objFSO.FolderExists(sMasterPath) Then
Set objMasterDir = objFSO.CreateFolder(sMasterPath)
End If
Set objMasterDir = Nothing
'build string to get date in yyyy-mm-dd format
Dim sDate, sDateFull
sDate = Now
sDateFull = DatePart("yyyy", sDate) & "-"
If Len(DatePart("m", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("m", sDate) & "-"
If Len(DatePart("d", sDate))=1 Then sDateFull = sDateFull & "0" End If
sDateFull = sDateFull & DatePart("d", sDate)
Dim sDir
sDir = sMasterPath & "\" & sDateFull
Dim objDir
If Not objFSO.FolderExists(sDir) Then
Set objDir = objFSO.CreateFolder(sDir)
End If
Set objDir = Nothing
Dim sFileName
sFileName = sDir & "\" & Parameter(1)
Dim objFile
objFSO.CopyFile Parameter(0), sFileName, True
Set objFile = Nothing
Set objFSO = Nothing
could you please any body help me out from this....I assume you are using Windows. Try to write a batch file so that that would look for the ibot name when ever its finds rename the file name as required.
This would be easiest way..
http://lmgtfy.com/?q=rename+a+file+to+current+date+using+batch+file
Edited by: Srini VEERAVALLI on Apr 8, 2013 7:23 AM
Can you updates all your posts?
Edited by: Srini VEERAVALLI on May 13, 2013 6:44 AM -
How can I write to a (external)file from a stored procedure
I want to write some data to a (external) file. I have it working with the function UTL_FILE.
My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
Does anyone know a way to build this.
Please send your responses to [email protected]
Many thanks,
Alex Nagtegaalan extraction out of expert one-on-one from Thomas Kyte
<quote>
when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
To change the default logon for the Oracle services go to (in Windows NT):
Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
In Windows 2000, this would be:
Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
* Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
* Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
You will of course need to stop and restart Oracle after changing the properties of the service.
<\quote>
I want to write some data to a (external) file. I have it working with the function UTL_FILE.
My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
Does anyone know a way to build this.
Please send your responses to [email protected]
Many thanks,
Alex Nagtegaal -
Importing flash with AS3 external files
developing a ui in flash for photo gallery which I am loading
into dreamweaver.
using as3 in flash to load external photo files so not all
having to download on opening.
have had no problem in dreamweaver with swfs with embedded
jpgs.
ui comes up in dreamweaver but not external files. even
though when I open swf movie or the flash created html of same
file, on its own, no prob.
anyone run across this problem, jpgs are in same file as
flash media, also dropped them into image file just in case that
might work---no go
any ideas ?Post a link to the page, please.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"pandorasboxtop" <[email protected]> wrote
in message
news:gajd7f$qpv$[email protected]..
> developing a ui in flash for photo gallery which I am
loading into
> dreamweaver.
> using as3 in flash to load external photo files so not
all having to
> download
> on opening.
> have had no problem in dreamweaver with swfs with
embedded jpgs.
> ui comes up in dreamweaver but not external files. even
though when I open
> swf
> movie or the flash created html of same file, on its
own, no prob.
> anyone run across this problem, jpgs are in same file as
flash media, also
> dropped them into image file just in case that might
work---no go
> any ideas ?
> -
URGENT: Problems Loading files with SQL Loader into a BLOB column
Hi friends,
I read a lot about how to load files into blob columns, but I found errors that I can't solve.
I've read several notes in these forums, ine of them:
sql loader: loading external file into blob
and tried the solutions but without good results.
Here are some of my tests:
With this .ctl:
LOAD DATA
INFILE *
INTO TABLE mytable
REPLACE
FIELDS TERMINATED BY ','
number1 INTEGER EXTERNAL,
cad1 CHAR(250),
image1 LOBFILE(cad1) TERMINATED BY EOF
BEGINDATA
1153,/opt/oracle/appl/myapp/1.0.0/img/1153.JPG,
the error when I execute sqlldr is:
SQL*Loader-350: Syntax error at line 9.
Expecting "," or ")", found "LOBFILE".
image1 LOBFILE(cad1) TERMINATED BY EOF
^
What problem exists with LOBFILE ??
(mytable of course has number1 as a NUMBER, cad1 as VARCHAR2(250) and image1 as BLOB
I tried too with :
LOAD DATA
INFILE sample.dat
INTO TABLE mytable
FIELDS TERMINATED BY ','
(cad1 CHAR(3),
cad2 FILLER CHAR(30),
image1 BFILE(CONSTANT "/opt/oracle/appl/myapp/1.0.0/img/", cad2))
sample.dat is:
1153,1153.JPEG,
and error is:
SQL*Loader-350: Syntax error at line 6.
Expecting "," or ")", found "FILLER".
cad2 FILLER CHAR(30),
^
I tried too with a procedure, but without results...
Any idea about this error messages?
Thanks a lot.
Jose L.> So you think that if one person put an "urgent" in the subject is screwing the problems of
other people?
Absolutely. As you are telling them "My posting is more important than yours and deserve faster attention and resolution than yours!".
So what could a typical response be? Someone telling you that his posting is more important by using the phrase "VERY URGENT!". And the next poster may decide that, no, his problem is evern more import - and use "EXTREMELY URGENT!!" as the subject. And the next one then raises the stakes by claiming his problem is "CODE RED! CRITICAL. DEFCON 4. URGENT!!!!".
Stupid, isn't it? As stupid as your instance that there is nothing wrong with your pitiful clamoring for attention to your problem by saying it is urgent.
What does the RFC's say about a meaningful title/subject in a public forum? I trust that you know what a RFC is? After all, you claim to have used public forums on the Internet for some years now..
The RFC on "public forums" is called The Usenet Article Format. This is what it has to say about the SUBJECT of a public posting:
=
The "Subject" line (formerly "Title") tells what the message is about. It should be suggestive enough of the contents of the message to enable a reader to make a decision whether to read the message based on the subject alone. If the message is submitted in response to another message (e.g., is a follow-up) the default subject should begin with the four characters "Re: ", and the "References" line is required. For follow-ups, the use of the "Summary" line is encouraged.
=
([url http://www.cs.tut.fi/~jkorpela/rfc/1036.html]RFC 1036, the Usenet article format)
Or how about [url http://www.cs.tut.fi/~jkorpela/usenet/dont.html]The seven don'ts of Usenet?
Point 7 of the Don'ts:
Don't try to catch attention by typing something foolish like "PLEASE HELP ME!!!! URGENT!!! I NEED YOUR HELP!!!" into the Subject line. Instead, type something informative (using normal mixed case!) that describes the subject matter.
Please tell me that you are not too thick to understand the basic principles of netiquette, or to argue with the RFCs that governs the very fabric of the Internet.
As for when I have an "urgent" problem? In my "real" work? I take it up with Oracle Support on Metalink by filing an iTAR/SR. As any non-idiot should do with a real-life Oracle crisis problem.
I do not barge into a public forum like you do, jump up and down, and demand quick attention by claiming that my problem is more important and more urgent and more deserving of attention that other people's problem in the very same forum. -
I can't put swf or html files with external files like spritesheets on my website.
Hello,
I developed a small test-application for my website. I did this using Flash Builder and Starling.
My website is created with Adobe Muse, if I try to place the SWF, it gives me an error. If I embed the .html file in an html-object, I get a blank screen.
Every other swf I created that has no external files such as spritesheets works fine, I can either place it or embed in html.
I have to say that I did not publish the website yet, as it is useless if I can't show my projects on it, but as I said the normal swf files work and the others not.
Does anyone have a suggestion or solution?
There must be one because there are a lot of Starling applications (e.g. Hungry Hero) that are embedded in a website.
Many thanks.Hello,
I developed a small test-application for my website. I did this using Flash Builder and Starling.
My website is created with Adobe Muse, if I try to place the SWF, it gives me an error. If I embed the .html file in an html-object, I get a blank screen.
Every other swf I created that has no external files such as spritesheets works fine, I can either place it or embed in html.
I have to say that I did not publish the website yet, as it is useless if I can't show my projects on it, but as I said the normal swf files work and the others not.
Does anyone have a suggestion or solution?
There must be one because there are a lot of Starling applications (e.g. Hungry Hero) that are embedded in a website.
Many thanks. -
External Table vs SQL Loader.
Hi,
Pls anybody can tell me what is the significant differences between external table and SQL Loader.Both fall into category of Oracle utilities
[SQL*Loader|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/utility.htm#i10606] is the one that loads data into Oracle tables from operating system files and [external table|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/utility.htm#i10611] is the one that
is providing functionality similiar as SQL*Loader in the means of accessing external data but with with a different logic and rules,it lets you access data in external sources as if they were in a table in the database. -
Unknown issue while loading .dbf file by sql loader
Hi guys,
I am having a unknown issue while loading .dbf file by sql loader.
I need to load .dbf data into oracle table.for this I converted .dbf file by just changing its extension as .csv . file structure after changing .dbf to .csv --
C_N_NUMBER,COMP_CODE,CPT_CODE,C_N_AMT,CM_NUMBER
1810/4,LKM,30,45,683196
1810/5,LKM,30,45,683197
1810/6,LKM,30,45,683198
1810/7,LKM,30,135,683200
1810/8,LKM,30,90,683201
1810/9,LKM,1,45,683246
1810/9,LKM,2,90,683246
1810/10,LKF,1,90,683286
2810/13,LKJ,1,50.5,680313
2810/14,LKJ,1,50,680316
1910/1,LKQ,1,90,680344
3910/2,LKF,1,238.12,680368
3910/3,LKF,1,45,680382
3910/4,LKF,1,45,680395
7910/5,LKS,1,45,680397
7910/6,LKS,1,90,680400
7910/7,LKS,1,45,680401
7910/8,LKS,1,238.12,680414
7910/9,LKS,1,193.12,680415
7910/10,LKS,1,45,680490
then I am loading it by sql loader.but I am getting always error below ...
Record 1: Rejected - Error on table C_N_DETL_TAB, column CPT_CODE.
ORA-01438: value larger than specified precision allowed for this column
Record 2: Rejected - Error on table C_N_DETL_TAB, column CPT_CODE.
ORA-01438: value larger than specified precision allowed for this column
table structure-
create table C_N_DETL_tab
"C_N_NUMBER" VARCHAR2(13),
"COMP_CODE" VARCHAR2(3),
"CPT_CODE" NUMBER(4),
"C_N_AMT" NUMBER(20,18),
"CM_NUMBER" NUMBER(7)
control file-
options(skip=1)
load data
infile '/softdump/pc/C_N_DETL.csv'
badfile '/softdump/pc/C_N_DETL.bad'
discardfile '/softdump/pc/C_N_DETL.dsc'
into table C_N_DETL_tab
truncate
FIELDS TERMINATED BY ","
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
C_N_NUMBER CHAR,
COMP_CODE CHAR,
CPT_CODE INTEGER,
C_N_AMT INTEGER,
CM_NUMBER INTEGER
but guys when I am increasing size of all columns of tabel upto its max value then data is loaded but when I am checking column max length after data loaded then its very less..
changed table structure-
create table C_N_DETL_tab
"C_N_NUMBER" VARCHAR2(130),
"COMP_CODE" VARCHAR2(30),
"CPT_CODE" NUMBER(32), ---- max value of number
"C_N_AMT" NUMBER(32,18), ---- max value of number
"CM_NUMBER" NUMBER(32) ---- max value of number
now i ma running ...
sqlldr express/express control=C_N_DETL.ctl log=C_N_DETL.log
o/p-
Table C_N_DETL_TAB, loaded from every logical record.
Insert option in effect for this table: TRUNCATE
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
---------- ---- ---- C_N_NUMBER FIRST * , O(") CHARACTER
COMP_CODE NEXT * , O(") CHARACTER
CPT_CODE NEXT 4 INTEGER
C_N_AMT NEXT 4 INTEGER
CM_NUMBER NEXT 4 INTEGER
Table C_N_DETL_TAB:
20 Rows successfully loaded.
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
select max(length( CPT_CODE))from C_N_DETL_tab ---> 9
can u tell me why I need to increase size of table columns upto max value?although length of data is soo much less.
kindly check it..thnx in advance...
rgds,
pcNo database version of course. Unimportant.
If I recall correctly, it is 'integer external ' and you would best double quoting the alphanumerics (which you didn't ).
Try changing integer in integer external in the ctl file.
Sybrand Bakker
Senior Oracle DBA -
Dynamic linking of external file
I try to link to an external file, and display it as the text file from oracle report. The path is determined at runtime. I searched on the Oracle Report's Help and found a hint on SRW.SET_HYPERLINK(...), but I couldn't get it work. Please help.
Thanks, in advance, for your help.
Regards,
TDTo link to a file dynamically, you need to use the "read from file" property against a column in the data-model.
If the filenames are stored in the database, you can use a simple query to create the column to return the filenames. Otherwise, you can use a PL/SQL formula column of type "char" to return the names.
Once you've created the column, set the "read from file" property to "yes" and set the format to "text". You can then create a field in the layout based on this column value.
The above, is the typical way of handling this. You can also use srw.set_field() to change the value of a field in a format trigger. This is less efficient but useful for some cases of dynamic values. -
Launch External Files from SSRS
I have a report that will list the names of files that are attached to this report in the database. I would like to include the list of files from the database and allow the users to click or double click the file name and have the file load.
Is there a way for SSRS to do this? The files can be in multiple formats, and in the project that adds the files we can use:
System.Diagnostics.Process.Start(filepath)
And it will launch the correct process to view the files. I have stored the the file itself in an image column, and I also have the full path and the file name in columns as well so I could create a dataset to retrieve the file names and show them
on the report.
Anyone have any suggestions?
Thanks.Hi katghoti,
If I understand correctly, you want to embed external files (word, pdf, image etc.) into a report in Reporting Services. If in this scenario, I suggest that you can use the following two methods to achieve your requirement:
Embed these files into database.
1) Use the SQL commands to embed these files in database as the image data.
2) Use the .net language (C#, VB) to convert this data into the image.
3) Use the image control to show these images, which are files embedded in database.
Reference:
How to embed a pdf document in Reporting Services
Upload these files in the report server, access them using URL.
1) We can upload these files in the report manager.
2) Adding hyperlinks to reports to link to these files stored on the report server.
Reference:
URL Access Parameter Reference in Reporting Services
How to add a Hyperlink to a URL in Reporting Services
Hope this helps.
Thanks,
Katherine Xiong
If you have any feedback on our support, please click
here.
Katherine Xiong
TechNet Community Support
Maybe you are looking for
-
I am trying to delete a file that will not let me
Ok , so I use to a Seagate Backup Plus Portable Driver 1T to hold and run certain games on mac. I am trying to remove something from my TRASH can , in which in wont budge. - I try to EMPTY trash , makes the trash empired noise, but is still there and
-
HP LaserJet M1132 MFP: unable to save scan to file
Hi, I just purchased a new HP LaserJet M1132 MFP. Everything is working fine except when using HP Director. It detects the device and scans. But when I try to save the file on my computer it doesn't succeed. Nothing is saved in the folder. What seems
-
How to change the width of the Properties Character Family block
I'm a n00b with Captivate but notice I am unable to change the font family or style in the block area because it runs into the side scroll bar. Based on videos I've seen, there should be an arrow allowing the ability to scroll down to font. The only
-
Can you disable 'Go to' page feature
Can you disable 'Go to' page feature in Acrobat as it getting in the way of other navigation I have added.
-
Live Audigy SE Bulk (SB0570) + Creative Inspire GD580 Speaker Syst
I am connect my SB and GD580 Speaker with coaxial cable Speaker settings (5. Speakers +"Digital output only") But "speaker Test" gives only 2 frontal speakers. Why do not work rest 3 ?