Creating Report via PL/SQL
We have an application using HTML DB from which the we need to create reports for which the standard CSV will not work. The report can be created via PL/SQL except that the report needs to be created on the users workstation or a public location and not the server. Since UTL_FILE writes to the server, I am looking for help from the HTML DB and PL/SQL experts on packages/tools that can be used to output reports to local directories.
not sure of your exact requirements, but consider using utl_file or Oracle Reports to generate your report on the server and then providing your users a "download report" link that lets them pull the file down locally. we talked about using Reports for this at...
PDF file creation
...regards,
raj
Similar Messages
-
DBI re-create reports via dbi designer
DBI re-create reports via dbi designer
I am trying to re-create the "revenue by cost center" report in DBI designer. This report is seeded from oracle, but I am re-creating so that I can know how to create custom report. I followed all the cookbooks, yet it does not re-create in the same way. Does anyone know I can get to re-create exactly. (Please proved docs, website, etc.)
Thanks.Hi John,
Unfortunately ADF does not provide support for reports. You can use though BI Publisher, Oracle reports or Jasper Reports.
I have demoed this (using BI Publisher) during an Oracle Developers Day/Workshop that I have conducted some time ago. I have even created a post (http://antonis-antoniou.blogspot.com/2010/11/integrating-web-services-into-your-adf_23.html) on my blog with step-by-step instructions and the actual source code.
Regards
Antonis -
Urgent--- is there any way we can schedule report via PL/SQL
I have an urgent requirement where I need to schedule report through PL/SQL. Can somebody provide me sample code which I can use. your help is really appreciated. You can also provide me the JAVA code if not possible through PL/SQL.
check this it may help
http://bipconsulting.blogspot.ru/2010/04/how-to-use-bi-publisher-web-service.html
http://nerdsofobiee.wordpress.com/2010/01/12/bi-publisher-accessing-reports-using-url/ -
Create reports within pl/sql
I would like to create a report with all of the sorting capabilities that a standard wizard generated report has, but I'd like to define the columns within a PL/SQL procedure or function. My goal is to return a set of records and for each record concatenate multiple rows from a second set of records based on each unique value from the first. But I want to present the data on one line.
For example:
query1 results
col1 = 1, col2 = A
col1 = 2, col2 = B
query2 results
col1 = A, col2=testA1
col1 = A, col2=testA2
col1 = B, col2=testB1
col1 = B, col2=testB2
col1 = B, col2=testB3
report should look like
col1=1, col2=A, col3=testA1-testA2
col1=2, col2=B, col3=testB1-testB2-testB3I would suggest using the str2tbl function that Tom shows at http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:110612348061
and doing something like
select col1,col2,str2tbl(...)
from ...
group by col1,col2 -
Create Schema via PL/SQL block from textbox
I'm trying create a user based on a text box that the user/dba will enter. Is there not a way to use a bind variable for what is entered into the textbox, here is my pl/sql block:
BEGIN
EXECUTE IMMEDIATE 'create user :SCHEMA identified by :SCHEMA
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA 0 ON SYSTEM
QUOTA UNLIMITED ON USERS
PROFILE DEFAULT';
end;
Any help is appreciated!Ok, This work for creating the user now:
BEGIN
EXECUTE IMMEDIATE 'create user &SCHEMA. identified by &SCHEMA_PWD.
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA 0 ON SYSTEM
QUOTA UNLIMITED ON USERS
PROFILE DEFAULT';
END;
All I did was change the textbox to just a textbox w/o submit and made the password a submit password and it worked, now I am getting insufficient priviledges when I try to add in:
BEGIN
EXECUTE IMMEDIATE 'create user &SCHEMA. identified by &SCHEMA_PWD.
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA 0 ON SYSTEM
QUOTA UNLIMITED ON USERS
PROFILE DEFAULT';
EXECUTE IMMEDIATE 'GRANT CONNECT,RESOURCE TO &SCHEMA.';
EXECUTE IMMEDIATE 'ALTER USER &SCHEMA. DEFAULT ROLE ALL';
END;
I have disabled Authentication and made it DAD..which is the HTMLDB_PUBLIC_USER which has dba role..but still gives me insufficient priviledges. Any help is appreciated! -
Problem with creating report in pl/sql
hi all
i'm doing a report which fetch from 8 column
i did something like this :
set pages 132
set lines 150
set und =
set spa=5
set feedback off
set newpage 0
the column which i select has an alias for the headlines like this
select tvia_num "NUMBER OF TVIA",name_e "EMPLOYEE_NAME
and so on form the 8 column
the problem is that some of the alias are get cut in the middle
like this NUMBER instead of NUMBER OF TVIA
the max size of the page is 132 characters
can someone please help me ?
best regardsCOLUMN "NUMBER OF TVIA" FORMAT A15
Replace A15 with the column width.
By
Vamsi Kasina -
Create table in PL/SQL proc not working
Hello,
Here is a procedure I have tried to create & run in SQL Developer:
create or replace procedure transpose as
begin
create table lines as (select level line from dual connect by level <= 5),
create table cols as (select level col from dual connect by level <= 5),
select max(decode(col, 1,
decode(line, 1, line_id,
2, description,
3, statetax,
4, freight,
5, weightedAvg))) col1,
max(decode(col, 2,
decode(line, 1, line_id,
2, description,
3, statetax,
4, freight,
5, weightedAvg))) col2,
max(decode(col, 3,
decode(line, 1, line_id,
2, description,
3, statetax,
4, freight,
5, weightedAvg))) col3,
max(decode(col, 4,
decode(line, 1, line_id,
2, description,
3, statetax,
4, freight,
5, weightedAvg))) col4,
max(decode(col, 5,
decode(line, 1, line_id,
2, description,
3, statetax,
4, freight,
5, weightedAvg))) col5
from lines, cols,
(select rownum rn, tfe_line_info.* from tfe_line_info)
where rn = col
group by line
order by line;
end transpose;
I however get the error:
Error(3,7): PLS-00103: Encountered the symbol "CREATE" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe
I cannot understand what is wrong with my Create statement at line 3?It looks like you have no PL/SQL experience. I suggest reading PL/SQL manual. Yes, single row select requires INTO clause. Multi-rows select requires cursor. But this is least of your problems. Your SPp will not complile even if you fix select. Why? SP creates tables dynamically at run time, so tables do not exist at SP compile time. Therefore select from these yet non-existent tables will not compile. By creating tables via dynamic SQL you forced yourself into querying them via dynamic SQL. Now you are trying to transpose (pivot) table. What Oracle version do you have? Oracle 11g provides PIVOT/UNPIVOT operators. Check them out before writing code.
SY. -
Dynamic SQL for creating report in portal
Has anyone had to create report in Portal using dynamic sql. That is you build up the query commands depending on the parameters entered by the user.
E.g the columns displayed will be what the users has selected in the parameter form.
Urgent reply please,
FemiHi,
You can use SQL based reports to do this. The report should have a bind variable. The bind variable is used for the users to enter their values and query is built using the value in the bind variable. The user should enter the value of the bind variable from the customization screen.
Here is an example
select * from scott.emp
where deptno = :vdept
Here vdept appears in the customization screen and user should enter a value for this and run the report.
Thanks,
Sharmila -
Creating reports in BI EE from PL/SQL query
Please provide me solution of how to create reports in Oracle BI EE tool while using PL/SQL query block.
Thanks
Rajni SharmaNarender Singh wrote:
Dear All,
We are using Oracle APPS, we have two tier structure.I bet it is actually 3-tier & WebServer exists
1) Application Tier
2) Database Tier
My requirement is to run a PL/SQL script to create directory structure in Unix box of Database Tier. I would be very grateful to person proving the input related to the same.
I want to create directory structure to store different type of files.
/usr/tmp/2000/jan/file1
/usr/tmp/2000/jan/file2
/usr/tmp/2000/jan/file3
/usr/tmp/2000/jan/file4
similarly, I have to create directory structure from year 2000- 2011 and for each year I have to 12 folder for months and then for each month I can have n number of file folders.
We are using 11g database.
Thanks in Advance!!
Regards,
Narender
Edited by: Narender Singh on Aug 9, 2011 10:50 AMDBMS_SCHEDULER that invokes OS shell script -
Attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL
I'm attempting to create a AQ$_JMS_MAP_MESSAGE via PL/SQL but can't get it to work.
I'm able to create a AQ$_JMS_MESSAGE and add it to an AQ (of the correct type) however the AQ$_JMS_MAP_MESSAGE can not be constructed in the same way as it does not have a CONSTRUCT method.
Is it possible to create this type of JMS message with PL/SQL? The documentation seems to imply that it can be done.
I have tried the following but get an error; the AQ table is of type SYS.AQ$_JMS_MAP_MESSAGE.
=====================================================
procedure addMessageToAQ AS
--message SYS.AQ$_JMS_MAP_MESSAGE;
message SYS.AQ$_JMS_MESSAGE;
eopt dbms_aq.enqueue_options_t;
mprop dbms_aq.message_properties_t;
enq_msgid raw(16);
BEGIN
message := SYS.AQ$_JMS_MESSAGE.CONSTRUCT(DBMS_AQ.JMS_MAP_MESSAGE);
IF ( message.message_type = DBMS_AQ.JMS_MAP_MESSAGE) THEN
DBMS_OUTPUT.PUT_LINE('The message is a map message');
END IF;
message.message_type := DBMS_AQ.JMS_MAP_MESSAGE;
message.header.set_string_property('header1','hvalue1');
message.header.set_string_property('header2','hvalue2');
message.header.set_string_property('header3','hvalue3');
message.set_string_property('content1', 'cvalue1');
message.set_string_property('content2', 'cvalue2');
message.set_string_property('content3', 'cvalue3');
DBMS_AQ.enqueue(queue_name => 'PROCESS_PASSP_APL_Q',
enqueue_options => eopt,
message_properties => mprop,
payload => message,
msgid => enq_msgid);
END;
=====================================================
ORA-25215: user_data type and queue type do not match
ORA-06512: at "SYS.DBMS_AQ", line 204
ORA-06512: at "BDEV1.PS2032_MVMNTHNDSHKEXTRCT", line 48
ORA-06512: at "BDEV1.JDEV_TMP_PROC_1", line 3
The message is a map message
Process exited.As far as I know every object type in database has an implicit construct . It's just that nobody created some nice constructor. Take this example as a "hard way" to create message:
-- jms_text_message related variables
tmp_text_message SYS.AQ$_JMS_TEXT_MESSAGE;
tmp_header SYS.AQ$_JMS_HEADER;
tmp_array SYS.AQ$_JMS_USERPROPARRAY;
-- AQ related variables
enq_msgid RAW(16);
eopt dbms_aq.enqueue_options_t;
mprop dbms_aq.message_properties_t;
-- get current date time, so it doesn't change during run of procedure
current_datetime := TO_CHAR(SYSDATE,'DDMMYYYYHHMISS');
-- initialize array
tmp_array := SYS.AQ$_JMS_USERPROPARRAY(SYS.AQ$_JMS_USERPROPERTY('EVENT_TYPE', 100, 'PL_SQL', NULL, 27));
-- create header
tmp_header := SYS.AQ$_JMS_HEADER(SYS.AQ$_AGENT(NULL, NULL, 0), NULL, NULL, NULL, NULL, 0, tmp_array);
-- create JMS_TEXT_MESSAGE
tmp_text_message := SYS.AQ$_JMS_TEXT_MESSAGE(tmp_header,4,'AAAA',NULL);
dbms_aq.enqueue(
queue_name => 'job_queue',
enqueue_options => eopt,
message_properties => mprop,
payload => tmp_text_message,
msgid => enq_msgid);
... -
Problem for create report by sql query under Protal!
I'm trying create report by sql query method, however it came out the error:
ORA-00918: column ambiguously defined (WWV-11230)
Failed to parse as SENTRYDB - select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' ) as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid from pnames t1, people t3, groups t4 where t3.persongroup = t4.groupid and t1.personid = t3.personid order by rowid (WWV-08300)
Error: Unable to execute query (WWV-10201)
The query is :
select distinct t1.firstnames, t1.lastname, t4.PERSONGROUP, to_char( t1.dateofbirth, 'DD-MM-YYYY' )
as "Dateofbirth", t3.ADDRESS, t3.CITY, t3.STATE, t3.CODE, t3.HOMETELEPHONE, t3.WORKTELEPHONE, t3.INTERESTING, t3.personid
from pnames t1, people t3, groups t4
where t3.persongroup = t4.groupid
and t1.personid = t3.personid
I have no problem to run that query under sqlplus!Hi,
I'm cuurently using the portal inside of 9iAs 1.0.2.2.2a. What version of that Portal? By the way, how can I find out the version of Portal that I using? And also can I display image inside of report which created by Portal? I tried statement:
select
'<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg',
owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' stu_pic,
from stu
However, it doesn't work. It came out error:
Unable to describe SQL statement. Please correct it (WWV-13010)
Invalid SQL statement: select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-13005)
ORA-01001: invalid cursor (WWV-11230)
ORA-00904: invalid column name (WWV-11230)
Failed to parse as SENTRYDB - select '<IMG SRC="'|| decode(IMAGE, '', SJAYARAM309.wwctx_api.get_image_path || 'noimg.jpg', owa_util.get_cgi_env('DOC_ACCESS_PATH') || '/' || IMAGE) ||'">' pic from test (WWV-08300)
Do you know why? -
Hi, I would like to create a database from my numbers spreadsheet and create reports (like SQL). Is there a way?
Numbers is a lightweight spreadsheet. If you know sql you will know that it can handle many queries and is a real databases that can handle many thousands of records. Number is not the correct tool. You can make something that does something like a query but it is not truly a query.
Can you share anything about the specific application and how much information there is in each record? How many records (rows)? -
Create a report with PL/SQL
Hi,
I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
In the second page the report is generated depending on the used text field of the first page.
I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
begin
if :ENTERNAME IS NOT NULL then
FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
"TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
"TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
from "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
where upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
loop
DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
', Last name = ' || item.PI_VORNAME);
end loop;
end if;
end;
Regards
MarkHi,
ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
declare My_select varchar2(500);
begin
if :TEXTEINGABENAME IS NOT NULL then
My_select:='SELECT
"TB_ADRESSE"."A_PLZ" "A_PLZ",
"TB_ADRESSE"."A_ORT" "A_ORT",
"TB_ADRESSE"."A_ID" "A_ID",
"TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
"TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
"TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
"TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
FROM
"TB_ADRESSE" "TB_ADRESSE",
"TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
else
if :TEXTMITGLIEDSNUMMER is not null then
My_select:='SELECT
"TB_ADRESSE"."A_PLZ" "A_PLZ",
"TB_ADRESSE"."A_ORT" "A_ORT",
"TB_ADRESSE"."A_ID" "A_ID",
"TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
"TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
"TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
"TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
FROM
"TB_ADRESSE" "TB_ADRESSE",
"TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
end if;
end if;
return My_select;
end;
When I try to apply changes an error message occurs:
"Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
Regards,
Mark -
Invalid column Index error - While consuming Calculation view via Native SQL
Hi Experts,
I am trying to consume a Calculation view (sql script one) , which has input parameters, via Native SQL in a ABAP program .
Code snippet for the same would be as follows , Upon execution, it throws an error "Invalid Column Index (8) error " . Can anyone help what could be the issue here ?
Thanks in Advance,
Suma
REPORT ZTEST_HANA2.
*Report to consume Calculation view (script based) from ABAP
PARAMETERS: ip_docnr type BELNR_D,
ip_gjahr type GJAHR,
ip_bukrs type BUKRS,
ip_blgr type FAGL_RLDNR.
DATA: LO_SQL_STMT TYPE REF TO CL_SQL_STATEMENT,
LO_CONN TYPE REF TO CL_SQL_CONNECTION,
LO_RESULT TYPE REF TO CL_SQL_RESULT_SET,
LV_SQL TYPE STRING,
LR_DATA TYPE REF TO DATA.
DATA: LX_SQL_EXC TYPE REF TO CX_SQL_EXCEPTION,
LT_SEPMAPPS_CLSDINV TYPE TABLE OF SEPMAPPS_CLSDINV,
LV_TEXT TYPE STRING.
TRY.
lv_sql = |SELECT * FROM "_SYS_BIC"."DEMO-ABAP/CA_GET_FI_DATA" | &&
|WITH PARAMETERS ('placeholder'= ('$$p_DOCNR$$','{ ip_docnr }'),| &&
|'placeholder'=('$$p_GJAHR$$','{ ip_gjahr }')| &&
|,'placeholder'= ('$$S_BUKRS$$','{ ip_bukrs }')| &&
|,'placeholder'= ('$$p_base_ledger$$','{ ip_blgr }') )| .
LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( ).
"Create an SQL statement to be executed via the connection
LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).
"Execute the native SQL query
LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL ).
"Read the result into the internal table lt_sepmapps_clsdinv
GET REFERENCE OF LT_SEPMAPPS_CLSDINV INTO LR_DATA.
LO_RESULT->SET_PARAM_TABLE( LR_DATA ).
LO_RESULT->NEXT_PACKAGE( ).
LO_RESULT->CLOSE( ).
LO_CONN->CLOSE( ).
CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.
LV_TEXT = LX_SQL_EXC->GET_TEXT( ).
MESSAGE LV_TEXT TYPE 'E'.
ENDTRY.Hi Suma,
Post the SQL you success run directly on Studio together with error message (even if is the Invalid column index error).
Check there if the parameters case is working properly... Is it really this confusing options:
p_GJAHR
S_BUKRS
p_base_ledger
Why not all lower or all upper? Anyhow you must test and find which option works according your modeling
Regards, Fernando Da Rós -
Hey,
is there any chance to get a report printout via an url call? We can get our reports via url as pdf, html, rtf and so on. In my mind there is no chance for a printout or perhaps email via url?
I tested the delivery API as second way without some good results.
thanks for help and ideasHi Gael,
your URL is made up of :
[ProcedureName]?[parameter1]=[value1]&[parameter2]=[value2]
creating URLs like this can have problems especially with spaces and punctuation.
the answer is a FORM
the following will create a hidden form :
FORM ACTION="[ProcedureName]" METHOD="POST" name="F1"
INPUT type="HIDDEN" name="[parameter1]" value="[value1]"
INPUT type="HIDDEN" name="[parameter2]" value="[value2]"
/FORM
you can set the values in the form using:
document.F1.[parameter1].value="abc123%%&&$$!";
document.F1.submit();
will submit the form and the PL/SQL procedure should receive the text as it was contained in the form.
the only characters that can now cause problems are :
" as it delimits the field.
' as it may cause problems in PL/SQL.
\ as it is a special character.
Regards Michael
Maybe you are looking for
-
Hello everyone Since the upgrade Leopard i had a problem with the switching apps shortcut. Once you start the switching apps forward shortcut (COMMAND + TAB), the switching apps Backward shortcut (COMMAND + `) won't work anymore. The only thing that
-
Goodafternoon gurus: I have a sales order done in 02/02/2007, which is delivered and billed to.ooo... Can I delete that total sales order with delivery and billing? I have to do cancel billing, reverse goods, and then cancel delivery...etc...right???
-
What is '.prn' format ?
hi experts , during bdc why we need to save excel file in '. prn ' format .. 4 what is stands for ? ...and in same way we have to save word file (.doc) also in this format or not ? thank in advance .. vikas sharma Edited by: vikas sharma on Ap
-
Upgrading to Aperture 3, my Aperture 2 library got smaller (60GB vs. 102GB)
Moving from an old MacBook Pro running Aperture 2.1.4 to a new MacBook Pro, with Aperture 3.1. I copied the Aperture 2 Library (55,000 images, nearly all referenced) to the new machine, and opened it in Aperture 3.1, which then upgraded my Library (o
-
How to use icloud or my mobile me account on snow leopard 10.6.8
Please help !!