Embed Object in a Database Column
Hi there
I have a column in my database that contains freeform text where users can enter a report commentary.
I want to give them a syntax that would allow them to embed a measure universe object
Example of text in field:
The sales for August 2010 are XXXXX. These sales exceed expectations etc etc
The user will change the text from time to time.
I want the user to be able to enter a syntax in place of XXXXX that would use the universe object called 'Monthly Sales Revenue'
Any thoughts?
James
I'm not totally sure I understand your requirements, but if what you are trying to do is select a measure based on the contents of 'XXXXX', you could create an object like:
CASE WHEN right(table.freeform_column,3) = 'MSR' THEN fact_table.Monthly_Sales_Rev END
Similar Messages
-
How to store java objects in the database
Hi,
I am trying to store HttpSession state across Application Servers. Basically I am trying to build a sort of application cluster server on my own. I thought the best way to do this was to periodically store the HttpSession object from an application server in a database.
I created a table in Oracle 8i with a blob column. I use a PreparedStatement.setObject() method to store the HttpSession object in the database. My problem is, I don't know how to get the object back from the database.
Since ResultSet.getBlob returns the Blob locator, I need to read the BinaryInputStream to get all my data back. This tells me that getBlob basically works only for things like files, and cannot be used for Java objects.
Is there any way around this? Your input would be much appreciated.
Regards,
Somaiah.Thanks for the quick reply vramakanth.
Do I have to use a type map if I do this? Also does such a type map exist for the HttpSession class?
Thanks,
Somaiah. -
Database column comments in Discoverer report
Hello,
I am trying to display database column comments in Discoverer reports. Is there any easy way to display these comments, other than copy and paste?
I am referring about comments from user_col_comments view...
SELECT column_name, comments
FROM user_col_comments
Thanks in advance...Hi
If you create table or view comments in the database and point a Discoverer folder directly at the database object Discoverer will read the comments in and store them in the description property. If you have added the comments after the EUL was built, refreshing the folder(s) should be all you need to do.
Best wishes
Michael -
Hi,
Can anyone help me out please.
I have written one stored Procedure to create a views using Openrowset(openquery) but for tables which contains xml data types throwing error while executing the SP. Error
" Xml data type is not supported in distributed queries. Remote object 'OPENROWSET' has xml column(s)."
Please refer the Stored Procedure & error message below.
USE [Ice]
GO
/****** Object: StoredProcedure [dbo].[Pr_DBAccess] Script Date: 08/14/2014 16:08:20 ******/
SET
ANSI_NULLS ON
GO
SET
QUOTED_IDENTIFIER ON
GO
ALTER
PROCEDURE [dbo].[ Pr_DBAccess](@SERVERTYPE
NVARCHAR(50),@SERVERNAME
NVARCHAR(100),@DATABASENAME
NVARCHAR(100),@SCHEMANAME
NVARCHAR(100),@TABLENAME
NVARCHAR(100),@USERNAME
NVARCHAR(100),@PASSWORD
NVARCHAR(100))
AS
BEGIN
DECLARE @openquery
NVARCHAR(4000),
@ETL_CONFIG_IDN
NVARCHAR(100);
IF @SERVERTYPE='SQL'
BEGIN
SET @openquery=
'CREATE VIEW '+@TABLENAME+
' WITH ENCRYPTION AS SELECT * FROM OPENROWSET(''SQLNCLI'',''SERVER='+@SERVERNAME+';TRUSTED_CONNECTION=YES;'',''SELECT * FROM '+@DATABASENAME+'.'+@SCHEMANAME+'.'+@TABLENAME+''')'
SELECT @openquery
END
EXECUTE
sp_executesql @openquery
END
----While running the SP manually below error occuredHI ,
1. You cannot use a table or view that contains xml or clr type as 4-part name in your query
2. You need to cast the column to either nvarchar(max) or varbinary(max) or other appropriate type to use
3. If you have a table that has xml type for example then you need to create a view that contains all columns other than xml and query it instead. Or you can issue a pass-through query using OPEN QUERY with the appropriate columns only.
Here is a work around:
SELECT
Cast(a.XML_Data as XML) as XML_Data
FROM
OPENQUERY([LINKED SERVER NAME HERE],'
SELECT
Cast(XML_Data as Varchar) as XML_Data
FROM
[DATABASE NAME].[SCHEMA].[TABLE NAME]'
) a
Basically, the data is queried on the remote server, converts the XML data to a varchar, sends the data to the requesting server and then reconverts it back to XML.
You can take help from below link;
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c6e0f4da-821f-4ba2-9b01-c141744076ef/xml-data-type-not-supported-in-distributed-queries?forum=transactsql
Thanks -
Non Database Column to Grid Control
Hi,
How do I add a Non database column to a Grid Control which is
based on a Rowset. I want the similar functionality of a
multirow Block in D2K Forms, which is based on a Database query
and to which another item is added which is non Database item
and it is also displayed as any another item in the same
multirow block. The updatable and queryable property for this
item is set to false.
How do I get similar functionality in JDeveloper using InfoSwing
GridControl. Thanx in advance.
--- Ravi
nullThe GridControl does not have built-in support for this
functionality. However, the GridControl source code is provided
so you can extend the control to provide this functionality.
In 3.0, the Oracle Business Components for Java will provide the
ability to create objects that can mix db and non-db attributes.
The GridControl can then be bound to this object to provide the
functionality you seek.
- PSW
Ravindra Channe (guest) wrote:
: Hi,
: How do I add a Non database column to a Grid Control which is
: based on a Rowset. I want the similar functionality of a
: multirow Block in D2K Forms, which is based on a Database query
: and to which another item is added which is non Database item
: and it is also displayed as any another item in the same
: multirow block. The updatable and queryable property for this
: item is set to false.
: How do I get similar functionality in JDeveloper using
InfoSwing
: GridControl. Thanx in advance.
: --- Ravi
null -
Hi,
I have deployed a BC4J component as an EJB on OC4J using JDeveloper. The database column of the table is of type Number, because of which I am encountering the eroor below. The application works fine if the database type is varchar or something else.
I even tried changing the attribute of entity object to an integer, but this doesn't work.
below is the error:
oracle.jbo.PiggybackException: JBO-28300: Piggyback read error
void oracle.jbo.JboException.<init>(java.lang.String)
void oracle.jbo.PiggybackException.<init>(java.lang.String)
void oracle.jbo.common.PiggybackInput.<init>(oracle.jbo.common.ObjectMarshaller, byte[])
void oracle.jbo.client.remote.ApplicationModuleImpl.processPiggyback(byte[])
void oracle.jbo.client.remote.ApplicationModuleImpl.executeQuery(int, boolean)
void oracle.jbo.client.remote.RowSetImpl.executeQuery()
void oracle.jbo.client.remote.ViewUsageImpl.executeQuery()
void oracle.jbo.uicli.binding.JUIteratorBinding.executeQueryIfNeeded()
void oracle.jbo.uicli.binding.JUFormBinding.executeIfNeeded()
void oracle.jbo.uicli.jui.JUPanelBinding.executeIfNeeded()
void fast.track.LYPanelUsermasterView.<init>(boolean)
void fast.track.LYPanelUsermasterView.<init>()
void fast.track.AppletUsermasterView.init()
void fast.track.AppletUsermasterView.main(java.lang.String[])
## Detail 0 ##
java.io.InvalidClassException: oracle.jbo.domain.Number; Local class not compatible: stream classdesc serialVersionUID=-7730629917230930297 local class serialVersionUID=-6507359405709672486
void java.io.ObjectStreamClass.validateLocalClass(java.lang.Class)
void java.io.ObjectStreamClass.setClass(java.lang.Class)
java.io.ObjectStreamClass java.io.ObjectInputStream.inputClassDescriptor()
java.lang.Object java.io.ObjectInputStream.readObject(boolean)
java.lang.Object java.io.ObjectInputStream.readObject()
int java.io.ObjectInputStream.inputObject(boolean)
java.lang.Object java.io.ObjectInputStream.readObject(boolean)
java.lang.Object java.io.ObjectInputStream.readObject()
void oracle.jbo.common.PiggybackRowEntry.readObject(java.io.ObjectInputStream)
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
boolean java.io.ObjectInputStream.invokeObjectReader(java.lang.Object)
int java.io.ObjectInputStream.inputObject(boolean)
java.lang.Object java.io.ObjectInputStream.readObject(boolean)
java.lang.Object java.io.ObjectInputStream.readObject()
void oracle.jbo.common.PiggybackInput.<init>(oracle.jbo.common.ObjectMarshaller, byte[])
void oracle.jbo.client.remote.ApplicationModuleImpl.processPiggyback(byte[])
void oracle.jbo.client.remote.ApplicationModuleImpl.executeQuery(int, boolean)
void oracle.jbo.client.remote.RowSetImpl.executeQuery()
void oracle.jbo.client.remote.ViewUsageImpl.executeQuery()
void oracle.jbo.uicli.binding.JUIteratorBinding.executeQueryIfNeeded()
void oracle.jbo.uicli.binding.JUFormBinding.executeIfNeeded()
void oracle.jbo.uicli.jui.JUPanelBinding.executeIfNeeded()
void fast.track.LYPanelUsermasterView.<init>(boolean)
void fast.track.LYPanelUsermasterView.<init>()
void fast.track.AppletUsermasterView.init()
void fast.track.AppletUsermasterView.main(java.lang.String[])
Please help me out
Thanks in advance
nullHi Raman,
This error is normally occured when there is a attribute mismatch.When you added new field in OAF page, associate this field to the new view attribute of the extended VO. It is always recommended to add this new attribute at the end
Thanks
Sandeep -
Re: [iPlanet-JATO] Finding the database column length
This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
>This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
> -
How to create a variance on data that exists iIn only one database column
How to create a variance on data that exists iIn only one database column?
I'm trying to create a calculation to show the difference between the budgets for two different years in a Discoverer crosstab query.
I'm using the lag function to repeat the value of a column for the current year and the year before.Lag and lead seems to be the only choice and they work excellent. Checkout the new 10g Database features. There is new SQL modal clause which might give additional and powerful analytics but in this case lag and lead should be sufficient.
regards
http://www.infocaptor.com/workbook-dump.php -
How do I null out an item based on a database column before display?
I am using Apex 3.2
I have an item that is based on database column. My customer wants me to "blank out" the item before it is displayed so the user will have to enter a new value in place of the one that is in the database.
I have tried using a "before region" calculation to set the item to NULL. I can see the value getting set in the debug after the row fetch has occurred, but when the item is displayed, it contains the value from the database, not my calculated valuie.
I also tried using an unsourced text field and then doing an after submit calculation to set the value of the database column item from there, but no luck that way either.
Also tried clearing the item cache, but I think that happens way too early.
There must be a simple way to do this..
Any suggestion?No problem user486652 (name?),
Yes, the $s function is one of ApEx's built-in's - see the ApEx documentation under API Reference, Javascript API's, and you'll find a wealth of built-in functions that do all sorts of things. For Javascript in general, take a look at www.w3schools.com for some really good tutorial and reference material - I use it constantly.
Ok, so you want to set the browser field to empty after the page loads. Since this is a page event, it isn't something that will fire for a form field element so you don't want the code there. In ApEx 3.2, edit the attributes for the page, and you'll see a setting called "HTML Body Attribute". You'll see a helpful bullet note below the setting saying this is the place to add onload events. The proper syntax will be:
onload="$s('P2_REMEDY_TICKET', '');"Once ApEx puts everything together and the page renders, this code will tell the browser to run that $s function after the page loads.
But be aware - if you take a look at the help for that setting, you'll see that it mentions that this will only work if your page template includes the #ONLOAD# substitution string. Not sure if all ApEx-supplied page templates already have #ONLOAD#, but every one I've used does. If your code still doesn't work, check your page tempate. In the Definition region, under Header, you should see a body tag with something like:
<body #ONLOAD#>...
...If that's there, your page template supports the HTML Body Attribute. If your body tag doesn't have an #ONLOAD#, add it.
Hope this helps,
John
If you find this information useful, please mark the post "helpful" or "correct" so that others may benefit as well.* -
Create "Object" Type based on columns of a table
Hi Experts
is it possible to create an Object Type based on columns of a table?
for example the syntax for creation of type is
CREATE OR REPLACE TYPE temp_t
AS OBJECT (ID number, code number)
can we create a type that is based on columns of an existing table? so that we donot have to write down all the column names in each type as i have to create types based on 100 and above tables :-s
Please help me out here!
Best RegardsYou cannot do that Zia, check below code:
SQL> create or replace type temp_t as object(object_name all_objects.object_name%TYPE);
2 /
Warning: Type created with compilation errors.
SQL> sho err
Errors for TYPE TEMP_T:
LINE/COL ERROR
0/0 PL/SQL: Compilation unit analysis terminated
1/35 PLS-00201: identifier 'ALL_OBJECTS.OBJECT_NAME' must be declared -
SQL to find a value in a database column
Hi All,
I need to write a pl/sql block to find a given value in any database column.
Is there a written function or program which I could use.
Requirement is to see which columns in which table has the value 'ABCD123' in whole database
Thanks,
SNOT TESTED
declare
seeking varchar2(30) := 'ABCD123';
begin
create table result_table as
select owner,table_name,column_name,cast(null as varchar2(30)) column_value
from all_tab_cols
where 1 = 0;
for r in (select owner,table_name,column_name
from all_tab_cols
where data_type = 'VARCHAR2'
and data_length >= length(seeking)
loop
execute immediate 'insert into result_table ' ||
'select ' || r.owner || ',' || r.table_name || ',' || r.column_name || ',''' || seeking || '''' ||
' from dual ' ||
' where exists(select null ' ||
' from ' || r.owner || '.' || r.table_name ||
' where ' || r.column_name || ' = ''' || seeking || '''' ||
end loop;
commit;
end;Regards
Etbin -
Query on database column not working
Hi
i have a block which has around 40 columns.the block is based on a table which has more than 20000 records.When i try 2 make query on a Database column in Enter-Query mode its not working.It fetching all the records instead of the respective records
THe block property is said to yes
i have even set the query allowed,only propery of the column to YEs
Can any one help me out of this??? do i need to set any other property???Thanks a lot for james and THomas and to all. The error is that i have missed the bracket for OR in my where condition ...Now im able to query all the columns.
Thanks very much...
I have one more doubt .i have a requirement in which when the user goes to the child block and makes a query is it possible to bring the associates parent records..wht code or trigger we need to rite ?
normally we do for parent block when we query we populate the child. is this can be done? -
ADF How to Download BLOB File from Database Column
Hi,
We have one blob Database Column in which we use for storing attachments(eg Image,.doc or.zip) . We are able to upload attachments.
How can I build page which will access that particular record and will be able to download attachment in it.
It should prompt to Save and then we can save it on Local machine.
Thanks,
JitSorry, I don't get your question.
If you have a file name including the suffix like 'Test.file.doc' you can pass this file name as parameter to the method and get the MIME type back. I your sample it would be "application/msword"
String mime = ContentTypes.get("Test.file.doc");
public class ContentTypes
public static String get(String fileName)
String mime = null;
String ext = fileName.toLowerCase();
if (ext.endsWith(".pdf"))
mime = "application/pdf";
else if (ext.endsWith(".doc"))
mime = "application/msword";
else if (ext.endsWith(".xls"))
mime = "application/msexcel";
else if (ext.endsWith(".docx"))
mime = "application/msword2007";
else if (ext.endsWith(".xlsx"))
mime = "application/msexcel2007";
else if (ext.endsWith(".ppt"))
mime = "application/vnd.ms-powerpoint";
else if (ext.endsWith(".rar"))
mime = "application/octet-stream";
else if (ext.endsWith(".zip"))
mime = "application/zip";
else if (ext.endsWith(".jpg"))
mime = "image/jpeg";
else if (ext.endsWith(".jpeg"))
mime = "image/jpeg";
else if (ext.endsWith(".gif"))
mime = "image/gif";
else if (ext.endsWith(".png"))
mime = "image/png";
return mime;
}Timo -
How to check the owner of any Object in the database.
How to check the owner of any Object in the database.
Thanks
HimanshuWhat about this ?
SELECT owner,Object_name,object_type FROM all_objects
OR
SELECT owner,Object_name,object_type FROM dba_objects -
Checking whether data exists in a BLOB type database column in Forms 6i
I am developing an application regarding inventory of a plant's spare parts. I am storing photo (.bmp) of spares in the database in a column of BLOB type. Once user punches spare's code, form displays spares data on screen using EXECUTE_QUERY. At this stage I want to check whether picture (.bmp) data was found in BLOB type database column or not. I want to take action accordingly. How to check this. If it would be a numeric column, I would have checked NULL but NULL does not work with BLOB type coloumns.
Pl. help.
Thanks in anticipation.Did you look in the database documentation? The DBMS_LOB package has the method you need: getlength().
This was more of a database question than a Forms question, so you'd probably have more luck with these types of questions on one of the other forums, like the database or SQL forums.
Regards,
Robin Zimmermann
Forms Product Management
Maybe you are looking for
-
Can't download/view "some" pdf files.
I once had Adobe Reader which caused some problems. I moved it to trash. I also trashed the Adobe Reader Internet Plug-in in the Library. I still can't open some pdf files (e.g., bank monthly statements). A window opens showing the statement (which
-
Staging a Test Environment from a Production Environment
I trying create new test environment follow Oracle guide but I always get errors, look like this documentation is not correct Oracle® Application Server Administrator's Guide 10g Release 2 (10.1.2) B13995-08 Is someone have correct guide(documentatio
-
Having choppy 24p motion problems.
Thanks for any info anyone might have on this. I have a show open motion graphic sequence for a long running video series that has previously been produced in standard def NTSC and is now going HD. It's a straight to Bluray/DVD instructional show. Th
-
√ Upgrading to Photoshop Extended 6 ?
Hi I just received my Adobe Creative Suite 6 Design & Web Premium not as an upgrade but as a new package. On my iMac, the CS5 Suite is installed. My Photoshop has many commercial plugins. Is that an issue. I don't want to scrap those precious plugins
-
Can someone help me? For the last week i'm getting ''add virus'' everytime i open new window in safari. It looks like this on the bottom of the screen and it is very annoying How can i get rid of it? i can close it, but it's back when i refresh pag