External table and error: ORA-01036: illegal variable name/number
using the following script I get the referenced error:
create table dol_sch_c_part2
(DLN NUMBER(14) ,
PAGE_ID VARCHAR2(20),
PAGE_SEQ VARCHAR2(20),
PAGE_ROW_NUM VARCHAR2(20),
ROW_NUM VARCHAR2(20),
IMAGE_FORM_ID VARCHAR2(20),
PROVIDER_TERM_01_NAME VARCHAR2(35),
PROVIDER_TERM_01_EIN VARCHAR2(9) ,
PROVIDER_TERM_01_POSITION VARCHAR2(25),
PROVIDER_TERM_01_STR_ADDRESS VARCHAR2(35),
PROVIDER_TERM_01_CITY VARCHAR2(20),
PROVIDER_TERM_01_STATE VARCHAR2(2),
PROVIDER_TERM_01_ZIP_CODE VARCHAR2(9),
PROVIDER_TERM_01_PHONE_NUM VARCHAR2(10),
PROVIDER_TERM_01_TEXT VARCHAR2(250)
ORGANIZATION EXTERNAL
( type oracle_loader
default directory data_dir
access parameters
RECORDS FIXED 510
FIELDS
DLN(1:14) char(14),
PAGE_ID(15:34) char(20) NULLIF PAGE_ID=BLANKS,
PAGE_SEQ(35:54) char(20) NULLIF PAGE_SEQ=BLANKS,
PAGE_ROW_NUM(55:74) char(20) NULLIF PAGE_ROW_NUM=BLANKS,
ROW_NUM(75:94) char(20) NULLIF ROW_NUM=BLANKS,
IMAGE_FORM_ID(95:114) char(20) NULLIF IMAGE_FORM_ID=BLANKS,
PROVIDER_TERM_01_NAME(115:149) char(35) NULLIF PROVIDER_TERM_01_NAME=BLANKS,
PROVIDER_TERM_01_EIN(150:158) char(9) NULLIF PROVIDER_TERM_01_EIN=BLANKS,
PROVIDER_TERM_01_POSITION(159:183) char(25) NULLIF PROVIDER_TERM_01_POSITION=BLANKS,
PROVIDER_TERM_01_STR_ADDRESS(184:218) char(35) NULLIF PROVIDER_TERM_01_STR_ADDRESS=BLANKS,
PROVIDER_TERM_01_CITY(219:238) char(20) NULLIF PROVIDER_TERM_01_CITY=BLANKS,
PROVIDER_TERM_01_STATE(239:240) char(2) NULLIF PROVIDER_TERM_01_STATE=BLANKS,
PROVIDER_TERM_01_ZIP_CODE(241:249) char(9) NULLIF PROVIDER_TERM_01_ZIP_CODE=BLANKS,
PROVIDER_TERM_01_PHONE_NUM(250:259) char(10) NULLIF PROVIDER_TERM_01_PHONE_NUM=BLANKS,
PROVIDER_TERM_01_TEXT(260:509) char(250) NULLIF PROVIDER_TERM_01_TEXT=BLANKS
location ('f_dol_sch_c_part2.txt')
I've tried it with and without the char(*) in the fields section - no change
thanks
*** SCRIPT START : Session:GLEN_SELF@RAMBO(8) 8/31/2006 12:16:48 PM ***
Processing ...
create or replace directory data_dir as 'c:\dol\'
create table dol_sch_c_part2
(DLN NUMBER(14) ,
PAGE_ID VARCHAR2(20),
PAGE_SEQ VARCHAR2(20),
PAGE_ROW_NUM VARCHAR2(20),
ROW_NUM VARCHAR2(20),
IMAGE_FORM_ID VARCHAR2(20),
PROVIDER_TERM_01_NAME VARCHAR2(35),
PROVIDER_TERM_01_EIN VARCHAR2(9),
PROVIDER_TERM_01_POSITION VARCHAR2(25),
PROVIDER_TERM_01_STR_ADDRESS VARCHAR2(35),
PROVIDER_TERM_01_CITY VARCHAR2(20),
PROVIDER_TERM_01_STATE VARCHAR2(2),
PROVIDER_TERM_01_ZIP_CODE VARCHAR2(9),
PROVIDER_TERM_01_PHONE_NUM VARCHAR2(10),
PROVIDER_TERM_01_TEXT VARCHAR2(250)
ORGANIZATION EXTERNAL
( type oracle_loader
default directory data_dir
logfile 'ext_tab.log'
access parameters
RECORDS FIXED 510
FIELDS
DLN(1:14),
PAGE_ID(15:34),
PAGE_SEQ(35:54),
PAGE_ROW_NUM(55:74),
ROW_NUM(75:94),
IMAGE_FORM_ID(95:114),
PROVIDER_TERM_01_NAME(115:149),
PROVIDER_TERM_01_EIN(150:158),
PROVIDER_TERM_01_POSITION(159:183),
PROVIDER_TERM_01_STR_ADDRESS(184:218),
PROVIDER_TERM_01_CITY(219:238),
PROVIDER_TERM_01_STATE(239:240),
PROVIDER_TERM_01_ZIP_CODE(241:249),
PROVIDER_TERM_01_PHONE_NUM(250:259),
PROVIDER_TERM_01_TEXT(260:509)
location ('f_dol_sch_c_part2.txt')
create or replace directory data_dir as 'c:\dol\'
ORA-01036: illegal variable name/number
*** Script stopped due to error ***
*** SCRIPT END : Session:GLEN_SELF@RAMBO(8) 8/31/2006 12:16:49 PM ***
Similar Messages
-
Oracle 11G and SqlDataSource: 'ORA-01036: illegal variable name/number'
[Resolved - http://forums.oracle.com/forums/thread.jspa?messageID=2366331�]
I've created a short video to explain my problem with Oracle and SqlDataSource. If you'd rather watch than read, go see the video at http://www.kencox.ca/video/oracelandsqldatasource.html.
I'm trying to do some extremely simple drag and drop development in Visual Web Developer 2008 with the Oracle 11g database and ODP.NET. According to Oracle, "The data provider can be used with the latest .NET Framework 3.5 version. "
The SELECT statement works fine, but any attempt to use UPDATE via the SQLDataSource UpdateCommand nets me the infamous 'ORA-01036: illegal variable name/number' error.
I wouldn't mind using one of my MSDN Support Incidents to have Microsoft take a look at this issue, but I'm not sure the problem is Microsoft's. It seems like Oracle is doing a poor job in its Visual Studio integration.
Question: Has anyone successfully used an UpdateCommand statement in SQLDataSource against Oracle 11g? If so, let me know!
Below, you see the entire code as generated in Visual Web Developer 2008. To see it in action, check the video at http://www.kencox.ca/video/oracelandsqldatasource.html.
Ken
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1"
EmptyDataText="There are no data records to display.">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="ACCOUNTID" HeaderText="ACCOUNTID"
SortExpression="ACCOUNTID" />
<asp:BoundField DataField="ACCOUNTNAME" HeaderText="ACCOUNTNAME"
SortExpression="ACCOUNTNAME" />
<asp:BoundField DataField="ACCOUNTLOCATION" HeaderText="ACCOUNTLOCATION"
SortExpression="ACCOUNTLOCATION" />
<asp:BoundField DataField="ACCOUNTPHONE" HeaderText="ACCOUNTPHONE"
SortExpression="ACCOUNTPHONE" />
<asp:BoundField DataField="ACCOUNTCONTACT" HeaderText="ACCOUNTCONTACT"
SortExpression="ACCOUNTCONTACT" />
<asp:BoundField DataField="ACCOUNTWEBSITE" HeaderText="ACCOUNTWEBSITE"
SortExpression="ACCOUNTWEBSITE" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString1.ProviderName %>"
SelectCommand="SELECT "ACCOUNTID", "ACCOUNTNAME", "ACCOUNTLOCATION", "ACCOUNTPHONE", "ACCOUNTCONTACT", "ACCOUNTWEBSITE" FROM "ACCOUNTS""
UpdateCommand="UPDATE ACCOUNTS SET ACCOUNTLOCATION = 'This Place' WHERE (ACCOUNTID = 4)">
</asp:SqlDataSource>
</div>
</form>
</body>
</html>//////////using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
Message was edited by:
kjopcKen,
One thing to be aware of is Microsoft has produced Visual Studio database tools and data provider for Oracle. In addition, Oracle has produced its own tools. Knowing which products you are using is important because you want to know which company you should be complaining about. :-)
In your video, you are using all Microsoft tools and data provider, not Oracle's.
I would recommend using Oracle Developer Tools (ODT) for VS and ODP.NET since these products are much better integrated with .NET and Oracle.
ODP.NET uses Oracle.DataAccess.Client namespace. System.Data.OracleClient belongs to the MS provider for Oracle, which Mark pointed out. If you drag and drop DB objects using ODT, it will generate ODP.NET code for you (and give you more data source wizard options as well).
You can download the latest 11g version of ODP.NET and ODT here:
http://www.oracle.com/technology/software/tech/windows/odpnet/index.html
These support .NET 3.5 and VS 2008. -
Query Errors: ORA-01036: illegal variable name/number
Hi All,
When I run a query against two tables within our data warehouse I am getting an IO Exception. Due to company restrictions I can't quickly increase my IO Limit So what I have done is written a query that cycles through all of the large tables partitions and extracts the data.
The problem I get is that when I run this query in Toad. It thinks my :MI, :SS are variables and wont run this. Does anyone know what I can do to resolve this issue?
create table completion_log
action_complate_dt date,
table_name varchar2(1000),
partition_number varchar2(1000)
nologging
compress ;
create table STORE_DATA_HERE
field_1 varchar2(1000),
field_2 date,
field_3 varchar2(1000)
nologging
compress ;
commit;
begin
for ptn in (select partition_name p from all_tab_partitions t where table_name='REALLY_LARGE_TABLE')
loop
execute immediate q'^
insert /*+ APPEND */ into STORE_DATA_HERE
SELECT field_1,
field_2,
field_3
FROM REALLY_LARGE_TABLE partition (^'||ptn.p||q'^)
WHERE field_3 IN ( 'XXXX', 'YYYY')
AND data_date BETWEEN TO_DATE('07/12/2011 00:00:00', 'DD/MM/YYYY HH24:MI:SS')
AND TO_DATE('08/12/2011 23:59:59', 'DD/MM/YYYY HH24:MI:SS')
^';
insert into completion_log values (sysdate,'STORE_DATA_HERE',ptn.p);
commit;
end loop;
end;In your case it is quite easy...
just remove the collons from the format and the literal...and off you go
begin
for ptn in (select partition_name p from all_tab_partitions t where table_name='REALLY_LARGE_TABLE')
loop
execute immediate q'^
insert /*+ APPEND */ into STORE_DATA_HERE
SELECT field_1,
field_2,
field_3
FROM REALLY_LARGE_TABLE partition (^'||ptn.p||q'^)
WHERE field_3 IN ( 'XXXX', 'YYYY')
AND data_date BETWEEN TO_DATE('07/12/2011 000000', 'DD/MM/YYYY HH24MISS')
AND TO_DATE('08/12/2011 235959', 'DD/MM/YYYY HH24MISS')
^';
insert into completion_log values (sysdate,'STORE_DATA_HERE',ptn.p);
commit;
end loop;
end; -
Need help with ora-01036 illegal variable name/number
Can you help me fix the following problem.
I'm getting an oracle exceptioin while running the following.
OracleParameter[] myParameters = new OracleParameter[] { new OracleParameter("SELECTEDREGIONS", OracleDbType.RefCursor, ParameterDirection.Output) };
XmlReader xRdr = oraclehelper.ExecuteXmlReader(myConnection,CommandType.StoredProcedure,"TEST_TESTPACKAGE.TEST_GETREGIONS_SP",myParameters);
the oracle helper function is
public XmlReader ExecuteXmlReader(OracleConnection inConnection,
CommandType inCommandType,
string inCommandText,
params OracleParameter[] inCommandParameters)
//create a command and prepare it for execution
OracleCommand cmd = new OracleCommand(inCommandText,inConnection);
cmd.CommandType = inCommandType;
if (inCommandParameters != null)
foreach (OracleParameter op in inCommandParameters)
cmd.Parameters.Add(op);
cmd.BindByName = true;
cmd.XmlCommandType = OracleXmlCommandType.Query;
cmd.XmlQueryProperties.RootTag = "Result";
cmd.XmlQueryProperties.RowTag = "Row";
if (cmd.Connection.State != ConnectionState.Open) cmd.Connection.Open();
XmlReader retval = null;
//create the DataAdapter & DataSet
retval = cmd.ExecuteXmlReader();
// detach the OracleParameters from the command object, so they can be used again.
cmd.Parameters.Clear();
return retval;
The stored proc is:
CREATE OR REPLACE package GJUTRAS.test_TestPackage AS
type sregions is REF CURSOR;
procedure test_GetRegions_sp
selectedregions out sregions
procedure test_GetRegByDescrip_sp
descript in varchar2,
selectedregions out sregions
end test_TestPackage;
CREATE OR REPLACE package body GJUTRAS.test_TestPackage AS
procedure test_GetRegions_sp
selectedregions out sregions
is
begin
open selectedregions for
select * from ods.region;
end test_GetRegions_sp;
procedure test_GetRegByDescrip_sp
descript in varchar2,
selectedregions out sregions
is
begin
open selectedregions for
select * from ods.region where description = descript;
end test_GetRegByDescrip_sp;
end test_TestPackage;
/The versions of the function that use text "select * from ods.region" work fine. It's using a stored procedure with ExecuteXmlReader that I can't seem to get working. The table is
CREATE TABLE REGION (
ID NUMBER(10) NOT NULL,
CODE VARCHAR2(100 BYTE),
ABBREV VARCHAR2(100 BYTE),
NAME VARCHAR2(500 BYTE),
EXTRA_FIELDS_ID NUMBER(10) NOT NULL,
ACTIVE_FLAG VARCHAR2(1 BYTE) NOT NULL,
DESCRIPTION VARCHAR2(4000 BYTE),
COMMENTS VARCHAR2(4000 BYTE),
KEYWORDS VARCHAR2(4000 BYTE),
CHNG_REASON_TYPE_ID NUMBER(10),
CHNG_REASON_CMNT VARCHAR2(4000 BYTE),
BEG_DATE DATE NOT NULL,
BEG_USER_ID NUMBER(10) NOT NULL,
CREATOR_ID NUMBER(10) NOT NULL,
CREATION_DATE DATE NOT NULL ) -
Anonymous PL/SQL . Illegal variable Name/number.
Hi
I have tested ODP.NET in ASP.NET for upload images. But when read back from DB then save image to local drive. When I tested given sample code working fine. But when I modify code only select statment in PL/SQL it gives error.
Following statment is the error. Illegal variable Name/number. Pl.
advice me what need to change.
Dim block As String = " BEGIN " & _
" SELECT Ad_Image into :2 from Printmedia WHERE Product_ID = " + ProdID + ";" & _
" end ;"You use bind variables. Great!
And then you do not use bind variables. Bummer!!
Why can you make the output from the SQL a bind variable, but you do not supply Product ID as a bind variable? This causes a unique and non-sharable SQL statement in the SQL Shared Pool. Where the emphasis is very obvious - shared SQL.
The definition should be something like this:
Dim block As String = "BEGIN SELECT Ad_Image into :1 from Printmedia WHERE Product_ID = :2; END;"But why are you using an anonymous PL/SQL block and a bind variable to get to the image? Deal with it as a cursor. Much easier. E.g.
Dim cursorSQL As String = "SELECT Ad_Image FROM Printmedia WHERE Product_ID = :1"Open the cursor. And there you have the resulting image column as a result. -
Does "Target table" and "Error Table" need to be in same DB as OWB's?
We get the following error ORA-00600: internal error code, arguments: [opixrb-3], [1036], ORA-01036: illegal variable name/number at the time of OWB execution
OWB seems to successfully log the errors rows in the error table when a) target table and it’s b) error table are in the same database as OWB’s but throws ORA-01036 error when they are in a remote database from OWB's
Any one has any information about this please...? It will be of great help
Edited by: ghiyer on Jul 20, 2009 8:42 AMOracle has come back to us saying that
"DML error logging feature is not supported for distributed DML."
Bug 5698887 has more information about this. -
SP2-0553: Illegal variable name "#25340;音字&#22411"
hi..
how to Insert Japanese language in oracle table
if i'm inserting French it inserted succesfully
if i'm inserting Japanese i'm getting these error
' SP2-0553: Illegal variable name "#25340;音字型". '
my DB setting is
Character set -> utf-8
NLS_LANG -> AMERICAN
NLS_TERRITORY - > AMERICA
Thanks
Venkataraman.LHi,
What tool are you using to insert the data?
It can be difficult to perform inserts of multi-byte data using SQL*Plus and standard INSERT statements because of character mapping between the OS and SQL*Plus. I've had success with SQL*Loader, perl, and Java.
Regards,
Rob -
Request: PL/SQL, External Table and SQL Loader
I see lately Questions asked in SQL and PL/SQL forum regarding SQL Loader and External Table are being moved to {forum:id=732}.
Being an PL/SQL developer for some time now i feel External Table (and if i may, SQL Loader and DBMS_DATAPUMP) are very much an integral part of a PL/SQL development and the question related to these topics are well suited in SQL and PL/SQL forum. Even in SQL and PL/SQL FAQ we have exclusive content that discuss on these topics {message:id=9360007}
So i would like to request the moderators to consider not moving such questions out of the SQL and PL/SQL forum.
Thanks,
Karthick.Karthick_Arp wrote:
I see lately Questions asked in SQL and PL/SQL forum regarding SQL Loader and External Table are being moved to {forum:id=732}.
Being an PL/SQL developer for some time now i feel External Table (and if i may, SQL Loader and DBMS_DATAPUMP) are very much an integral part of a PL/SQL development and the question related to these topics are well suited in SQL and PL/SQL forum. Even in SQL and PL/SQL FAQ we have exclusive content that discuss on these topics {message:id=9360007}
So i would like to request the moderators to consider not moving such questions out of the SQL and PL/SQL forum.
Thanks,
Karthick.Not sure which moderators are moving them... cos it ain't me. I'm quite happy to leave those there. -
SQL LOADER , EXTERNAL TABLE and ODBS DATA SOURCE
hello
Can any body help loading data from dbase file .dbt to an oracle 10g table.
I tried last day with SQL LOADER, EXTERNAL table , and ODBC data source.
Why all of these utilities still failing to solve my problem ?
Is there an efficient way to reach this goal ?
Thanks in advanceexport the dbase data file to text file,
then you have choice of using either sql loader or external table option to use.
regards -
Hello,
"C:\app\xps\product\11.2.0\dbhome_1" where is my installation of database oracle enterprise 11g; I use Windows 7 Pro.
I have in System PATH : C:\app\xps\product\11.2.0\dbhome_1\bin
I have in HKEY_LOCAL_MACHINE > SOFTWARE > ORACLE > SYSMAN > OracleDBConsoleorcl : "ORACLE_HOME" value "C:\app\xps\product\11.2.0\dbhome_1"
When i execute "sqlplus / as sysdba" command, i receive error: "The procedure entry point longjmp could not be found in the dynamic link lib. orauts.dll" and "Error ORA-12560"
If i execute
set ORACLE_HOME=C:\app\xps\product\11.2.0\dbhome_1
C:\>set PATH=%ORACLE_HOME%\bin;%PATH%
sqlplus "/ as sysdba"
I don't receive Error.
Why?You don't mention which specific version of the operating system that you are using - Windows XP, Vista, or 7 and whether you're using a 32-bit or 64-bit version.
FWIW, kernell32.dll is a Windows system-level module, so it's possible that you have some corruption in your Windows installation which is preventing FM from launching.
Also, 2Gb of RAM is a bit lean for FM. -
I get error while loading data into Oracle 11g R2 with EXTERNAL TABLES.
error processing column DATE_M in row 1 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01847: day of month must be between 1 and last day of month
error processing column DATE_M in row 2 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 3 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 4 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01847: day of month must be between 1 and last day of month
error processing column DATE_M in row 5 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 6 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 7 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 8 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 9 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month
error processing column DATE_M in row 10 for datafile C:\app\S\admin\orcl\dpdump\TABLE_EXT.txt
ORA-01843: not a valid month-----
CREATE TABLE TABLE_EXT
( "COMPANY" VARCHAR2(101),
"COMPANY_VN" VARCHAR2(15),
"IL" VARCHAR2(17),
"TERMINAL" VARCHAR2(8),
"T_NO" VARCHAR2(15),
"NAME" VARCHAR2(108),
"SNAME" VARCHAR2(50),
"REF_NO" VARCHAR2(23),
"AMOUNT" NUMBER(15,2),
"DATE_M" DATE,
"TIME" VARCHAR2(11),
"TEL_NO" VARCHAR2(25),
"ADDRESS" VARCHAR2(50)
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY data_pump_dir
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
FIELDS TERMINATED BY '|'
MISSING FIELD VALUES ARE NULL
COMPANY,
COMPANY_VN,
IL,
TERMINAL,
T_NO,
NAME,
SNAME,
REF_NO,
AMOUNT decimal ,
DATE_M CHAR date_format DATE mask "dd.mm.yyyy" ,
TIME,
TEL_NO,
ADDRESS
LOCATION ('TABLE_EXT.txt')
REJECT LIMIT 10------
Sample Data:
CITY HOSPITAL|04680072124|CITY|00614860|47746244218|JOHN|WHITE|172871|420,12|21.08.2011|14:26|0806422627784|06
CITY HOSPITAL|04680072124|CITY|00614847|14274017676|BRAD|BROWN|448127|810,00|22.08.2011|11:04|0806427488476|06
CITY HOSPITAL|04680072124|CITY|00614842|16218778886|PETER|BALSON|862626|12,00|24.08.2011|14:16|0806062177008|06
CITY HOSPITAL|04680072124|CITY|00614846|14607666866|GEORGE|LOUIS|688811|40,10|24.08.2011|08:48|0806424172468|06
CITY HOSPITAL|04680072124|CITY|00614846|14607666866|GEORGE|LOUIS|460481|42,64|24.08.2011|08:47|0806424172468|06
CITY HOSPITAL|04680072124|CITY|00614860|18460662462|JR|TEPE|404622|44,16|22.04.2011|20:08|0806446446866|06
CITY HOSPITAL|04680072124|CITY|00614840|47207688618|BARRY|HRAN|402886|42,40|27.08.2011|11:12|0806478768007|06
CITY HOSPITAL|04680072124|CITY|00614847|42161048612|TOM|HIGGS|148640|12,00|06.06.2011|08:18|0806068076700|06
CITY HOSPITAL|04680072124|CITY|00614846|42161048612|TOM|HIGGS|208847|12,00|06.06.2011|08:46|0806068076700|06-----
NLS_DATE_FORMAT : DD/MM/RRRR-----
NOTE:
I tried :
TARIH CHAR date_format DATE mask "DD/MM/RRRR" , same error.
Edited by: 904386 on Jan 24, 2012 6:42 AMI have no experience with external tables but my understanding is that they are described the same was as you would describe a file to be loaded by SQL Loader. When ever I create a sql loader control file to load a date column I use syntax like this:
DATE_M "TO_DATE(:DATE_M,'dd.mm.yyyy')",Not sure if that will work for external tables or not. -
XML File in External Table - OS error permission denied.
Hi.
10g R2, Red Hat Linux
I'm using the article (see below, taken from http://www.dbazine.com/olc/olc-articles/scardina1 by Mark Scardina) to create an external table where I'd store my XML file.
So, I
1. Created a directory xmlfile_dir
2. Granted access to needed db user
3. Created the table
CREATE TABLE relayxml_xt (doc CLOB)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY xmlfile_dir
ACCESS PARAMETERS
FIELDS (lobfn CHAR TERMINATED BY ',')
COLUMN TRANSFORMS (doc FROM lobfile (lobfn))
LOCATION ('xml.dat')
REJECT LIMIT UNLIMITED;
4. mv relay.xml /xmlfile_dir/xml.dat
When I run SELECT * FROM relayxml_xt I get this:
Error starting at line 1 in command:
select * from relayxml_xt
Error report:
SQL Error: ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-04063: unable to open log file RELAYXML_XT_28773.log
OS error Permission denied
ORA-06512: at "SYS.ORACLE_LOADER", line 19
29913. 00000 - "error in executing %s callout"
*Cause: The execution of the specified callout caused an error.
*Action: Examine the error messages take appropriate action.
What am I doing wrong?
Thanks,
Using External Tables
Introduced in Oracle9i, Oracle’s external table feature offers a solution to define a table in the database while leaving the data stored outside of the database. Prior to Oracle Database 10g, external tables can be used only as read-only tables. In other words, if you create an external table for XML files, these files can be queries and the table can be joined with other tables. However, no DML operations, such as INSERT, UPDATE, and DELETE, are allowed on the external tables.
Note: In Oracle Database 10g , by using the ORACLE_DATAPUMP driver instead of the default ORACLE_DRIVER, you can write to external tables. In Oracle Database 10g, you can define VARCHAR2 and CLOB columns in external tables to store XML documents. The following example shows how you can create an external table with a CLOB column to store the XML documents. First, you need to create a DIRECTORY to read the data files:
CREATE DIRECTORY data_file_dir AS 'D:\xmlbook\Examples\Chapter9\src\xml';
GRANT READ, WRITE ON DIRECTORY data_file_dir TO demo;
Then, you can use this DIRECTORY to define an external table:
CREATE TABLE customer_xt (doc CLOB)
ORGANIZATION EXTERNAL
TYPE ORACLE_LOADER
DEFAULT DIRECTORY data_file_dir
ACCESS PARAMETERS
FIELDS (lobfn CHAR TERMINATED BY ',')
COLUMN TRANSFORMS (doc FROM lobfile (lobfn))
LOCATION ('xml.dat')
REJECT LIMIT UNLIMITED;
The xml.dat file follows:
customer1.xml
customer2.xml
If you describe the table, you can see the following definition:
SQL> DESC customer_xt;
Name Null? Type
DOC CLOB
Then, you can query the XML document as follows:
SELECT XMLType(doc).extract('/Customer/EMAIL')
FROM customer_xt;
Though the query requires run-time XMLType creation and XPath evaluation, this approach is useful when applications just need a few queries on the XML data and don’t want to upload the XML data into database. In Oracle Database 10g, you cannot create external tables that contain pre-defined XMLType column types.
Message was edited by:
vi2167Your don't have the proper operating system privileges. Be sure that you (=oracle OS user / the OS Linux user that is starting the database) are allowed have read privs on the path and/or file.
for example...
chown -Rf /xxxxxxx/xxxx/etc
ls -l file.xml
file.xml oracle:oinstall rw-rw-rw -
External table causing error on count(*)
I created an external table, when i do count(*) from the table
it is giving me the error :
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-29400: data cartridge error
KUP-04018: partial record at end of file
here is my definition for the file :
CREATE TABLE ext_tab
TYPEVENDORCODE VARCHAR2(4000 BYTE),
VENDORCODE VARCHAR2(4000 BYTE),
WRKCODEWRKDONEFHA VARCHAR2(4000 BYTE),
FILLER4 VARCHAR2(4000 BYTE),
TYPECODEVENDOR VARCHAR2(4000 BYTE),
FILLER6 VARCHAR2(4000 BYTE),
FILLER7 VARCHAR2(4000 BYTE),
TYPE VARCHAR2(4000 BYTE),
FILLER9 VARCHAR2(4000 BYTE),
COST VARCHAR2(4000 BYTE),
PHOTOS VARCHAR2(4000 BYTE),
SUBJECTTODISCOUNT VARCHAR2(4000 BYTE),
FHAREGION VARCHAR2(4000 BYTE),
AVERAGECOST VARCHAR2(4000 BYTE),
FILLER15 VARCHAR2(4000 BYTE),
FILLER16 VARCHAR2(4000 BYTE),
FILLER17 VARCHAR2(4000 BYTE)
ORGANIZATION EXTERNAL
( TYPE ORACLE_LOADER
DEFAULT DIRECTORY dir1
ACCESS PARAMETERS
( RECORDS FIXED 512
SKIP 1
READSIZE 3840000
BADFILE 'STG0_FILE71_EXT.BAD'
LOGFILE 'STG0_FILE71_EXT.LOG'
FIELDS TERMINATED BY 0x'0A'
NOTRIM
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
typevendorcode CHAR(4000),
vendorcode CHAR(4000),
wrkcodewrkdonefha CHAR(4000),
filler4 CHAR(4000),
typecodevendor CHAR(4000),
filler6 CHAR(4000),
filler7 CHAR(4000),
type CHAR(4000),
filler9 CHAR(4000),
cost CHAR(4000),
photos CHAR(4000),
subjecttodiscount CHAR(4000),
fharegion CHAR(4000),
averagecost CHAR(4000),
filler15 CHAR(4000),
filler16 CHAR(4000),
filler17 CHAR(4000)
LOCATION (dir1:'abc.DAT.raw')
REJECT LIMIT UNLIMITED
NOPARALLEL
NOMONITORING;
any thoughts?
billuI don't think there is any way to modify your table definition to accommodate the (apparent) fact that missing values generate nothing in the file you want to load.
It seems that you are saying that the format of the file is not actually fixed in any way, that is has some, but not all values, and that mising values are just skipped.
Assuming for a moment that the fields are delimited bt a pipe symbol (|) then it seems to me that you have this situation :
Defined file format:
ID|name|age|addresswhich would imply the file should look like:
123|John|42|123 MainSt.
456|Fred|39|45 Pine St.but sometimes you get:
12345|27|12 Elm St.If this is the case, there is no possible way that the file can be reliably parsed since there is no consistnet format. If field values could be missing, you need to get whoever generates the file to do something more like:
12345||27|12 Elm St.That is, put in the field delimiters even if there is no value for the field.
John -
External Table LKM: error during task interpretation
I've had this problem more than once now, using "LKM File to Oracle (EXTERNAL TABLE)". Before the interface can even run, I get an error, as if the script can't be output. I've tried removing the LKM and reimporting. No use. I am using this LKM successfully in other projects... not sure why it would have issues here. When I had this problem previously, Oracle Support couldn't reproduce it (they certainly tried). I managed to work around it then, but now... this is getting problematic. Insight welcome.
Here's the start of the error:
com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Error during task interpretation
Task:6
java.lang.Exception: BeanShell script error: Sourced file: inline evaluation of: ``out.print("The application script threw an exception: java.lang.StringIndexOutOf . . . '' Token Parsing Error: Lexical error at line 2, column 42. Encountered: "\\" (92), after : "": <at unknown location>
BSF info: Create external table at line: 0 column: columnNo
at com.sunopsis.dwg.codeinterpretor.a.a(a.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.h.y(h.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
Text:The application script threw an exception: java.lang.StringIndexOutOfBoundsException: *String index out of range: 2* BSF info: Create external table at line: 0 column: columnNoHi,
I have this exact problem, did you get a solution?
Thanks -
From pl/sql table getting error - "ORA-01403: no data found"
Hi All,
i habe written package, and the spce define as -
type F761RecType is RECORD (
type F761TabType is TABLE of F761RecType INDEX BY BINARY_INTEGER;
l_F761_table F761TabType;
PROCEDURE modification1
p_F761_table IN F761TabType,
From button click of form i passed -
DECLARE
l_f761_table I743_PUC_MAPS_TREE_PKG.F761TabType;
l_counter number;
BEGIN
LOOP
l_counter :=l_counter+1;
l_f761_table(l_counter).P_TABLE := :MAPS.P_table;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE' ;
next_record;
end loop;
i743_puc_maps_tree_pkg.modification1(
p_F761_table => l_f761_table,
END;
Now when I take table count (l_f761_table.count) in button click in form level I am getting value; but when I try to get the count in sid the package, it giving error "ORA-01403: no data found".
Pls tell me where I am wrong ..!!
BR,
SubirThaks all, probls has been solved..
Maybe you are looking for
-
Credit charges based on the number of credit days offered to the customer
AOA, I have a scenario. We have credit charges based on the number of credit days offered to the customer. This scenario will be executed on credit sales only. Example of pricing, a product mobile is offered to customer A on 20 Days credit Mobile $
-
Grandstream GXW4108/Elastix setup , Caller ID problem
First I have to say, I don't know this gateway. But I have seen this before with Linksys gateways where you get the device account ID instead of who called. In asterisk terms you are seeing the called ID and not the caller ID. Are you sure you have
-
Submit a Document on a bug workaround in metalink
Hi All, Recently I did a workaround for an oracle bug. I'd like to publish a document in metalink for our use. Is there is way, where i can publish it in metalink or any other technical site? Cheers, Kamalesh JK
-
Trying to print to video using in and out
I am trying to print to video (Mini DV) using in and out points. It works fine when I just play through the camera and record and it will print to video when I start at the beginning, but when I place in and out points and I have set the media to pri
-
Is there any way I can create folder in my shared library?
I have a lot of videos and it's all mixed up and I would really like to have them in folders.