Acknowledgement from sql
Hi experts,
Actually what i want is i am writting one sql file ,in that file i am trying to update some rows of emp table. What is the requirement is is the updation is done then i have to perform one task or i have to perform another task .I am asking if is there any way to get the acknowledgement from sql whether an update statement has successfully executed or not.
In unix we do the same thing via $? .
I think i am clear.
Regards
Rajat
What do you mean by Failing here?
If the Update hits a Unique Key Constrain violation or violation of any other constraint then it will be raised.
So the op has to define what Failing means here. If the op thinks not updating any row is failing then no error is going to be raised. But usually that is not considered as failing of an update statement.
In that case SQL%ROWCOUNT will give the number of rows the current update statement has processed.
Thanks,
Karthick.
Similar Messages
-
I have balance column and i need to pick only positive values from sql query.
Balance
200
-20
-220
100
Expected
Balance
200
100Hi Frank,
Sorry i think i am not clear.
below is my function get_total.
one billing_key is nothing but one billing period-each period has 6 programkeys.
by following function i will get 6 records by passing 6 programkeys and one biling key
now i need to get over all balance of all periods per program. condition is i need to take only +ve amounts from the below function and sum it up
expected out. i am just giving an example of output.
actual
programkey get_total
a 100
a -50
a -50
b 200
c 300
c -200
d -100
d -25
d 400
e 500
e -10
f 600
f -200
we are taking only +ve amounts from the above.
How can i write a procedure or script to acheive program_key and balance as below.
programkey balance
a 100
b 200
c 300
d 400
e 500
f 600
create or replace FUNCTION GET_TOTAL (p_bill_key IN varchar2,
p_prog_key IN varchar2) RETURN NUMBER AS
l_total NUMBER;
l_dum_bill NUMBER;
p_count NUMBER:=0;
BEGIN
BEGIN
SELECT count(*) into p_count
FROM billing_adjust b where b.billing_key = p_bill_key ;
if p_count < 1 then
SELECT NVL(surch_amount,0) + NVL(adjust_amount,0)
INTO l_total
FROM mv_billing a, mv_prog_surch b
WHERE a.billing_key = b.billing_key and
a.billing_key = p_bill_key and
b.program_key = p_prog_key;
return l_total ;
end if;
SELECT NVL(surch_amount,0) + NVL(adjust_amount,0)
INTO l_total
FROM billing_adjust b, prog_surch_adjust c
WHERE b.billing_adjust_key = c.billing_adjust_key and
b.billing_key = p_bill_key and
c.program_key = p_prog_key;
return l_total;
EXCEPTION
WHEN NO_DATA_FOUND THEN
null;
End;
RETURN 0;
END GET_TOTAL;
This is what i have started writing to acheive expected output need help on this.
Create or replace function balance(p_company_id) return number as
v_total_due number:=0;
v_total number:=0;
CURSOR p_idn IS
SELECT PROGRAM_KEY,PROGRAM_NAME FROM MV_PROGRAM_DICT where CURRENT_YN = 'Y' order by PROGRAM_NAME_ID;
cursor p_billkey_idn is
select biling_key from billing where company_id=p_company_id;
Begin
for v_idn in p_idn loop
for v_billkey in p_billkey loop
SELECT sum(get_total(v_billkey.billing_key,v_idn.program_key)) into balance
FROM dual
WHERE get_total(v_billkey.billing_key,v_idn.program_key)>0;
END LOOP;
END loop; -
Query based Report (Reports From SQL Query)
Hi All,
I am facing a problem with a report. I need your help.
I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
Can i increase a timeout of portal page, how i can do this?
The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
Please help me to find appropriate reasone for the failure?Can you post the URL that is giving you the page not found error ? I am not sure if I can be of much help though.
In order to increase your chances to get a reply you should also post your question in the Portal Forum - Oracle Application Server Portal
Edited by: Rodolfo Ferrari on Jun 16, 2009 3:49 PM -
How to generate XML from SQL query
possible ways to generate XML from SQL qury.
i want to generate XML of following query. "Select * from emp,dep wher emp.deptno=dept.deptno"Hello.
Can you try:
SQL> set pages 0
SQL> set linesize 150
SQL> set long 9999999
SQL> set head off
SQL> select dbms_xmlgen.getxml('Select * from emp,dep wher emp.deptno=dept.deptno') from dual;
It works fine for me.
Octavio -
Adding update and delete buttons to a Report from SQL Query
There is an option when creating a QBE to add update and delete
links which i find quite useful, but this option doesn't seem to
be possible on a Report from SQL Query. Do i need to do
something special to add them? is the option located in a
different place?Hi,
You can only add Update ,Delete in QBE Reports,
there is no option in Portal which can be used to
have these buttons in the Reports from Query Wizard or
Report from SQL Query.
Thanks
Vineet -
Getting zero-sized reply error when running report from SQL query
Hi,
I have a Report from SQL Query in Portal. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: <data suppressed>
The following error was encountered:
Zero Sized Reply
Squid did not receive any data for this request.
Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
Thanks,
LorenaProblem comes when any of the filter is applied in any one of the cases selected from the GUI.Do you mean that the problems only shows when you run the report in your browser via 9iAS?
Which version are you using?
Can you post the before report trigger? -
Getting Zero Sized Reply error in report from SQL query
Hi,
I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: <data suppressed>
The following error was encountered:
Zero Sized Reply
Squid did not receive any data for this request.
Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
Thanks,
LorenaHi,
I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: <data suppressed>
The following error was encountered:
Zero Sized Reply
Squid did not receive any data for this request.
Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
Thanks,
Lorena -
How to compare result from sql query with data writen in html input tag?
how to compare result
from sql query with data
writen in html input tag?
I need to compare
user and password in html form
with all user and password in database
how to do this?
or put the resulr from sql query
in array
please help me?Hi dejani
first get the user name and password enter by the user
using
String sUsername=request.getParameter("name of the textfield");
String sPassword=request.getParameter("name of the textfield");
after executeQuery() statement
int exist=0;
while(rs.next())
String sUserId= rs.getString("username");
String sPass_wd= rs.getString("password");
if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
exist=1;
if(exist==1)
out.println("user exist");
else
out.println("not exist"); -
Width of field in Report From SQL Query
I have created a report from SQL query with 15 columns being selected. However, no matter what column width and column type (pixel, char, percent) I enter in the column formatting tab of the report, I cannot get the report to format the column to the width I desire. It is always a fixed width. Does anyone have any suggestions?
Thanks,
MartinHi,
Char (used for ASCII format)
Displays the output in the specified number of
characters per line. For example, if you enter 20
in Width, the report displays 20 characters of the
column data in each line. If the number of
characters per line exceeds the specified
number, the remaining characters are wrapped
to the next line.
Pixel
Displays the output in the specified number of
pixels per row. For example, if you enter 10 in
Width, the column data displays 10 pixels of
data per line of the displayed table.
Percent
Displays the output in the specified percentage
of the table. For example, if you enter 25 in
Width, the column data displays in 25% of the
displayed table.
Thanks,
Sharmila -
Need help in Report From SQL Query
Hi All,
I am facing a problem with a report. I need your help.
I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
I tried also increase the page time out in httpd.conf, but no use.
The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
Please help me to find appropriate reasone for the failure?user602513 wrote:
Hi All,
I am facing a problem with a report. I need your help.
I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
I tried also increase the page time out in httpd.conf, but no use.
The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
Please help me to find appropriate reasone for the failure?Do you get any errors or warnings or it is just the slow speed which is the issue?
There could be a variety of reasons for the delayed processing of this report. That includes parameter settings for that page, cache settings, network configurations, etc.
- explore best optimization for your query;
- evaluate portal for best performance configuration; you may follow this note (Doc ID: *438794.1* ) for ideas;
- third: for that particular page carrying that report, you can use caching wisely. browser cache is neither decent for large files, nor practical. instead, explore the page cache settings that portal provides.
- also look for various log files (application.log and apache logs) if you are getting any warnings reflecting on some kind of processing halt.
- and last but not the least: if you happen to bring up a portal report with more than 10000 rows for display then think about the usage of the report. Evaluate whether that report is good/useful for anything?
HTH
AMN -
Can Portal Report from SQL Query use where column IN (:bind_variable)
I would like to create a portal report from sql query with IN (:bind_variable) in the where clause. The idea is that the user would enter comma-separated or comma-quote-separated values for the bind_variable. I have tried this several ways but nothing seems to work. Can this be done?
TrentonHi,
Which version of portal are you using. This is a bug. It has been fixed in 30984.
Thanks,
Sharmila -
Report from SQL Query -Excel format only show the first page
Hi,
I have some Reports from SQL Query. In the display options, I choose Excel as default format. The Excel documents only show the first page. If I choose HTML as default format, it shows every rows.
Please advise on how to have a complete Excel document as HTML format does.
Thanks a lot.
Lina HanI beleive when you export Oracle reports to Excel it is the Data that is transferred along with Column Names.
You cannot export the variables defined on the report.
Hence you will not be able to export the Footer to excel. (Still looking into it will let you know if i find anything interesting)
Regards,
Bhushan Salgar -
Report from sql query invalid date condition
Hi, I created a Reports From SQL Query. My sql is like
"select column1, column2
from myschema.tablename
where mydate > :p_date1 and mydate < :p_date2"
I am using portal with turkish and english option. If I pass p_date paramaters 'dd-MON-yyyy' format
(for example p_date1 = 23-MAR-2003 p_date2 = 26-APR-2003) in english mode portlet is return correct result,
in turkish mode 'No Row Returned'. I changed my sql statement with
"select column1, column2
from myschema.tablename
where to_date(mydate,'dd/mm/yyy') > to_date(:p_date1,'dd/mm/yyy') and to_date(mydate) < to_date(:p_date2,'dd/mm/yyyy')"
and I pass p_date parameters 'dd/mm/yyyy' format (for example p_date1 = 23/03/2003 p_date2 = 26/04/2003)
but now turkish and english mode No row returned.
How may I write correct sql statament. My database NLS_DATE_FORMAT=DD/MM/YYYY and NLS_LANGUAGE=TURKISH.
thanks.Hi,
Try this for turkish mode:
Case 1: the 'mydate' column has a kind of a char data type (like char, varchar or varchar2)
and a value like '30/03/2003'
"select column1, column2
from myschema.tablename
where
to_date(mydate,'DD/MM/YYYY') > :p_date1
and
to_date(mydate,'DD/MM/YYYY') < :p_date2"
Case 2: the mydate column has a date type:
"select column1, column2
from myschema.tablename
where
mydate > :p_date1
and
mydate < :p_date2"
In both cases use the following parameter values:
p_date1 = 23/03/2003
p_date2 = 26/04/2003
This should work
Thanks
Peter -
Pass value from SQL agent job step
Hi
I have created one SSIS package and I am scheduling the same using SQL Agent job. Now I want to pass one value from SQL job agent and want to use that value in SSIS package and then run that package. Can someone point to the solution.
Aniruddha http://aniruddhathengadi.blogspot.com/I have created one parameter on SSIS package named strValue and assigned a empty value "". After that I have created one SQL job and step wherein I have set the value to "Nike" for parameter under Parameters tab.
Now I am expecting Nike value which I have set on SQL job step should get reflected on SSIS package when I am running my job. Am I doing anything wrong ?
Aniruddha http://aniruddhathengadi.blogspot.com/
Not sure what's going wrong but you can have quick look at below step by step tutorial:
Parameterizing Connections and Values at Runtime Using SSIS Environment Variables (via SQL Agent)
Cheers,
Vaibhav Chaudhari -
How to delete the Folder from sql server 2008
Hi all,
I was trying to delete the folder from sql server 2008 with the below script
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @cmd VARCHAR(8000)
DECLARE @folderName VARCHAR(256) -- filename for backup
SET @folderName = + (CONVERT(varchar(10), GETDATE()-7, 112)) -- 7 days back date folder name
SET @path = 'I:\Backup_Test\' + @folderName -- Folder path
SET @cmd = 'del ' + @path -- Delete
EXEC master..xp_cmdshell @cmd
--Print @cmd
This is not working it was asking the Confirmation (I:\Backup_Test\20100629\*, Are you sure (Y/N)? ) what will i do to the delete the folder.
Thanks,
Prasad R.I would notice you that T-SQL does not play well to do things like that. Do not you want using .net language to delete folders?
Old method is
declare @HR int, @CFOLDER varchar(255),@FSO int
set @CFOLDER='D:\folder\'
EXEC @HR = sp_OACreate 'Scripting.FileSystemObject', @FSO OUT
EXEC @HR = sp_OAMethod @FSO, null, 'DeleteFolder', @CFOLDER
Now regarding to your second question please examine xp_fileexist system stored procedure
CREATE FUNCTION dbo.fn_file_exists(@filename VARCHAR(300))
RETURNS INT
AS
BEGIN
DECLARE @file_exists AS INT
EXEC master..xp_fileexist @filename, @file_exists OUTPUT
RETURN @file_exists
END
GO
-- test
SELECT dbo.fn_file_exists('c:\a.txt')
Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
Maybe you are looking for
-
Updated : No question, just example web cam capture code
Hi, I posted this example a while back, but it had some cosmetic bugs in it. Here's an updated version. Quick Start 1. Install JMF 2.1.1e (performance pack version) ( see imports list in source code if you really want to run it using the older versio
-
Unable to print certain website pages
I am having problems printing the "printable version" of a website using Safari. The same website pages will print sing firefox, but for some reason it always misses the 2nd of 3 pages.
-
ipad ios 6.x.x i need to backup it but i dont know how please help mee!!!
-
An experiment in creating compositab​le user interfaces for Config Dialogs
The attached files are saved in LV 2009. They are an experiment. Please don't go off and say, "NI says this is how you should make an options dialog." Oh -- I guess I should mention -- this is an experiment in how to make an options dialog that can b
-
Can not register with my primary e-mail or change e-mail
Hello, I'm new on this forum (just registered) At first, sorry for my English, I'm Ukrainian, and don't know English well. When I try to register on this forum with my primary e-mail edio [@] ukr.net , I get a message, that this mail is banned. Can