Method GET return data with plsql
Hello! Its return a Json with source type PLSQL? Not want to use sys.htp.print.
Example:
begin
select .... or procedure... or function...
return X;
end;
Your question is not very clear.
SELECT
If "source type" is "Query", "Query one row", "Feed", or "Media Resource": You must supply a SELECT statement.
yes, you can use a function in a SELECT statement.
select f( :input ) as pseudo_col_name from dual;
Also, PIPELINE FUNCTION comes to mind.
PL/SQL
If "source type" is "PL/SQL"
(as far as i know) The only way to return data from "an anonymous PL/SQL block" to the web browser is by using the sys.htp package.
If you have a large amount of data to return (eg > 32,767 bytes), you'll need to LOOP over the CLOB.
Since you want JSON format, you will need to use a package like dtr's package or build-your-own.
(I like this site: https://code.google.com/p/plsql-utils/ )
MK
Similar Messages
-
How can I get System dates with time scheduler using threads
how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...
What the heck are you talking about and whatr has it to do with threads?
Current time: System.currentTimeMillis. Date instances are not supposed to be updated. -
Publisher11g - no return data with a data model from logical query
Hi, i am usign publisher11g with obiee bi server autenthication.
On rpd i define a security model with a user variable, a initialization block and a where over one fact table.
When i create a answer report, bi server automatically include on the wher something like this: where user = 'name'.
Well, when i create a publisher report and try to view data from this fact table, return no data.
If i create a data model only with a dimension table, not over automatic where from bi server, the report return data.
View the log nqquery, i see that the generate query include where user ='', not include the value of a session variable.
Any idea?
Thanks.I do have one question, is the member Balancesheet already in the outline?
Yes
**Measure
Balance Sheet
Profit and Loss**
Also in the load rule did you change the dimension load settings for the accounts dimension to be parent/child for the accounts dimension.
Field Properties -> Dimension Build Properites
Dimension=
Field 1 Measure; Type = Parent
Field 2 Measure; Type = Child
Field 2 Measure; Type = Alais
OK
Quite often people don't realize they have to double click on the dimension name to make sure it gets put as the dimension that gets changed.
I'm pretty sure your issue is it is trying to do the data load and not the dim build,but that could just be the first problem
**Click on Dimension Build Field
Click on Dimension Build setting
Dimension = Measure; Build Method; = Parent/ Child**
Please advise -
Getting Tree data with a twist
I just started playing around in flex and am excited about
the possibilities. I read the previous question and answers on
Getting Tree data by an HTTPService, but cannot get it to work with
my xml data. I have an xml file which doesn't have the regular node
tags for a tree's dataprovider. I was wondering if there was a way
to get a tree to populate with data while using multiple tag names
and descriptions encased within those tags. Here is an example of
my xml data to show you what I mean:
<?xml version="1.0" encoding="utf-8"?>
<catalog>
<product product="Nokia">
<name>Nokia 6010</name>
<description>Easy to use without sacrificing style,
the Nokia 6010 phone offers functional voice communication
supported by text messaging, multimedia messaging, mobile internet,
games and more</description>
<price>99.99</price>
</product>
<product product="Nokia">
<name>Nokia 3100 Blue</name>
<description>Light up the night with a
glow-in-the-dark cover - when it's charged with light you can
easily find your phone in the dark. When you get a call, the Nokia
3100 phone flashes in tune with your ringing tone. And when you
snap on a Nokia Xpress-on™ gaming cover*, you'll get
luminescent light effects in time to the gaming
action.</description>
<price>139</price>
</product>
</catalog>
Using this data, I would expect to have one folder called
"Nokia" which has two files called "Nokia 6010" and "Nokia 3100
Blue".
So I have been searching the internet to see if I could get
this xml format to work with a tree and this is the code I have so
far:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="horizontal"
creationComplete="treeXML.send();">
<mx:Script>
<![CDATA[
public function fixLabel(item:Object):String {
var node:XML = XML(item);
if( node.localName() == "product" )
return unescape(node.@product);
else if( node.localName() == "name" )
return unescape(node.@name);
else
return '';
]]>
</mx:Script>
<mx:HTTPService id="treeXML" url="data/catalog.xml"
resultFormat="e4x"/>
<mx:Panel width="30%" height="100%"
layout="horizontal">
<mx:Tree width="100%" showRoot="true"
horizontalScrollPolicy="auto"
height="100%" id="mytree"
dataProvider="{treeXML.lastResult.node}"
labelField="@name" labelFunction="fixLabel" />
</mx:Panel>
<mx:Panel width="70%" height="100%" id="panel1"
layout="horizontal">
</mx:Panel>
</mx:Application>
However, nothing is being populated in the tree. Can somebody
please help me with this. I would think that this problem has been
solved before but I don't know where to look.
Thank you for your help.Thanks for the reply. I definitely couldn't come up with that
on my own at this stage of the game. I wonder if you could answer
two more questions. How do I tell the node.@name to be a leaf
instead of a folder? I changed a small piece in your code to handle
the data inside the XML tags. Now I am getting two levels of
folders with labels on them. Thats fine but how would I get rid of
the the rest of the folders that I don't give a label?
Say you have the following xml data:
<?xml version="1.0" encoding="utf-8"?>
<program name="someprogram">
<system name="Mechanical 1">
<docs name="other Systems">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block Systems">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block 2">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Suppressor">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
</system>
<system name="Mechanical 2">
<docs name="Pneumatics">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block 1">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
<docs name="Block 2">
<schematic name="Schematic" description="" url=""/>
<guide name="Familiarization" url=""/>
</docs>
</system>
<system name="Electrical"/>
</program>
How would I bind the selected item in the tree to some text
boxes so that the relevant descriptions and url's would show up
depending the selection? I know how to bind data when I don't use
the "e4x" xml data format but I can't get around it by using a
tree.
I would love to hear any advice you could give me.
Thanks again. -
How to get max(date) with BI Answers?
Hi,
I have a fact table with costs of projects and several dimension tables. The data in the fact table is stored day-based and is related to a time dimension. Additionally there is a relation between the fact table and the project dimension. A project has several dimension attributes like "current"
Now I want to create the following query in BI Answers:
Get the costs to a project where the "current" attribute was set to Y and show the related date.
My thoughts were, that I'm looking in the project dimension where the "current" attribute is set to Y and do a join on the fact table. Therefore I get several dates, because there are more than one day where the project status was set to Y. How can I get the last, highest date?
GreetingsHi,
Maybe you could order by date descending and show the Top N (=1).
Good Luck,
Daan Bakboord -
Cannot get wanted data with MAX and GROUP BY function
Hi
All
I have a table like below:
COLUMN TYPE
USER_ID VARCHAR2 (10 Byte)
PROCESS_ID VARCHAR2 (30 Byte)
END_TIME DATE(STAMP)
TO_LOC VARCHAR2 (12 Byte)
TO_LOC_TYPE VARCHAR2 (15 Byte)
FROM_LOC VARCHAR2 (12 Byte)
ITEM_ID VARCHAR2 (25 Byte)
CASES NUMBER (12,4)
LMS_UDA1 VARCHAR2 (250 Byte)
ZONE VARCHAR2 (2 Byte)
I only want get one record with all columns, only have one clause MAX(END_TIME)
But the other column have difference value.
when i use MAX(END_TIME) and GROUP BY USER_ID,PROCESS_ID,CASES,....
the sql didnot give one record,
It give many records
Please help me on this
Regards
SavenHi, Saven,
Sorry, it's unclear what you want.
Whenever you have a question, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
If you can show your proiblem using commonly available tables, like those in the scott or hr schamas, then you don't have to post any sample data: just the results and the explanation.
Always say what version of Oracle you're using.
See the forum FAQ {message:id=9360002}
Are you trying to see all data related to the highest (that is, latest) end_time?
I think you want something like this, that finds all the ionformation about the employee with the latest hiredate:
WITH got_r_num AS
SELECT emp.*
, ROW_NUMBER () OVER (ORDER BY hiredate DESC NULLS LAST)
AS r_num
FROM scott.emp
SELECT * -- Or list all columns except r_num
FROM got_r_num
WHERE r_num = 1
;What do you want in case of a tie, that is, if 2 or more rows have the same latest end_time? You may need to add tie-breaking expressions to the analytic ORDER BY clause, and/or use RANK instead of ROW_NUMEBR -
Get Additional Data with BAPI_DOCUMENT_GETDETAIL2
Hello,
I´m using BAPIs with VBA (MS Office). I´m able to get Detail Data for a document with the Function Module BAPI_DOCUMENT_GETDETAIL2. But trying to get Additional Data for a document with this BAPI doesn´t work because the required (?) table CHARACTERISTICVALUES is not active.
Is there any chance to get the Additional Data for a document with using VBA? Thanks for help!
Best regards
RobertKarlo,
Inorder to find answers to your questions I reccommend that you do the following.
1. Go to transaction SE 37 ( If you do not have authorization obtain one, normally an ABAP auth).
2. Type the name of the FM as BAPI_DOCUMENT_CREATE
3. Press F8
4. Goto --> Documentation
5. SAP has given a sample program, there.
6. You can copy the code, create a test ABAP program and test with different values for the class and characterestics and try to post the document.
7. Also in the documentation, you will find an explanation from SAP on the use of the BAPI.
If you have further questions, let me know,
Sojan -
Ok say I want to get some kind of data from a html page? How could it be done? Is this possible with java, or do I have to use some kind of scripting language?
It looks like what you might be looking for is a method of getting HTTP, not HTML, data. HTML is simply text and can therefore be retrieved any way that a File could be retrieved (using a FileReader/FileWriter). HTTP, on the other hand, is the protocol that we use the most when viewing websites.
If you're looking to make HTTP request, you may want to look into something like java.net.HttpURLConnection. Try searching these forums for HTTP, not html. -
Custom Exit - Get System Date with user input
I am using a BW query to connect to a BOBJ universe. Some reports from the universe must be scheduled to run for today's date and emailed to a user. Unfortunately, we cannot determine "today" dynamically when scheduling in BOBJ. There will be other reports filtered with a range.
I want to create a BW custom exit variable to allow user input. My idea is to take the user input, like "01/01/1904", and replace the value with today's date.
Is this possible?
Here's example code for what I am trying to achieve.
IF user input = "01/01/1904" then get today's date.
else use the values from the user input.
Scenario 1: user inputs 08/01/2010 - 08/31/2010 the custom exit returns values 08/01/2010 - 08/31/2010
Scenario 2: user inputs 01/01/1904 the custom exit returns 09/03/2010 (today)Hi,
In your case, i_vnam variable and processing variable for below statement would be same.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'variable name'.
Please see the below article for reference.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90?quicklink=index&overridelayout=true -
Get the data with more than one of the desired value
Hi,
I need to pull the records with more than one value of 'Other' on the delivery days fields.
The delivery fields are mon,tue,wed,thu,fri and sat that tells the where the item will be delivered. The value can be Home, Work, or Other.
Here is the Sample data:
cust_id: 123
item: newspaper
mon: Home
tue:Work
wed: Other
thu: Home
fri: Other
sat: Other
And here is my query so far.
select
cust_id,
item,
mon,
tue,
wed,
thu,
fri,
sat,
sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1
else 0 end) as day_ctr
from customer
Could you please help me with the right formula I need to get this?
Thank you in advance..First
DESC customer
Second
Can you explain what you are trying with
sum(case when (del_mon = 'O' or del_tue ='O' or del_wed ='O' or del_thu ='O' or del_fri ='O' or del_sat='O') then 1 else 0 end) as day_ctr
Third
Usually it's helpful a example of the result you want...
Perhaps you want this
select DECODE(mon,1,(select distinct mon from customer), 'OTHER') mon,
DECODE(tue,1,(select distinct tue from customer), 'OTHER') tue,
DECODE(wed,1,(select distinct wed from customer), 'OTHER') wed,
DECODE(thu,1,(select distinct thu from customer), 'OTHER') thu,
DECODE(fri,1,(select distinct fri from customer), 'OTHER') fri,
DECODE(sat,1,(select distinct sat from customer), 'OTHER') sat from
select
COUNT(DISTINCT mon) mon,
COUNT(DISTINCT tue) tue,
COUNT(DISTINCT wed) wed,
COUNT(DISTINCT thu) thu,
COUNT(DISTINCT fri) fri,
COUNT(DISTINCT sat ) sat
from customer
) -
Returning data with a doc style web service
How does one return information using a "Document" style Web Service? WLS 8.1 restricts
you to a single "in" parameter. Do I return information by using the "return"
value from the Web Service (assuming it's synchronous)? If so, what are the restrictions
on the return value. I've read the WLS 8.1 Programming Web Services document but
it's pretty lite in the area of Document style Web Services.
Thanks.WLS 8.1 supports two document styles:
#1 document literal
#2 document wrapped literal
In the case of #1 a web service method can only
take zero or one argument. There can be a return
type (or void). The (single) argument or return type
could be any supported type, or user defined complex
types (java beans). In #1 the dispatch is done based
on the incoming document and not based on the name
of the method. You can find an example for this at:
http://manojc.com/?sample13
In the case of #2 a web service method can have
any number of arguments. The WS container will
wrap the method in to a complexType. Here,
method name will be the name of the complexType
and arguments will be added as elements of the
complexType. In this case dispatch is done
based on the method name. An example here:
http://manojc.com/?sample14
Regards,
-manoj
"Jack Ottofaro" <[email protected]> wrote in message
news:3ea55b39$[email protected]..
>
How does one return information using a "Document" style Web Service? WLS8.1 restricts
you to a single "in" parameter. Do I return information by using the"return"
value from the Web Service (assuming it's synchronous)? If so, what arethe restrictions
on the return value. I've read the WLS 8.1 Programming Web Servicesdocument but
it's pretty lite in the area of Document style Web Services.
Thanks. -
Run .exe and get returned data
hello,
I have a simple executable that runs from a command window in dos. You run it like this.
String encryptedPW = iscrypt "scott";
and it will return a string that is encrypted.
So my question is how do I do this in Java?
Thanks
Scott.As DanielKasmeroglu said, the Runtime.getRuntime().exec() method will run the process for you. In order to return the results to your Java program, you need to use the getInputStream() method of the Process class. An example that does this is:try {
Process p = Runtime.getRuntime().exec("cmd.exe /c dir");
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String s = "";
while((s = br.readLine()).length() >= 0) {
System.out.println(s);
catch (Exception e) { e.printStackTrace(); }Mark -
Is there any way to get tables data with out having backup.
Hi !
my tnslistner is not working that is why i am not able to login in my database
so i have planned to reinstall it and if posible get my database back from old files.
i do not have backup,
is there any way to get tables and data back.
yours sincerelythe out put of the sqlplus/ as sysdba is as followes
Error 6 initializing sql*plus
sp2-0667: message file sp1<lang>.msb not found
sp2-0750: you may need to set ORACLE_HOOME to your oracle software directory
the listener.ora at
C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
(PROGRAM = extproc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = abc)(PORT = 1521))
DEFAULT_SERVICE_LISTENER = (XE)
yours sincerely -
hello anyone,
How can I create a query having 2 date and 2 variable of kind:
from 1 date 05/06/2004
to 2 date 15/06/2004
yes for 2 days
no for 1 day
that is,
i wish get the date with yes for 2 days and not for 1 day, this is, that I want
05/06/2004 sabato
06/06/2004 domenica
08/06/2004 martedì
09/06/2004 mercoledi
11/06/2004 venerdi
12/06/2004 sabato
14/06/2004 lunedi
15/06/2004 martedithanks in advanceHi,
The WHERE clause controls which rows will be displayed.
If your requirements change, change the WHERE clause to reflect them.
For example:
DEFINE from_date = "TO_DATE ('05/06/2004', 'DD/MM/YYYY')"
DEFINE to_date = "TO_DATE ('15/06/2004', 'DD/MM/YYYY')"
DEFINE yes_cnt = 3
DEFINE no_cnt = 2
SELECT &from_date + LEVEL - 1 AS dt
FROM dual
WHERE MOD ( LEVEL
, &yes_cnt + &no_cnt
) BETWEEN 1
AND &yes_cnt
CONNECT BY LEVEL <= 1 + &to_date
- &from_date
ORDER BY dt;This will work as long as you want the first &yes_cnt rows to be displayed (assuming there are that many), and the next &no_cnt rows not to be displayed, then another &yes_cnt rows to be displayed and another &no_cnt rows not to be displayed, and so on.
I assume that &yes_cnt is a postive integer, and that &no_cnt is a non-negative integer. (That is, &no_cnt may be 0.) -
How can I get the variable with the value from Thread Run method?
We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
How can I get the variable with the value?
This is sample code:
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run method "+sathr.x);
// I should get Inside the run method::: But I get only Inside
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to read it from external method. This I dont want to doWe want to access a variable from the run method of a
Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
Even
though I make the variable as public /public static, I
could get the value till the end of the run method
only. After that scope of the variable gets lost
resulting to null value in the called method/class..
I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
public class SampleSynchronisation
public static void main(String[] args)
SampleSynchronisation app = new SampleSynchronisation();
public SampleSynchronisation()
MyRunnable runner = new MyRunnable();
new Thread(runner).start();
// yield this thread so other thread gets a chance to start
Thread.yield();
System.out.println("runner's X = " + runner.getX());
class MyRunnable implements Runnable
String X = null;
// this method called from the controlling thread
public synchronized String getX()
return X;
public void run()
System.out.println("Inside MyRunnable");
X = "MyRunnable's data";
} // end class MyRunnable
} // end class SampleSynchronisation>
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run
method "+sathr.x);
// I should get Inside the run method::: But I get
only Inside
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to
read it from external method. This I dont want to do
Maybe you are looking for
-
Error opening a project after i have saved it
The following is the error I recieve after I have saved a project and try and reopen it. It does not matter if I close Premiere Elements v7 or if i try and reopen the project right away. I get the same error. "Projects created with Adobe Premiere
-
Time capsule and external hardrive
can I attach an external hard drive to time capsule to expand storage? If so, are there any downsides?
-
How to invoke a Java class constructor in Forms
I want to Run this ( http://persiancalendar.sourceforge.net/) Persian calendar in forms. I am using Forms 10g Rel 2 (Forms [32 Bit] Version 10.1.2.0.2 (Production)) I did this: (1.) Downloaded the 2 Jar files persiancalendar.jar and icu4j_3_2_calenda
-
Indesign CS6 Problems with OS X Services
With Indesign CS5.5, services work, but not in CS6 on Snow Leopard. What I mean is, if you select some text (in my case Tex text), go to the Indesign menu, select Services, then select something like Typeset LaTex Text, Indesign says the service cann
-
What happened to my iPhoto albums/events? is there a way to retrieve them?
I know that iPhoto no longer exists, and i migrated my photos to Photos, but the albums/events that I spent years creating are gone! Is there a way to retrieve them?