Use saved sql in report
Hello specialists,
I'm just starting with Apex, so sorry in advance for stupid questions, and posts on the wrong topics.
I am making an application in which the user may only view his own records, so I thought I'd make a userdatabase, and put in every SQL
'select * from tablename where "user" = V('APP_USER')', whereas the field user is also in de table with records.
This seems to work, but I have 2 questions about that:
- is this the best method?
- instead of putting the SQL mentioned above, I've put it in a 'saved SQL'; is it possible to base a reportregion on this saved SQL, instead of always repeating this SQL in every report I make?
I've tried to base my source of the region on 'select * from mysaved_SQL', but that doesn't work.
Thank you for any reply, and remember I'm just a beginner... ;-)
You might have better luck on the Apex forum
Oracle Application Express (APEX)
I have no APEX experience, but just in a general, database development comment - I do not think that making a database table full of SQL statements is a good approach. There are much more knowledgeable people on this forum that could explain the technical reasons why, but it just raises a red flag of "bad idea" when I even think about it. This may be totally off base for how Apex works, I don't know.
Similar Messages
-
Using functions/sql in report columns
Hi,
New at CRM OD so struggling with reports...
So the problem is :
Have an Account Record and an associated "Parent Account" with it (Type: Account)
Now the report must show the Account Name, Parent Account(if any), ID of the Parent Account.
Not sure how to implement the 3rd col. ie parent Account ID. It always shows the ID of the Primary account itself.
Any suggestions will be vastly helpful.
Thanks!!!Maybe it is an option to add a (hidden) field on the Account which holds the Id of the Parent Account. You have to fill this field with a default and a workflow in case the parent gets added later or changed. This case the parent account Id will be storen on the Account record itself enabling you to report on it. It is a bit of a work-around, but I think it works. Let me know if you need help on getting the syntax right.
Best regards, Tim -
Hi There
I want to use a store procedure in my reprt
the procedure have one in and one out parameter. My procedure is
my_procedure(dname in varchar2, cp_1 out varchar2) the in value is from database and out values store into place holder column and then displayed by field (data type is varchar2). Problem is if i use number data type for retrieval and display through place holder column it works fine but if retrieved value is of varchar2 type it doesn't work and gives me fatal error.
Another interesting thing it works for more then one rows if data retrieved is of number type and also work for varchar2 datatype but only display through single record parameter(if query return one row).Where are you calling your procedure from? Can we see your code... calling trigger and procedure?
null -
Use of SQL Reporting Services in BPC (multi-server environment) - concept
Hello Experts,
I have the following scenario:
2 BPC application servers. Lets call them BPCA1 and BPCA2.
Load Balancer with virtual name BPCA
SQL 2005 database server BPCDB
Database server would hold BPC databases and Report Server database - requires 1 SQL Server license.
Each application server requires SQL Server Integration Services to be installed - 2 SQL Server Standard Edition licenses in my scenario.
Now, is Reporting Services a required component and needs to be installed on both application servers?
Because "scale-out" deployment for Reporting Services is only supported in SQL Server Enterprise Edition. Price difference between Standard and Enterprise Editions are quite sufficient.
So, can I install SQL Server Reporting Services only on BPCA1 and point BPC configuration to BPCA1 for all applications servers?
What is the use of SQL Server Reporting Services in BPC besides running Admin Reports?
Thanks in advance,
AkimHi RS is not required to be installed into db server or app server. It can be even an external RS server.
You are right if you will try to install RS in both app server you need Enterprise Edition because is required by Microsoft for RS web farm.
If you will install RS into database server then you don't need other license for SQL but if you will use SQL Server 2005 you have to install IIS into database server.
For many companies this broke some security policies and for this reason you have to install RS into appserver.
If you will use SQL Server 2008 then IIS is not required anymore and this is another plus in favor of SQL 2008.
Also SAP recomendations is to use SQl Server 2008 for SAP BPC 7.0 SP3 or later becaiuse the performances are better.
RS is used for:
Admin reportts. Audit Reports Journal Reports.
But without RS working you can have issue also with some Admin components not really just with reports.
Regards
Sorin Radulescu -
Setting a Default Value in SQL Query Report
Hello:
We are using a SQL Query Report to provide a mass update to a table. We are using the apex.collection and having it display a number of records in a SQL Query Report for mass update. We have 14 columns in the report, for which the first 11 are populated via the collection. The remaining 3 are open for input but the individual making the updates. We've were able to provide a default value for 2 of the remaining 3 columns using a named LOV's - however the fourth column we would like to default a sysdate - but we are not successful.
We've attempted many things but none seem to work, including adding that column to the collection and assigning it a default sysdate value. We've also tried changing the settings in the report attributes --> Tabular Form Elements by setting the Display as to: Datepicker, Default type to PL/SQL Expression and setting the default to sysdate. We've also tried caputuring a date on the previous page and loading it onto the report page and trying to default the date column to a page item default.
I'd appreciate any help.
Thanks
FYI - we are using version 3.2use as default
to_char(sysdate, 'dd/mm/yyy') where the format is your application or item date format -
Hello
Can i use dynamic sql in report builder , so as to allow user-defined reports .
Thanx
Shrikantread in the help system about lexical variables (these are variables with & at the begining).
So you can define a query as select &P_1 where you get P_1 as a parameter. -
Susbscription Action not showing in SQL Server Reporting Services Web Part
I am trying to use the SQL Server Reporting Services Report Viewer Web Part in a Share Point site. Under the View section of the Web Part Properties, I am able to select "Show subscription menu item". However, it never shows up. Is
there something else I need to configure to allow this Action menu item to show up?
Thanks in advance!Hi Gouranga,
According to your description, when you install the SQL Server 2012 Reporting Services Add-in for SharePoint 2013, you find the files are installed into the folder for sharepoint 2010(..../14). Right?
In Reporting Services, Not all features are supported in all combinations of report server, Reporting Services add-in for SharePoint, and SharePoint Products. Please see the linke below:
Supported Combinations of SharePoint and Reporting Services Server and Add-in (SQL Server 2012)
As you can see in the link, the SQL Server 2012 Reporting Services Add-in is only for Sharepoint 2010. This the reason why it's installed into the file for sharepoint 2010.
Reference:
Where to find the Reporting Services add-in for SharePoint Products (SharePoint 2010 and SharePoint 2013)
Install or Uninstall the Reporting Services Add-in for SharePoint
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
SQL Server Report integrate with SharePoint slow
Dear Team,
I have SQL Server report servie integrate with SharePoint mode, create several reports and deployed to SharePoint, use SharePoint sql server report viewer web part to view the report.
the report contain about 8 parametes, it takes half a minute to load the report parameters, which is not accepted.
What can I do to improve the performance.
Thanks,Hi, qq_w
First of all I suggest catching the result
query and running it with the "View execution plan" option so you can understand what is slowing you down. Perhaps you miss some indexes or something.
Secondly, it will be good to run it with tuning advisor. -
How to see Report for the last 12 months using saved filters
Hi
I need to display the last 12 months report using Saved filters
When i tried to didplay the report it is showing like SQL error
Can anyone help me how to diplay the report of last 12 months using Saved filter.
Thanks & regards
ManuHi Refere the below thread,
http://shivabizint.wordpress.com/2008/09/19/rolling-months-data-for-year-month-prompt-in-obiee/
Curtesy by Shiva.
Thanks,
Balaa... -
Can we use Dynamic SQL in Oracle Reports ?
Hi ,
Can we use Dynamic SQL in Oracle Reports ?
If yes please give some examples .
Thanx
sriniI believe the built-in package SRW.Do_Sql is what you are looking for
Example from the document:
/* Suppose you want to create a "table of contents" by getting the
** first character of a columns value, and page number on which its
** field fires to print. Assume that you want to put the "table of
contents"
** into a table named SHIP. You could write the following construct:
DECLARE
PAGE_NO NUMBER;
PAGE_FOR INDEX NUMBER;
SORT_CHAR CHAR(1);
CMD_LINE CHAR(200);
BEGIN
SORT_CHAR := :SORT_NAME ;
IF :CALLED = Y THEN
SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
P_START_PAGENO);
SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
END IF;
SRW.GET_PAGE_NUM(PAGE_NO);
CMD_LINE := INSERT INTO SHIP VALUES
(||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
SRW.MESSAGE(2,CMD_LINE);
SRW.DO_SQL(CMD_LINE);
COMMIT;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
NULL;
WHEN SRW.DO_SQL_FAILURE THEN
SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
WHEN OTHERS THEN
COMMIT;
END; -
The report I published on the SQL server report server is not showing in the application we use to retrieve reports. My cell phone number is {removed}
Thanks.Hello Roger Tenn,
Thank you for posting in the TechNet Forum.
As this issue is related to SQL server report server, to receive better report, it is recommended to ask in the SQL server forum.
https://social.technet.microsoft.com/Forums/en-US/home?category=sqlserver
The professionals here will be glad to help you.
Best regards,
Fangzhou CHEN
Fangzhou CHEN
TechNet Community Support -
Is one able to use PL\SQL code in a report. I would like to have a procedre which runs off a bind variable if possible?
ThanksUnfortunately, if you are on 1.5.0 or 1.5.1 this report style won't work (there is a bug that removes all of the ;s from the PL/SQL code). According to Re: Report style plsql-dbms_output - bug this is fixed in 1.5.3, when that is released.
theFurryOne -
Report Using PL/SQL Region
Hi,
I have bit experiment create custom reports using PL/SQL region
http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:97800346956448
I would like have from you tips and ideas how enhance this.
Because I'm not so good with SQL,
I really appreciate if you have tips enhance performance for query used for cursor.
/* Report query */
l_sql := '
SELECT * FROM(
SELECT a.*, row_number() OVER (ORDER BY '
|| l_sort_col
|| ' '
|| l_sort_ord
|| ') rn, COUNT(1) over() mrn
FROM(' || l_sql || ') a
) WHERE rn BETWEEN ' || l_start_row || ' AND ' || l_last_row
; Regards,
JariHi Jari
I'm guessing you're trying to do paginated grid data or somewthing similar? You could try something like this...
l_sql := 'SELECT * '||
'FROM ('||
'SELECT /*+ FIRST_ROWS(n) */ '||
'a.*, ROWNUM rnum '||
'FROM ('||l_sql||' '||
'ORDER BY '||l_sort||' '||l_dir||') a '||
'WHERE ROWNUM <= '||l_max_row||') '||
'WHERE rnum >= '||l_start;The variables would be initialized in the procedure as follows...
l_max_row := p_start + p_limit;
l_start := p_start + 1;
l_sort := NVL(p_sort,'1');
l_dir := NVL(p_dir, 'ASC');My application process would be called something like follows, to spit out a JSON object...
BEGIN
htp.p(wwv_flow.g_widget_num_return||'(');
munky_extjs.grid_json(p_app_id => wwv_flow.g_x01,
p_app_page_id => wwv_flow.g_x02,
p_region_id => TO_NUMBER(wwv_flow.g_x03),
p_start => NVL(wwv_flow.g_x04,0),
p_limit => NVL(wwv_flow.g_x05,10),
p_sort => wwv_flow.g_x06,
p_dir => wwv_flow.g_x07);
htp.p(')');
END;I think your use of analytics in the inner query may be slowing you down if you have a lot of data?
Cheers
Ben -
Can one generate a report in Word document using PL/SQL?
We have a weekly status report application created in APEX, is there a way to generate a report in MS Word document (including formatting the doc) using PL/SQL by pulling data from Oracle database? Please shed some lights on this and any info and experience would be greatly appreciated.
We use Oracle11g and apex version 3.1.1.00.09
Thanks!Hi Tony,
you are right, the NEW format isn't necessarily improved, also the user would need at least Office 2007 or higher.
Still it is possible to do that ;-)
And yes, there are other possibilities, but this question is dealing with Word documents (.doc i assume).
Also my Statement "docx = XML" isn't clear enough. Docx is a zipped file which contains a xml file. Details: http://en.wikipedia.org/wiki/Docx
sorry for the confusions,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
Work: http://www.click-click.at -
How to print pdf file in SQL Server Reporting services report using command prompt?
Is there a way to automatically print a SQL Server Reporting services report on command prompt? For eg: We can save a pdf file using rs.exe utility. I want to print a pdf using rs.exe utility. Is it possible? I don't want to install any 3rd party software.
Thanks Simon for replying to my question.
In oracle form, there is oracle command to print the report from command prompt with the help of rwrun.exe
e.g: rwrun.exe REPORT="D:\Test\REP_25\MLA.REP" DESNAME="testprinter" DESTYPE="PRINTER" P_FORMNAME="MLA.FMX" P_SPRACHE="E" P_SPRACHE_NR2="1" P_WHERE_BEDINGUNG="order by land_nr" USERID="test/test.world" PSV_NAME="PSV_DEMO" PSV_JOB_ID="PS$9583" RECURSIVE_LOAD="NO"
BATCH="YES" NONBLOCKSQL="NO" ARRAYSIZE="1" PARAMFORM="NO" ERRFILE="c:\temp\psv16.tmp"<
and to save the report we just need to change DESNAME="c:\temp\OC_100001349.pdf" DESTYPE="FILE" in above command instead of DESNAME="testprinter" DESTYPE="PRINTER".
DESNAME and DESTYPE are the input parameters of the respective report.
In SSRS, we can run the file from the command prompt and save it.
rs -i "C:\Users\pujarswa\Documents\reports\new\LoadReport.rss" -s ww2004760:80/ReportServer_MSSQL -v fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"
-v reportPath="/TipsReport/LoadListTabular" -t -v format="PDF" -v LandNr=4 -u ap\swati -p test@# -e Exec2005
But we cannot use same command for printing as you said we need to create another script for printing files.
I have gone through the links but I dont want to use Adobe Acrobat Reader exe for printing because client it may not have Adobe Acrobat Reader on their machine.
Also I want to pass a input parameter as type="Printer" to my report which will print directly for me and same I can acheive in command prompt passing type="Printer" fileName="C:\Users\pujarswa\Desktop\TipsReportLoad.pdf"
Maybe you are looking for
-
Cameras for Final Cut Pro.
So I have a JVC camcorder which shoots the HD files as .TOD files and a Sony AVCHD cam that saves as .MTS. Its a pain to convert these files using MPEG Streamclip every time. I shoot a pro wrestling show that was just picked up for television and lea
-
Hi, I installed IOS7 in my iPad and now when I want to turn it on it ask me for a password, when I configured I do not remember to ask me for a password , and now it is blocked I put some password that could be but no one of them are, what can I do ?
-
Help with Lost Files and Previews!
Hi all! I'm in a bit of a panic. I imported a folder into Lightroom and made standard previews. I have large standard sized previews (and some 1:1 previews) on top of my mini thumbnails. The I did something very very stupid... I accidentally deleted
-
I pod cases, do they work with i phone?
Hi,I saw a case for the ipod nano and wanted to know if it would work with the iphone. The reason is because it has a arm band and a neckband that would be great for the gym. Thanks...
-
Can't rip CDs reliably in iTunes 10.5
I have been experiencing problems ripping CDs on my iMac. Many CDs appear OK, but some have just absolutely dreadful distortion. I have tried using different Macs, and even switching to Windows. Once I've identified a CD which won't rip, the terrible