Issue inserting into USER_SDO_GEOM_METADATA via Oracle Apex
G'day All,
I've originally riased my issue in "Application Express - http://forums.oracle.com/forums/thread.jspa?threadID=537922&tstart=45 " but have not had any solutions provided yet.
Just a quick summary, when I insert a record into user_sdo_geom_metadata using Oracle Apex SQL Command tool and run a select on the view no records appear. After a bit of investigating I found it is wrongly being given a SDO_OWNER value of ANONYMOUS instead of the value from sys_context('userenv', 'CURRENT_SCHEMA') which in my case would be "TEST".
When I run SELECT sys_context('userenv', 'CURRENT_SCHEMA') FROM DUAL it correctly returns "TEST".
If anyone could let me know whats going wrong I would be most appreciated :)
Cheers
Mark
try to
grant select on table1 to schema2....
Once you have granted the access to teh schema...you should be able to access the MDSYS schema.
This should be OK.
Similar Messages
-
ORA-06502: error when inserting into table via db link with long datatype
Folks,
I am getting the following error:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small.
This occurs when an insert is done via a database link into a table that has a LONG data type for one of the columns, and the string contains some carriage returns and or line feeds.
I have checked by removing the db link, and inserting into a local table with identical column data types, where there is no error.
So this might be another db link bug?
So I need to remove the carriage returns and/or line feeds
in my pl/sql block in the page process. I have tried
l_text := REPLACE(l_text, CHR(10), ' ');
l_text := REPLACE(l_text, CHR(13), NULL);
but still getting the ORA-06502. Would really appreciate some advice here, please.
Cheers
KIMScott,
Time to 'fess up':
My fault sorry, the error was coming from another page process where I had allowed insufficient string length for one of the variables, and my error message did not identify the page process clearly.
This leads me to make a request for future releases, could the system error messages state which page process caused the problem?
One other thing I notice, and this might be a feature not a fault, the page processes are numbered: "Page Process: 3 of 5". However process 3 is not the 3rd one to be processed, and probably refers to the order in which they are created. Should the number reflect the process order?
Cheers
KIM -
INSERT INTO QUERY AGAINST ORACLE
I've tested the INSERTINTO query where it successfully pulls data from one table in SQL DB and inserts into another SQL DB.
However, when I use the same script to pull data from one table in Oracle DB to another table in Oracle DB, I get an error.
I'm assuming the syntax is a little different for Oracle?
Added debugging and the query looks like this...
** Begin FDM Runtime Error Log Entry [2012-06-27-21:20:57] **
ERROR:
Code............................................. 1
Description...................................... INSERT INTO tWadmin30284128092 (PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) SELECT 752, 12, '31-Mar-2008', 'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount FROM tdataseg4
Error Message...
** Begin FDM Runtime Error Log Entry [2012-06-27-21:10:52] **
ERROR:
Code............................................. -2147217900
Description...................................... ORA-02291: integrity constraint (FDM1113ORCL.FKC_DS6_TCTRLPERIOD) violated - parent key not found
INSERT /*+ Append */ INTO tDataSeg6 ( PartitionKey, CatKey, PeriodKey, DataView, CurKey, CalcAcctType, ChangeSign, JournalID, Amount, AmountX, Account, AccountX, AccountR, AccountF, Entity, EntityX, EntityR, EntityF, ICP, ICPX, ICPR, ICPF, UD1, UD1X, UD1R, UD1F, UD2, UD2X, UD2R, UD2F, UD3, UD3X, UD3R, UD3F, UD4, UD4X, UD4R, UD4F, DESC1, DESC2, ATTR1, ATTR2, ATTR3, ATTR4, ATTR5, ATTR6, ATTR7, ATTR8, ATTR9, ATTR10, ATTR11, ATTR12, ATTR13, ATTR14, ArchiveID, HasMemoItem, StaticDataKey ) SELECT PartitionKey, CatKey, PeriodKey, DataView, CurKey, CalcAcctType, ChangeSign, JournalID, Amount, AmountX, Account, AccountX, AccountR, AccountF, Entity, EntityX, EntityR, EntityF, ICP, ICPX, ICPR, ICPF, UD1, UD1X, UD1R, UD1F, UD2, UD2X, UD2R, UD2F, UD3, UD3X, UD3R, UD3F, UD4, UD4X, UD4R, UD4F, DESC1, DESC2, ATTR1, ATTR2, ATTR3, ATTR4, ATTR5, ATTR6, ATTR7, ATTR8, ATTR9, ATTR10, ATTR11, ATTR12, ATTR13, ATTR14, ArchiveID, HasMemoItem, StaticDataKey From tWadmin436038889587
Procedure........................................ clsDataManipulation.fExecuteDML
Component........................................ upsWDataWindowDM
Version.......................................... 1111
Thread........................................... 3888
Function INSERTINTO(strLoc, lngCatKey, dblPerKey, strWorkTableName)
'Oracle Hyperion FDM IMPORT Integration Script:
'Created By: admin
'Date Created: 2012-06-27-21:01:10
'Purpose:
Dim objSS 'ADODB.Connection
Dim strSQL 'SQL String
Dim rs 'Recordset
Dim rsAppend 'tTB table append rs Object
Dim strPeriod
Dim strYear
'Period
'strPeriod=MonthName(Month(RES.PdtePerKey))
a=CStr(FormatDateTime(RES.PdtePerKey,1))
'Tuesday,January 30, 2012
b=Right(a,(Len(a)-Len(DW.Utilities.fParseString(a,1,1,",")))) '7
c=DW.Utilities.fParseString(b,2,2,",")
strPeriod=Left(c,3)
'Year
'strYear=Year(RES.PdtePerKey)
strYear=Right(b,4)
DW.DBTools.mLogError 1, CStr(strPeriod), CStr(strYear), Nothing
'Initialize objects
Set cnSS = CreateObject("ADODB.Connection")
'Connect To SQL Server database
cnss.open "Provider=OraOLEDB.Oracle.1;Password=password;Persist Security Info=True;User ID=fdm1113orcl;Data Source=orcl"
'DW.DBTools.mLogError 1, CStr(strSQL), CStr(strSQL), Nothing
'Initialize common SQL statement
strSQL = "INSERT INTO " & _
strWorkTableName & " " & _
"(PartitionKey, CatKey, PeriodKey, DataView, CalcAcctType, Entity, Account, UD1, UD2, UD4, Amount) " & _
"SELECT " & RES.PlngLocKey & ", " & RES.PlngCatKey & ", " & _
"'" & Day(RES.PdtePerKey) & "-" & MonthName(Month(RES.PdtePerKey), True) & "-" & Year(RES.PdtePerKey) & "', " & _
"'YTD', 9, Entity, Account, UD1, UD2, UD4, Amount " & _
"FROM tdataseg4 " '& _
DW.DBTools.mLogError 1, CStr(strSQL), CStr(strWorkTableName), Nothing
DW.DataManipulation.fExecuteDML(strSQL)
'cnss.Execute strSQL
'Records loaded
RES.PlngActionType = 6
RES.PstrActionValue = "SQL Import successful!"
'Assign Return value
INSERTINTO = True
cnss.Close
Set cnss = Nothing
End FunctionEdited by: user12152138 on Jun 27, 2012 6:29 PM
Edited by: user12152138 on Jun 27, 2012 6:33 PM
Edited by: user12152138 on Jun 27, 2012 6:36 PM
Edited by: user12152138 on Jun 27, 2012 6:37 PM
Edited by: user12152138 on Jun 27, 2012 6:46 PMHi together,
I fixed the problem. I multiply the origin number with 10. The result is a number without any comma. During the insert into MSSql I divide by 10.
I now, this is a very strange solution but it works.
Yes I know this helps only, because the column can only save number with one decimal place. For higher decimal places you have to multiple it with 100 or 1000 or......
Hope this helps also other peoples.
kind regards
Joe -
Inserting into Postgres via ODBC Gateway
Hi, I've made some tests, here are results and questions:
Postgres:
CREATE TABLE t_dump
str character varying(100)
)Oracle: [ORADB: db link to Postgrers]
INSERT INTO "t_dump"@ORADB VALUES ('test'); Works fine, both from SQL as from PL/SQL
However:
Declare
m_str Varchar2 (10) := 'test';
Begin
INSERT INTO "t_dump"@ORADB VALUES (m_str);
End;Gives me an error:
Error report:
ORA-00604: error occurred at recursive SQL level 1
ORA-02067: transaction or savepoint rollback required
ORA-28511: lost RPC connection to heterogeneous remote agent using SID=ORA-28511: lost RPC connection to heterogeneous remote agent using SID=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DB)(PORT=1521))(CONNECT_DATA=(SID=pg)))
ORA-02055: distributed update operation failed; rollback required
ORA-02063: preceding lines from ORADB
ORA-06512: at line 8
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
(a statement applying to internal dictionary tables).
*Action: If the situation described in the next error on the stack
can be corrected, do so; otherwise contact Oracle Support.Dynamic SQL gives exact same error:
Declare
m_str Varchar2 (10) := 'test';
Begin
EXECUTE IMMEDIATE
'INSERT INTO "t_dump"@ORADB VALUES (:v0)'
Using m_str;
End;Is there any way I could use variables into queries?
One more issiue:
I have created partitioned table in Postgres, and simple INSERT statement works fine [SQL from Oracle]; however- the same statement, enclosed with begin/end [PL/SQL] needs about 60 seconds to finish. Is it normal behaviour? Is there any config/pragma/.. I could use to speed it up?
Regards
Bart DabrHi,
Your sample also doesn't work in PL/SQL block..
Here is my detailed config:
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
TNS for Linux: Version 11.2.0.1.0 - Production
PostgreSQL 8.4.8 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 64-bit
and latest ODBC version from Postgres webpage (09.00.0310)
I will install the latest Postgres DB and try it then
Here is the trace, with removed some 'libname=/usr/lib64/libodbc.so, funcname=SQLGetDescRec' parts from init
Oracle Corporation --- WEDNESDAY OCT 05 2011 10:00:47.743
Heterogeneous Agent Release
11.2.0.1.0
Oracle Corporation --- WEDNESDAY OCT 05 2011 10:00:47.743
Version 11.2.0.1.0
Entered hgogprd
HOSGIP for "HS_FDS_TRACE_LEVEL" returned "255"
Entered hgosdip
setting HS_OPEN_CURSORS to default of 50
setting HS_FDS_RECOVERY_ACCOUNT to default of "RECOVER"
setting HS_FDS_RECOVERY_PWD to default value
setting HS_FDS_TRANSACTION_LOG to default of HS_TRANSACTION_LOG
setting HS_IDLE_TIMEOUT to default of 0
setting HS_FDS_TRANSACTION_ISOLATION to default of "READ_COMMITTED"
setting HS_NLS_NCHAR to default of "AL32UTF8"
setting HS_FDS_TIMESTAMP_MAPPING to default of "DATE"
setting HS_FDS_DATE_MAPPING to default of "DATE"
setting HS_RPC_FETCH_REBLOCKING to default of "ON"
setting HS_FDS_FETCH_ROWS to default of "100"
setting HS_FDS_RESULTSET_SUPPORT to default of "FALSE"
setting HS_FDS_RSET_RETURN_ROWCOUNT to default of "FALSE"
setting HS_FDS_PROC_IS_FUNC to default of "FALSE"
setting HS_FDS_CHARACTER_SEMANTICS to default of "FALSE"
setting HS_FDS_MAP_NCHAR to default of "TRUE"
setting HS_NLS_DATE_FORMAT to default of "YYYY-MM-DD HH24:MI:SS"
setting HS_FDS_REPORT_REAL_AS_DOUBLE to default of "FALSE"
setting HS_LONG_PIECE_TRANSFER_SIZE to default of "65536"
setting HS_SQL_HANDLE_STMT_REUSE to default of "FALSE"
setting HS_FDS_QUERY_DRIVER to default of "TRUE"
setting HS_FDS_SUPPORT_STATISTICS to default of "FALSE"
Parameter HS_FDS_QUOTE_IDENTIFIER is not set
setting HS_KEEP_REMOTE_COLUMN_SIZE to default of "OFF"
setting HS_FDS_GRAPHIC_TO_MBCS to default of "FALSE"
setting HS_FDS_MBCS_TO_GRAPHIC to default of "FALSE"
HOSGIP returned value of "32" for HS_FDS_SQLLEN_INTERPRETATION
setting HS_CALL_NAME_ISP to "gtw$:SQLTables;gtw$:SQLColumns;gtw$:SQLPrimaryKeys;gtw$:SQLForeignKeys;gtw$:SQLProcedures;gtw$:SQLStatistics;gtw$:SQLGetInfo"
setting HS_FDS_DELAYED_OPEN to default of "TRUE"
setting HS_FDS_WORKAROUNDS to default of "0"
Exiting hgosdip, rc=0
ORACLE_SID is "pg"
Product-Info:
Port Rls/Upd:1/0 PrdStat:0
Agent:Oracle Database Gateway for ODBC
Facility:hsa
Class:ODBC, ClassVsn:11.2.0.1.0_0008, Instance:pg
Exiting hgogprd, rc=0
hostmstr: 0: HOA After hoagprd
hostmstr: 0: HOA Before hoainit
Entered hgoinit
HOCXU_COMP_CSET=1
HOCXU_DRV_CSET=870
HOCXU_DRV_NCHAR=873
HOCXU_DB_CSET=873
HOCXU_SEM_VER=112000
Entered hgolofn at 2011/10/05-10:00:47
HOSGIP for "HS_FDS_SHAREABLE_NAME" returned "/usr/lib64/libodbc.so"
Entered hgolofns at 2011/10/05-10:00:47
libname=/usr/lib64/libodbc.so, funcname=SQLAllocHandle
symbol_peflctx=0xe74082a0
hoaerr:0
Exiting hgolofns at 2011/10/05-10:00:47
Entered hgolofns at 2011/10/05-10:00:47
Exiting hgolofns at 2011/10/05-10:00:47
Exiting hgolofn, rc=0 at 2011/10/05-10:00:47
HOSGIP for "HS_OPEN_CURSORS" returned "50"
HOSGIP for "HS_FDS_FETCH_ROWS" returned "100"
HOSGIP for "HS_LONG_PIECE_TRANSFER_SIZE" returned "65536"
HOSGIP for "HS_NLS_NUMERIC_CHARACTER" returned ".,"
HOSGIP for "HS_KEEP_REMOTE_COLUMN_SIZE" returned "OFF"
HOSGIP for "HS_FDS_DELAYED_OPEN" returned "TRUE"
HOSGIP for "HS_FDS_WORKAROUNDS" returned "0"
HOSGIP for "HS_FDS_MBCS_TO_GRAPHIC" returned "FALSE"
HOSGIP for "HS_FDS_GRAPHIC_TO_MBCS" returned "FALSE"
treat_SQLLEN_as_compiled = 0
Exiting hgoinit, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoainit
hostmstr: 0: HOA Before hoalgon
Entered hgolgon at 2011/10/05-10:00:47
reco:0, name:kg, tflag:0
Entered hgosuec at 2011/10/05-10:00:47
Exiting hgosuec, rc=0 at 2011/10/05-10:00:47
HOSGIP for "HS_FDS_RECOVERY_ACCOUNT" returned "RECOVER"
HOSGIP for "HS_FDS_TRANSACTION_LOG" returned "HS_TRANSACTION_LOG"
HOSGIP for "HS_FDS_TIMESTAMP_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_DATE_MAPPING" returned "DATE"
HOSGIP for "HS_FDS_CHARACTER_SEMANTICS" returned "FALSE"
HOSGIP for "HS_FDS_MAP_NCHAR" returned "TRUE"
HOSGIP for "HS_FDS_RESULTSET_SUPPORT" returned "FALSE"
HOSGIP for "HS_FDS_RSET_RETURN_ROWCOUNT" returned "FALSE"
HOSGIP for "HS_FDS_PROC_IS_FUNC" returned "FALSE"
HOSGIP for "HS_FDS_REPORT_REAL_AS_DOUBLE" returned "FALSE"
using kg as default value for "HS_FDS_DEFAULT_OWNER"
HOSGIP for "HS_SQL_HANDLE_STMT_REUSE" returned "FALSE"
Entered hgocont at 2011/10/05-10:00:47
HS_FDS_CONNECT_INFO = "pg"
RC=-1 from HOSGIP for "HS_FDS_CONNECT_STRING"
Entered hgogenconstr at 2011/10/05-10:00:47
dsn:pg, name:kg
optn:
Entered hgocip at 2011/10/05-10:00:47
dsn:pg
Exiting hgocip, rc=0 at 2011/10/05-10:00:47
##>Connect Parameters (len=22)<##
## DSN=pg;
#! UID=kg;
#! PWD=*
Exiting hgogenconstr, rc=0 at 2011/10/05-10:00:47
Entered hgolosf at 2011/10/05-10:00:47
ODBC Function-Available-Array 0xFFFE 0x01FF 0xFF00 0xFA7F 0x03FF 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0xFE00 0x3B5D
Exiting hgolosf, rc=0 at 2011/10/05-10:00:47
DriverName:psqlodbcw.so, DriverVer:09.00.0310
DBMS Name:PostgreSQL, DBMS Version:8.4.8
Exiting hgocont, rc=0 at 2011/10/05-10:00:47
SQLGetInfo returns Y for SQL_CATALOG_NAME
SQLGetInfo returns 0 for SQL_MAX_CATALOG_NAME_LEN
Exiting hgolgon, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoalgon
RPC Calling nscontrol(0), rc=0
hostmstr: 0: RPC Before Upload Caps
hostmstr: 0: HOA Before hoaulcp
Entered hgoulcp at 2011/10/05-10:00:47
Entered hgowlst at 2011/10/05-10:00:47
Exiting hgowlst, rc=0 at 2011/10/05-10:00:47
SQLGetInfo returns 0x1d for SQL_OWNER_USAGE
TXN Capable:2, Isolation Option:0xa
SQLGetInfo returns 64 for SQL_MAX_SCHEMA_NAME_LEN
SQLGetInfo returns 64 for SQL_MAX_TABLE_NAME_LEN
SQLGetInfo returns 0 for SQL_MAX_PROCEDURE_NAME_LEN
SQLGetInfo returns " (0x22) for SQL_IDENTIFIER_QUOTE_CHAR
SQLGetInfo returns Y for SQL_COLUMN_ALIAS
3 instance capabilities will be uploaded
capno:1989, context:0x00000000, add-info: 0
capno:1991, context:0x0001ffff, add-info: 0
capno:1992, context:0x0001ffff, add-info: 0
Exiting hgoulcp, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoaulcp
hostmstr: 0: RPC After Upload Caps
hostmstr: 0: RPC Before Upload DDTR
hostmstr: 0: HOA Before hoauldt
Entered hgouldt at 2011/10/05-10:00:47
NO instance DD translations were uploaded
Exiting hgouldt, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoauldt
hostmstr: 0: RPC After Upload DDTR
hostmstr: 0: RPC Before Begin Trans
hostmstr: 0: HOA Before hoabegn
Entered hgobegn at 2011/10/05-10:00:47
tflag:0 , initial:1
hoi:0x1c6766b8, ttid (len 22) is ...
00: 53452E65 36323536 3636622E 322E3135 [SE.e625666b.2.15]
10: 2E393235 3737 [.92577]
tbid (len 19) is ...
00: 53455B32 2E31352E 39323537 375D5B31 [SE[2.15.92577][1]
10: 2E345D [.4]]
Exiting hgobegn, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoabegn
hostmstr: 0: RPC After Begin Trans
hostmstr: 0: RPC Before Describe Procedure
hostmstr: 0: HOA Before hoapdsc
Entered hgopdsc at 2011/10/05-10:00:47
Describing procedure kg.test
Output hoada
hgopdsc, line 1406: NO hoada to print
Exiting hgopdsc, rc=942 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoapdsc
hostmstr: 0: RPC After Describe Procedure
hostmstr: 0: RPC Before Describe Table
hostmstr: 0: HOA Before hoadtab
Entered hgodtab at 2011/10/05-10:00:47
count:1
table: kg.test
Allocate hoada[0] @ 0xdcaa10
Entered hgopcda at 2011/10/05-10:00:47
Column:1(col1): dtype:4 (INTEGER), prc/scl:10/0, nullbl:1, octet:-1, sign:1, radix:10
Exiting hgopcda, rc=0 at 2011/10/05-10:00:47
Entered hgopcda at 2011/10/05-10:00:47
Column:2(col2): dtype:12 (VARCHAR), prc/scl:100/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2011/10/05-10:00:47
The hoada for table kg.test follows...
hgodtab, line 876: Printing hoada @ 0xdcaa10
MAX:2, ACTUAL:2, BRC:1, WHT=6 (TABLE_DESCRIBE)
hoadaMOD bit-values found (0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 col1
12 VARCHAR Y 255 255 0/ 0 0 0 200 col2
Exiting hgodtab, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoadtab
hostmstr: 0: HOA Before hoadafr
Entered hgodafr, cursor id 0 at 2011/10/05-10:00:47
Free hoada @ 0xdcaa10
Exiting hgodafr, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoadafr
hostmstr: 0: RPC After Describe Table
hostmstr: 0: RPC Before SQL Bundling
hostmstr: 0: HOA Before hoxpars
Entered hgopars, cursor id 1 at 2011/10/05-10:00:47
type:0
SQL text from hgopars, id=1, len=46 ...
00: 53454C45 43542041 312E2263 6F6C3122 [SELECT A1."col1"]
10: 2C41312E 22636F6C 32222046 524F4D20 [,A1."col2" FROM ]
20: 226B6722 2E227465 73742220 4131 ["kg"."test" A1]
Exiting hgopars, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoxpars
hostmstr: 0: HOA Before hoxopen
Entered hgoopen, cursor id 1 at 2011/10/05-10:00:47
hgoopen, line 86: NO hoada to print
Deferred open until first fetch.
Exiting hgoopen, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoxopen
hostmstr: 0: HOA Before hoxdscr
Entered hgodscr, cursor id 1 at 2011/10/05-10:00:47
Allocate hoada @ 0xdca9d0
Entered hgopcda at 2011/10/05-10:00:47
Column:1(col1): dtype:4 (INTEGER), prc/scl:10/0, nullbl:1, octet:0, sign:1, radix:0
Exiting hgopcda, rc=0 at 2011/10/05-10:00:47
Entered hgopcda at 2011/10/05-10:00:47
Column:2(col2): dtype:12 (VARCHAR), prc/scl:100/0, nullbl:1, octet:255, sign:1, radix:0
Exiting hgopcda, rc=0 at 2011/10/05-10:00:47
hgodscr, line 880: Printing hoada @ 0xdca9d0
MAX:2, ACTUAL:2, BRC:100, WHT=5 (SELECT_LIST)
hoadaMOD bit-values found (0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 col1
12 VARCHAR Y 255 255 0/ 0 0 0 200 col2
Exiting hgodscr, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoxdscr
hostmstr: 0: RPC After SQL Bundling
hostmstr: 0: RPC Before Describe Table
hostmstr: 0: HOA Before hoadtab
Entered hgodtab at 2011/10/05-10:00:47
count:1
table: test
Allocate hoada[0] @ 0xdcdd88
Entered hgopcda at 2011/10/05-10:00:47
Column:1(col1): dtype:4 (INTEGER), prc/scl:10/0, nullbl:1, octet:-1, sign:1, radix:10
Exiting hgopcda, rc=0 at 2011/10/05-10:00:47
Entered hgopcda at 2011/10/05-10:00:47
Column:2(col2): dtype:12 (VARCHAR), prc/scl:100/0, nullbl:1, octet:255, sign:1, radix:10
Exiting hgopcda, rc=0 at 2011/10/05-10:00:47
The hoada for table test follows...
hgodtab, line 876: Printing hoada @ 0xdcdd88
MAX:2, ACTUAL:2, BRC:1, WHT=6 (TABLE_DESCRIBE)
hoadaMOD bit-values found (0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
4 INTEGER Y 4 4 0/ 0 0 0 0 col1
12 VARCHAR Y 255 255 0/ 0 0 0 200 col2
Exiting hgodtab, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoadtab
hostmstr: 0: HOA Before hoadafr
Entered hgodafr, cursor id 0 at 2011/10/05-10:00:47
Free hoada @ 0xdcdd88
Exiting hgodafr, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoadafr
hostmstr: 0: RPC After Describe Table
hostmstr: 0: RPC Before SQL Bundling
hostmstr: 0: HOA Before hoxclse
Entered hgoclse, cursor id 1 at 2011/10/05-10:00:47
Exiting hgoclse, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoxclse
hostmstr: 0: HOA Before hoadafr
Entered hgodafr, cursor id 1 at 2011/10/05-10:00:47
Free hoada @ 0xdca9d0
Exiting hgodafr, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoadafr
hostmstr: 0: HOA Before hoxpars
Entered hgopars, cursor id 1 at 2011/10/05-10:00:47
type:0
SQL text from hgopars, id=1, len=48 ...
00: 494E5345 52542020 494E544F 20227465 [INSERT INTO "te]
10: 73742220 2822636F 6C31222C 22636F6C [st" ("col1","col]
20: 32222920 56414C55 45532028 3F2C3F29 [2") VALUES (?,?)]
Exiting hgopars, rc=0 at 2011/10/05-10:00:47
hostmstr: 0: HOA After hoxpars
hostmstr: 0: HOA Before hoaexec
Entered hgoexec, cursor id 1 at 2011/10/05-10:00:47
octype=4 (INSERT)
hgoexec, line 108: Printing hoada @ 0xdcaa50
MAX:2, ACTUAL:2, BRC:1, WHT=3 (BIND_LIST)
hoadaMOD bit-values found (0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
3 DECIMAL N 1 0 0/ 0 0 0 0 ?
12 VARCHAR N 4 0 0/ 0 870 0 200 ?
Entered hgoprbv at 2011/10/05-10:00:47
hgoprbv, line 145: Printing hoada @ 0xdcaa50
MAX:2, ACTUAL:2, BRC:1, WHT=3 (BIND_LIST)
hoadaMOD bit-values found (0x200:TREAT_AS_CHAR)
DTY NULL-OK LEN MAXBUFLEN PR/SC CST IND MOD NAME
3 DECIMAL N 1 0 0/ 0 0 0 0 ?
12 VARCHAR N 4 0 0/ 0 870 0 200 ?
Exiting hgoprbv, rc=0 at 2011/10/05-10:00:47
{code}
End of the trace, session closed, nothing more in file
Regards
Bart Dabr -
Hello together,
I'm a little bit frustrated. The follwoing is my problem:
I want to insert some values from an Oracle 10gR2 database into a MSSQL database (SQL Server 2008 R2).
Therefor I'm using DG4ODBC 11.2.0.3. The connection is working absolutly fine.
I want to insert five values from five columns from oracle.table-a into a msssql table-b.
But I'm hitting the error:
Invalid character value for cast specification.
Two columns from the oracle table are chars size 12 and 40, and three are number size 5.1, 5.1 and 4.
The MSSQL column definitions are varchar40, varchar50, 2x float8 and int.
The column assignments are:
Oralce -> MSSQL
a. char 12 -> varchar40
b. char 40 -> varchar50
c. number 5.1 -> float8
d. number 5.1 -> float8
e. number 4 -> int4
The insert works greate for a,b and e but nor for c and d.
I tried so many solutions (cast, to_binary_float, nls_character_format, nls_theritpory etc..) but nothing helps.
I always hitting this error.
Can anyone help me with this problem?
cheers
JoeHi together,
I fixed the problem. I multiply the origin number with 10. The result is a number without any comma. During the insert into MSSql I divide by 10.
I now, this is a very strange solution but it works.
Yes I know this helps only, because the column can only save number with one decimal place. For higher decimal places you have to multiple it with 100 or 1000 or......
Hope this helps also other peoples.
kind regards
Joe -
Create and insert into table from Oracle to MS SQL server.
Hello,
Oracle Database 11g and Red hat 5
I have a very different kind of issue. I am handling the ORACLE db(remote db with all the important data). On the other side their is a MS SQL server db(local db with some testing data in it). All the users will access the ORACLE db for the actual processing but for sometime they need to apply some of their own concepts. So they will transfer the data from ORACLE to MS sql server.
I want to create a code in ORACLE db like a procedure , which will create a table in MS sql server , insert data into it,Also create some metadata table to keep some of my table's info on MS SQL serve db,If the table is present it should append the data, .... like many things ...
Overall my question is , how can i write a code to make these operation on a remote db, that to these operations are DDL and on MS SQL Server(Non-Oracle) ???
Please guide me with some ideas or solutions ...
Also provide if you have some good links to study ...
thanks in advance.I'm not sure why you never visit http://tahiti.oracle.com prior to asking any question. Is it forbidden in your locale? Are you afraid of it? Will your salary be decreased when you visit the documentation?
http://www.oracle.com/pls/db111/search?word=sql+server&partno=
should provide sufficient information.
Your doc question must be considered a violation of Forum Etiquette and an abuse of this forum.
Sybrand Bakker
Senior Oracle DBA -
Strange data inserted into table via table trigger
Hi ,
There is some strange phenomenon happen occasionally where some tables update records will have a TRIGGER to insert records into a table and once in a while, the record has some strange data inserted which looks like a memory corruption. It is running on 10.2.0.3.
Does anyone ever encounter this before?
Strange result:
PRIM_KEY
-3.614364951000000000000000000000000E-47
-3.614364951000000000000000000000000E-47
Normal result:
PRIM_KEY
1137KT
1137KT
anaHi,
What is strange in this? Its not memory corruption. Its just one of the numeric form of representation of number
-3.614364951000000000000000000000000E-47it means -3.614364951 * 10 to the power of -47.
Whatever value has been entered into the table depends on your business logic you coded, and user input.
Regards -
ORA-01461: can bind a LONG value only for insert into a LONG column - APEX
Hi There,
I getting the above error in the edit query section of the report queries.
Navigation: Shared Components>Report Queries>Edit Report Query
The same sql query is working fine in Toad. Also if I create a view on this sql query and use it in the Report Queries, it works fine. However I can't do that as I have to pass parameters to this query at runtime and it is a complex query.
Please let me know what could be the reason and how can it be corrected.
Thanks
KrishnaAny Thoughts?
-
Getting error while importing the application in Oracle Apex
Hi,
I am facing an issue while importing an application into my new Oracle Apex installation. Installation was successful with out any issue. I exported an application from my old Apex (version 3.0.0.00.20) and importing the same into new apex (version 3.0.1.00.08). I am getting the following error.
============================================================
The requested URL /pls/apex/wwv_flow.accept was not found on this server.
============================================================
When I click on import in Application Builder page and then browse the required file it gives the progress saying "Importing File" and after some time it displays the above error.
I tried bouncing the application also and there is not error in alert log.
Could any one please suggest, if there is some problem here. Or my approach is not correct.
Thanks in advance.
Regards,
Advait DeoOsacar, I recommend that you try to import the application into your workspace on apex.oracle.com and see what happens. Also, refine the problem statement as much as you can, e.g., you get this error importing "the application" or when importing "any" application. How big is the file you're trying to import? Where did it come from? Can you upload images?
Scott -
About insert into MDSYS.SDO_GEOM_METADATA_TABLE
Hi all,
I'm newbie with Oracle Spatial.
I would like to know what values can I define to columns SDO_LB and SDO_UB
for the dim element for SRID 8292 when I insert into table
MDSYS.SDO_GEOM_METADATA_TABLE.
I found the following example:
INSERT INTO MDSYS.SDO_GEOM_METADATA_TABLE
SDO_OWNER, SDO_TABLE_NAME, SDO_COLUMN_NAME,
SDO_DIMINFO,
SDO_SRID)
VALUES('PROJUSER', 'LOCAL', 'CD_LOCAL',
MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', 500000, 600000, 0.05),
MDSYS.SDO_DIM_ELEMENT('Y', 7000000, 7020000, 0.05)),
8292);But I don't know if this insert is correct and the spatial index
is valid for SRID 8292.
Thank you very much!!!
[]´sHi,
8292 is a Geographic system, so this is the correct entry for metadata:
insert into user_sdo_geom_metadata values ( ...,
SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .05),
SDO_DIM_ELEMENT('Y', -90, 90, .05)), 8292);
And you should never insert directly into the MDSYS.SDO_GEOM_METADATA_TABLE table.
You should always insert into USER_SDO_GEOM_METADATA view.
siva -
File to RFC problem- data is not inserting into ztable in R3 system
Hi
i have done File to RFC scenario which picks data from flat file and inserts into ztable via RFC in R3. but while testing my scenario everything is successful in XI monitoring (Successful flag in MONI and RWB) and in auditlog message status is DLVD.
it seems to be everything successful in XI and RFC call also successful in R3 system.
but for some reason data is not inserting into table (RFC is used to insert data into ztable)
Is there any way to debug RFC call excecution in XI..?
RFC code is like this:
insert ZMM_AUTO_GR from INPUT_TABLE.
commit work.
END FUNCTION.
please advice what could be the reason not inserting into table.
Help would be appreciated.
Regards,
RajeshHi Praveen,
please see audit log- from communication channel monitoring..
Receiver channel 'CC_INCA_RFC_SAPECC_Receiver' for party '', service 'R3DCLNT210' (internal name 'RfcClient[CC_INCA_RFC_SAPECC_Receiver]')
Client data: {jco.client.lang=EN, jco.client.snc_mode=0, jco.client.client=210, jco.client.passwd=******, jco.webas.ignore_jdsr_error=1, jco.client.user=jsaha, jco.client.sysnr=00, jco.client.ashost=ausr3devdc02}
Repository data: {jco.client.lang=EN, jco.client.snc_mode=0, jco.client.client=210, jco.client.passwd=******, jco.webas.ignore_jdsr_error=1, jco.client.user=jsaha, jco.client.sysnr=00, jco.client.ashost=ausr3devdc02}
Current pool size: 1, maximum pool size : 1
Channel History
- OK: 2008-07-28 04:32:04 PDT: Message processed for interface ZAUTO_GR_STAGE_INCA
- OK: 2008-07-28 04:31:04 PDT: Message processed for interface ZAUTO_GR_STAGE_INCA
- OK: 2008-07-28 03:56:56 PDT: Message processed for interface ZAUTO_GR_STAGE_INCA
- OK: 2008-07-28 03:49:04 PDT: Message processed for interface ZAUTO_GR_STAGE_INCA
- OK: 2008-07-28 03:48:04 PDT: Message processed for interface ZAUTO_GR_STAGE_INCA -
Reg: read excel column and insert into table.
hi Friends,
i wanted to read the data from Excel and insert into in my oracle tables.
can you provide the link or example script.
how to read the column value from excel and insert into table.
please help.< unnecessary reference to personal blog removed by moderator >
Here are the steps:
1) First create a directory and grant read , write , execute to the user from where you want to access the flat files and load it.
2) Write a generic function to load PIPE delimited flat files:
CREATE OR REPLACE FUNCTION TABLE_LOAD ( p_table in varchar2,
p_dir in varchar2 DEFAULT ‘YOUR_DIRECTORY_NAME’,
P_FILENAME in varchar2,
p_ignore_headerlines IN INTEGER DEFAULT 1,
p_delimiter in varchar2 default ‘|’,
p_optional_enclosed in varchar2 default ‘”‘ )
return number
is
– FUNCTION TABLE_LOAD
– PURPOSE: Load the flat files i.e. only text files to Oracle
– tables.
– This is a generic function which can be used for
– importing any text flat files to oracle database.
– PARAMETERS:
– P_TABLE
– Pass name of the table for which import has to be done.
– P_DIR
– Name of the directory where the file is been placed.
– Note: The grant has to be given for the user to the directory
– before executing the function
– P_FILENAME
– The name of the flat file(a text file)
– P_IGNORE_HEADERLINES
– By default we are passing 1 to skip the first line of the file
– which are headers on the Flat files.
– P_DELIMITER
– Dafault “|” pipe is been passed.
– P_OPTIONAL_ENCLOSED
– Optionally enclosed by ‘ ” ‘ are been ignored.
– AUTHOR:
– Slobaray
l_input utl_file.file_type;
l_theCursor integer default dbms_sql.open_cursor;
l_lastLine varchar2(4000);
l_cnames varchar2(4000);
l_bindvars varchar2(4000);
l_status integer;
l_cnt number default 0;
l_rowCount number default 0;
l_sep char(1) default NULL;
L_ERRMSG varchar2(4000);
V_EOF BOOLEAN := false;
begin
l_cnt := 1;
for TAB_COLUMNS in (
select column_name, data_type from user_tab_columns where table_name=p_table order by column_id
) loop
l_cnames := l_cnames || tab_columns.column_name || ‘,’;
l_bindvars := l_bindvars || case when tab_columns.data_type in (‘DATE’, ‘TIMESTAMP(6)’) then ‘to_date(:b’ || l_cnt || ‘,”YYYY-MM-DD HH24:MI:SS”),’ else ‘:b’|| l_cnt || ‘,’ end;
l_cnt := l_cnt + 1;
end loop;
l_cnames := rtrim(l_cnames,’,');
L_BINDVARS := RTRIM(L_BINDVARS,’,');
L_INPUT := UTL_FILE.FOPEN( P_DIR, P_FILENAME, ‘r’ );
IF p_ignore_headerlines > 0
THEN
BEGIN
FOR i IN 1 .. p_ignore_headerlines
LOOP
UTL_FILE.get_line(l_input, l_lastLine);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
v_eof := TRUE;
end;
END IF;
if not v_eof then
dbms_sql.parse( l_theCursor, ‘insert into ‘ || p_table || ‘(‘ || l_cnames || ‘) values (‘ || l_bindvars || ‘)’, dbms_sql.native );
loop
begin
utl_file.get_line( l_input, l_lastLine );
exception
when NO_DATA_FOUND then
exit;
end;
if length(l_lastLine) > 0 then
for i in 1 .. l_cnt-1
LOOP
dbms_sql.bind_variable( l_theCursor, ‘:b’||i,
ltrim(rtrim(rtrim(
regexp_substr(l_lastLine,’([^|]*)(\||$)’,1,i),p_delimiter),p_optional_enclosed),p_optional_enclosed));
end loop;
begin
l_status := dbms_sql.execute(l_theCursor);
l_rowCount := l_rowCount + 1;
exception
when OTHERS then
L_ERRMSG := SQLERRM;
insert into BADLOG ( TABLE_NAME, ERRM, data, ERROR_DATE )
values ( P_TABLE,l_errmsg, l_lastLine ,systimestamp );
end;
end if;
end loop;
dbms_sql.close_cursor(l_theCursor);
utl_file.fclose( l_input );
commit;
end if;
insert into IMPORT_HIST (FILENAME,TABLE_NAME,NUM_OF_REC,IMPORT_DATE)
values ( P_FILENAME, P_TABLE,l_rowCount,sysdate );
UTL_FILE.FRENAME(
P_DIR,
P_FILENAME,
P_DIR,
REPLACE(P_FILENAME,
‘.txt’,
‘_’ || TO_CHAR(SYSDATE, ‘DD_MON_RRRR_HH24_MI_SS_AM’) || ‘.txt’
commit;
RETURN L_ROWCOUNT;
end TABLE_LOAD;
Note: when you run the function then it will also modify the source flat file with timestamp , so that we can have the track like which file was loaded .
3) Check if the user is having UTL_FILE privileges or not :
SQL> SELECT OWNER,
OBJECT_TYPE
FROM ALL_OBJECTS
WHERE OBJECT_NAME = ‘UTL_FILE’
AND OWNER =<>;
If the user is not having the privileges then grant “UTL_FILE” to user from SYS user:
SQL> GRANT EXECUTE ON UTL_FILE TO <>;
4) In the function I have used two tables like:
import_hist table and badlog table to track the history of the load and another to check the bad log if it occurs while doing the load .
Under the same user create an error log table to log the error out records while doing the import:
SQL> CREATE TABLE badlog
errm VARCHAR2(4000),
data VARCHAR2(4000) ,
error_date TIMESTAMP
Under the same user create Load history table to log the details of the file and tables that are imported with a track of records loaded:
SQL> create table IMPORT_HIST
FILENAME varchar2(200),
TABLE_NAME varchar2(200),
NUM_OF_REC number,
IMPORT_DATE DATE
5) Finally run the PLSQL block and check if it is loading properly or not if not then check the badlog:
Execute the PLSQL block to import the data from the USER:
SQL> declare
P_TABLE varchar2(200):=<>;
P_DIR varchar2(200):=<>;
P_FILENAME VARCHAR2(200):=<>;
v_Return NUMBER;
BEGIN
v_Return := TABLE_LOAD(
P_TABLE => P_TABLE,
P_DIR => P_DIR,
P_FILENAME => P_FILENAME,
P_IGNORE_HEADERLINES => P_IGNORE_HEADERLINES,
P_DELIMITER => P_DELIMITER,
P_OPTIONAL_ENCLOSED => P_OPTIONAL_ENCLOSED
DBMS_OUTPUT.PUT_LINE(‘v_Return = ‘ || v_Return);
end;
6) Once the PLSQL block is been executed then check for any error log table and also the target table if the records are been successfully imported or not. -
Insert a record into a table through email in an Oracle APEX application
I developed an Oracle APEX application, there is a table called events. I can insert/update/delete a record in the table through browser. I am thinking in order to quickly do the data entry, user should be able to send an email, then the table should be inserted with values from email address, timestamp, subject and body. Anyd idea how to realize this functionality?
- DenisStart by checking whether your mail server provides any API's for accessing emails , if it does you might be able to reduce a lot of work by using some kind of web service consumer from apex to your mail server. In any case your implementation is going to be dependent on your Mail Server configuration.
Your problem breaks down to reading/accessing mails from the mail server from PLSQL (apex is driven by PLSQL).
I found this other thread which could be of some use.
WAY TO ACCESS A MAIL SERVER FROM ORACLE APEX
<li>The following package might solve your problem directly(from carsten czarski of the German Apex community)
[url http://plsqlmailclient.sourceforge.net]http://plsqlmailclient.sourceforge.net
PS: POP3 support is still TBD.
<li>I also found this posting in the orafaq forums which lists a java method and PLSQL code bit for it for accessing emails via POP3
[url http://www.orafaq.com/forum/t/80928/2/]http://www.orafaq.com/forum/t/80928/2/
If these do not work for you, find some java library to read mail from your server, write a PLSQL wrapper for it and use it in a scheduled job(DBMS_JOB)/a PLSQL block triggered from Apex.
If you get stuck there, find some utility that can read mails, invoke them from your DB using java,shell scrpt,dbms_scheduler etc and use the utility's function for the rest.
NOTE: I haven't tried any of these utilities and you must validate any java code before running them on your environment.
Since aren't really much restrictions(other than spam checks) in sending a mail to your mail account, you might want to consider filtering out the mails from which you create records. -
Issue inserting UTF8 data into Oracle in windows environment.
I have a UTF8 PHP application that is writing a string containing special characters to oracle through a ODBC connection. The Oracle database is setup for UTF8 support.
Here is the issue. I have a simple string, "louis de funès". When the data manually moved correctly in UTF8 the data comes up correctly. The Oracle dump() shows:
WORKING DATA:
String: louis de funès
select keywords, dump(keywords, 17) from ame_links where keywords like '%louis de %';
Typ=1 Len=15: l,o,u,i,s, ,d,e, ,f,u,n,c3,a8,s
However, when the same string is Inserted through the PHP application the data shows up in the db like this.
NOT - WORKING:
String: louis de funès
select keywords, dump(keywords, 17) from ame_links where keywords like '%louis de %';
Typ=1 Len=17: l,o,u,i,s, ,d,e, ,f,u,n,c3,83,c2,a8,
(The è character has 4 bytes associated with it)
Windows Setup:
Windows Registry: HKEY_LOCAL_MACHINE -> SOFTWARE -> ORACLE -> HOME0 ->
NLS_LANG=AMERICAN_AMERICA.UTF8
HTTP headers are set for Content-Type:text/html; charset=UTF-8.
Anyone know why I would get 2 extra bytes (83,c2) added in the middle of the è character? Is the oracle client doing some other type of character set conversion before I insert it into the database.
I have also noticed that when I change the NLS_LANG from AMERICAN_AMERICA.UTF8 to AMERICAN_AMERICA.WE8MSWIN1252 that the 4 byte 'è' character works and the 2 byte character doesn't.I reproduced the porblem. Only differnce from yours is that it reproduces regardless the NLS_LANG setting.
Although I cannot be 100% sure, I think what is happening is that Microsoft ODBC Driver Manager converts the insert statement from Windows ACP to Unicode, then calls SQLExecDirectW (WideChar version of SQLExecDirect) of the Oracle ODBC Driver and passes the insert statement in Unicode. Since your PHP code passed the insert statement in UTF-8 encoding, and the Driver Manager converted it from Windows ACP to Unicode, the letter e with grave ("c3,a8" in UTF-8) was wrongly converted to U+00c3, U+00a8 in the Unicode insert statement, then converted to UTF8 ( "c3,83,c2,a8") by Oracle.
By looking at the PHP source code, apparently PHP odbc_exec() function calls ANSI SQLExecDirect().
I tried to verify that the Driver Manager calls SQLExecDirectW() of Oracle ODBC Driver by enabling the ODBC Tracing, but I couldn't make it work. It genetates an emply SQL.LOG file. So my investigation stops here.
IF YOUR METADATA NAMES ARE ASCII ONLY, AND NON-ASCII CHARACTERS APPEAR ONLY IN DATA, you can workaround this problem by binding data. For example,
$stmt = odbc_prepare($conn, "insert into AME_LINKS (keywords, site_id) values (?, ?)");
$rs = odbc_execute($stmt, array($invar,77));
Makoto -
APex 4.1 Error ORA-01461: can bind a LONG value only for insert into a LONG
Hi There,
Facing a strange issue.
I have a regular cursor, and in that cursor loop I have a select statement into some variables based on cursor parameters.
I was getting the "ORA-01461: can bind a LONG value only for insert into a LONG column" error so I started individually checking each of the columns. Now it works fine for some column, but the moment I add this number field. It starts throwing this error. Now, the database source where the select is fired is of type number, the variable into which I select it is number .
Infact, I dont have any LONG column defined anywhere.
The strange thing is that the block executes perfectly fine in SQl developer. So looks like a Apex specific issue.
I am on 4.1/11g
Any ideas?
Thanks,
Sunsun1977 wrote:
Now, I have put this inside a Dynamic action (PL/SQL procedure). I think this PL/SQL procedure will go up to about 1500 to 2000 lines of code. There are no long columns involved anywhere or even CLOB, BLOB etc.
Is there any limitation to the size of code? When you say size of a code. Are you saying the whole PL/SQL block is stored in one Varchar2(4000) field? :) Did not know that. I am quite sure, the PL/SQL compiled package on the database would work perfect. Just was wondering why it was not working within APEX!
Also, Is there any documentation regarding this that you might be aware of?You can look at the APEX views. Code for some purposes (like region source) is stored in CLOBs:
desc apex_application_page_regions
Name Null Type
WORKSPACE NOT NULL VARCHAR2(255 BYTE)
WORKSPACE_DISPLAY_NAME VARCHAR2(4000 BYTE)
APPLICATION_ID NOT NULL NUMBER
APPLICATION_NAME NOT NULL VARCHAR2(255 BYTE)
PAGE_ID NOT NULL NUMBER
PAGE_NAME NOT NULL VARCHAR2(255 BYTE)
REGION_NAME NOT NULL VARCHAR2(255 BYTE)
PARENT_REGION_ID NUMBER
PARENT_REGION_NAME VARCHAR2(255 BYTE)
TEMPLATE VARCHAR2(255 BYTE)
TEMPLATE_ID NUMBER
STATIC_ID VARCHAR2(255 BYTE)
REST_ENABLED VARCHAR2(3 BYTE)
DISPLAY_SEQUENCE NOT NULL NUMBER
DISPLAY_REGION_SELECTOR VARCHAR2(3 BYTE)
REGION_ATTRIBUTES_SUBSTITUTION VARCHAR2(4000 BYTE)
ESCAPE_ON_HTTP_OUTPUT VARCHAR2(3 BYTE)
DISPLAY_COLUMN NUMBER
DISPLAY_POSITION VARCHAR2(255 BYTE)
DISPLAY_POSITION_CODE VARCHAR2(255 BYTE)
REGION_SOURCE CLOB
...for others—like LOV source and DA actions (PL/SQL code is stored in <tt>ATTRIBUTE_01</tt>)—are only VARCHAR2(4000 BYTE):
desc apex_application_page_da_acts
Name Null Type
WORKSPACE NOT NULL VARCHAR2(255 BYTE)
WORKSPACE_DISPLAY_NAME VARCHAR2(4000 BYTE)
APPLICATION_ID NOT NULL NUMBER
APPLICATION_NAME NOT NULL VARCHAR2(255 BYTE)
PAGE_ID NOT NULL NUMBER
PAGE_NAME NOT NULL VARCHAR2(255 BYTE)
DYNAMIC_ACTION_ID NOT NULL NUMBER
DYNAMIC_ACTION_NAME NOT NULL VARCHAR2(255 BYTE)
ACTION_NAME VARCHAR2(100 BYTE)
ACTION_CODE NOT NULL VARCHAR2(50 BYTE)
ACTION_SEQUENCE NOT NULL NUMBER
DYNAMIC_ACTION_EVENT_RESULT VARCHAR2(5 BYTE)
EXECUTE_ON_PAGE_INIT VARCHAR2(3 BYTE)
AFFECTED_ELEMENTS VARCHAR2(4000 BYTE)
AFFECTED_ELEMENTS_TYPE VARCHAR2(30 BYTE)
AFFECTED_REGION VARCHAR2(255 BYTE)
AFFECTED_REGION_ID NUMBER
ATTRIBUTE_01 VARCHAR2(4000 BYTE)
ATTRIBUTE_02 VARCHAR2(4000 BYTE)
ATTRIBUTE_03 VARCHAR2(4000 BYTE)
ATTRIBUTE_04 VARCHAR2(4000 BYTE)
ATTRIBUTE_05 VARCHAR2(4000 BYTE)
ATTRIBUTE_06 VARCHAR2(4000 BYTE)
ATTRIBUTE_07 VARCHAR2(4000 BYTE)
ATTRIBUTE_08 VARCHAR2(4000 BYTE)
ATTRIBUTE_09 VARCHAR2(4000 BYTE)
ATTRIBUTE_10 VARCHAR2(4000 BYTE)
ATTRIBUTE_11 VARCHAR2(4000 BYTE)
ATTRIBUTE_12 VARCHAR2(4000 BYTE)
ATTRIBUTE_13 VARCHAR2(4000 BYTE)
ATTRIBUTE_14 VARCHAR2(4000 BYTE)
ATTRIBUTE_15 VARCHAR2(4000 BYTE)
STOP_EXECUTION_ON_ERROR VARCHAR2(3 BYTE)
LAST_UPDATED_BY VARCHAR2(255 BYTE)
LAST_UPDATED_ON DATE
COMPONENT_COMMENT VARCHAR2(4000 BYTE)
ACTION_ID NOT NULL NUMBER
COMPONENT_SIGNATURE CHAR(15 BYTE) Oracle presmably have reasons for this difference but it's not something that is made clear in any way through the Builder UI.
Common sense should come into play. As Tony points out, the proper way to develop and deploy complex PL/SQL is using modular subprograms stored in packages. Same for APEX as for anything else.
Maybe you are looking for
-
Attributes and attribute values for a Product
Hi all Is there any table or FM from where I can get a list of all the attributes and the attribute values linked to a particular product? I got tables which link product with Prod Category, Prod Category with Set types and so on. Could anyoe please
-
I cant connect to itunes on my ipod touch 16gig and it wont play youtube content
when i click on the itunes tab on my ipod touch it messages that it cannot connect to itunes store and it wont let me watch or listen to anything on youtube can anybody help
-
Error message when opening CS3 InDesign & Illustrator
Getting error message: The procedure entry point _CFBundleCopyForFileData could not be located in the dynamic link library CoreFoundation.dll. Saw a reference to this which said to open the Corefoundation.dll file and follow instructions. Found 4 ins
-
In approval process i used userdecision step for approving or rejecting. it is working fine in GUI, whenever i executes this task in web-ui (crm2007) worklist when i rejects also it is going to approval branch and when i approves it is gng to appro
-
Hi all, I am struggling to install Forms 10G on Windows server 2008 machine. Can you please help me finding the solution. Its very urgent and nobody in our team or onsite team knows about it. Please, its very urgent and really helpful to me. Thank yo