PL/SQL design -help needed
Hi Guys,
Schema tablename folderfrequency mailid
dev dev.abclog abc-ip hourly [email protected]
dev dev.xyzlog xyz-ip hourly [email protected]
QA qa.bcf@log bcf-ip daily [email protected]
QA qa.abclog abc-ip hourly [email protected]
I have the above situtation in the table . My objective is go to particular schema and go to particular log table get latest record based ondate and send a mail every hour to with respective usermailid. The above table contains 30 to 50 schemas . So I have to get record with respective directory with tablename ang get the record from the log table and send a mail hourly/daily .
Any design suggestions .
I would appreciate your help.
Regards,
User
1. You select a user which has select privilege on all these log tables. Say the user name is user101.
2. Now user101, will have a script which loops through the table.
3. For every record, select the log table text and send mail using utl_smtp / utl_mail. (if you don't know abt sending mail there are so many posts in this forum on sending mail from plsql).
4. Now schedule this script using dbms_scheduler or any other scheduler which u use.
Hope this helps.
Pradeep.
Similar Messages
-
Having trouble with SQLServer 2008 (not MySQL) and my database connection in Dreamweaver CS6. My document type is set as .asp using VBScript. I can list the table information but cannot use the insert wizard to add new records. I don't get any errors after creating the insert form, but no records get inserted. I'm not a VBScript expert, but do I have to manually write some code to insert records? How do I attach it to a button?
Thanks for the quick reply. I won't be back in the office for a few days, but I'll try to post it when I get back in. It's pretty much the code generated from the Dreamweaver Insert Record wizard. I see where the submit button is created and the value is set but the action on the form is set to MM_insert, so I don't see where the submit code is actually called.
Date: Wed, 3 Oct 2012 12:06:14 -0600
From: [email protected]
To: [email protected]
Subject: SQL Server2008 help needed
Re: SQL Server2008 help needed
created by bregent in Dreamweaver General - View the full discussion
This post should be moved to the app dev forum. Please post the code from your form and the insert script pages.
Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4746757#4746757
Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4746757#4746757
To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4746757#4746757. In the Actions box on the right, click the Stop Email Notifications link.
Start a new discussion in Dreamweaver General by email or at Adobe Community
For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746. -
Okay... I am trying to solve this problem but no ideas are popping into my head. I will explain my current design and if anyone has any solutions please let me know. The design may need to be reworked.
Currently I have an index.html page split in 3 (A left and right, but the left frame has a top and bottom)
The left top frame has input boxes. I am sending that information to a servlet that creates a webpage to go into the bottom box.
Based on the information that the servlet recieves I also want to update the bottom left with an image dynamically.
Any ideas.... Should I use JSP in anyway ?
Thanks in advance.Use javascript to tell the bottom frame to reload,
getting the new imageOkay, someone at work told me this method... something like including the javascript inside the onload= of the HTML body tag of the right frame.. so when it loads the bottom left will reload. Can the bottom left page by a static HTML page, if so how will I change the picture. If I make it a jsp page or something I can just share a variable with the servlet ? -
Hi All,
I am creating a report which is having 2 sql queries ,1 for the main columns that i need to show and 2 from total sum and count.
Report is something as given below
SET TAB OFF;
set linesize 1500;
set pagesize 50;
SET FEEDBACK OFF;
SET WRAP OFF
COLUMN today NEW_VALUE VAR1 NOPRINT;
TTITLE LEFT 'ABC Inc.' SKIP 1 -
LEFT 'Daily Report' SKIP 1 -
LEFT 'As Of ' VAR1 SKIP 2
BTITLE LEFT SKIP 'Page No : ' FORMAT 9999999999 SQL.PNO SKIP 3;
COL SR_NO HEADING 'Seq' FORMAT 999999;
COL REFNO HEADING 'Ref No' FORMAT A20;
COL ORIG_NAME HEADING ' Branch Name'
FORMAT A50;
SELECT ROWNUM SR_NO,
REF_NO REFNO,
ORIGIN_NAME BRNAME
FROM BANK
WHERE PASS_CD=101
SELECT ' Failure Count : '|| NVL(COUNT(DECODE(CODE,1,CODE,NULL)),0) ||
' Failure Total Amt : '|| NVL(SUM(DECODE(CODE,799,AMT,NULL)),0)
|| CHR(10) ||
' Successful Count : '|| NVL(COUNT(DECODE(CODE,000,CODE,NULL)),0) ||
' Successful Total Amt: '|| NVL(SUM(DECODE(CODE,000,AMT,NULL)),0)
FROM BANK;
CLEAR BREAKS;
CLEAR COLUMN;
TTITLE OFF;
When i am running this second query output is going to secong page and title is repeated again and same as 1rst page is showing page no-1
Kindly help me,i want the output on the same page at bottom.
Thanksi think its only work in ISQL* PLUS enivironment iam
not sure.It does work in SQL*Plus
is that i can use in the package??http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12048.htm -
Oracle 11G Install on Win 7 With PL/SQL Developer Help Needed
Today is my first day with Oracle. I have tried to Install Ora11g from our network drive.I think the installation went fine. I also installated PL/SQL Developer when i try to log in i got the following error see below.
PL/SQL Developer - (Not logged on)
Initialization error
SQL*Net not properly installed
OracleHomeKey: SOFTWARE\ORACLE
OracleHomeDir:
OK
After i did some research online i found this solution "go to Tools > Preferences > options set manually "Oracle Home" to the folder of ORACLE_HOME and "OCI Library" to the oci.dll file located in ORACLE_HOME/bin/oci.dll"
C:\app\user\product\11.2.0\client_1\bin.dll <=== I believe this is my Oracle_Home
C:\app\user\product\11.2.0\client_1\bin\oci.dll <==== Is my OCI Library.
When i apply thse 2 paths i get the following error.
Initialization error
COuld not load " C:\app\user\product\11.2.0\client_1\bin.dll
OCIDLL forced to C:\app\user\product\11.2.0\client_1\bin.dll
LoadLibrary(C:\app\user\product\11.2.0\client_1\bin\.dll)returned 0
Can someone help me with this ???????????????/Pl indicate which version of Win 7 - you will need Professional or higher - Home versions are not supported/certified, so things may or may not work as expected.
http://download.oracle.com/docs/cd/E11882_01/install.112/e16773/reqs.htm#CHDHGGFE
HTH
Srini -
How to optimize this SQL. Help needed.
Hi All,
Can you please help with this SQL:
SELECT /*+ INDEX(zl1 zipcode_lat1) */
zl2.zipcode as zipcode,l.location_id as location_id,
sqrt(POWER((69.1 * ((zl2.latitude*57.295779513082320876798154814105) - (zl1.latitude*57.295779513082320876798154814105))),2) + POWER((69.1 * ((zl2.longitude*57.295779513082320876798154814105) - (zl1.longitude*57.295779513082320876798154814105)) * cos((zl1.latitude*57.295779513082320876798154814105)/57.3)),2)) as distance
FROM location_atao l, zipcode_atao zl1, client c, zipcode_atao zl2
WHERE zl1.zipcode = l.zipcode
AND l.client_id = c.client_id
AND c.client_id = 306363
And l.appType = 'HOURLY'
and c.milessearchzipcode >= sqrt(POWER((69.1 * ((zl2.latitude*57.295779513082320876798154814105) - (zl1.latitude*57.295779513082320876798154814105))),2) + POWER((69.1 * ((zl2.longitude*57.295779513082320876798154814105) - (zl1.longitude*57.295779513082320876798154814105)) * cos((zl1.latitude*57.295779513082320876798154814105)/57.3)),2))
I tried to optimize it by adding country column in zipcode_atao table. So that we can limit the search in zipcode_atao table based on country.
Any other suggestions.
ThanksWelcome to the forum.
Please follow the instructions given in this thread:
How to post a SQL statement tuning request
HOW TO: Post a SQL statement tuning request - template posting
and add the nessecary details we need to your thread.
Depending on your database version (the result of: select * from v$version; ):
Have you tried running the query without the index-hint?
Are your table (and index) statatistics up-to-date? -
Hi,
I normally get a csv having data as
column1 ;columnb;columnc;
13 ; 12 ; 13 ;
11 ;13 ;33;
as the table where it needs to go is say table
xys( a number, b number , c number).
so the control file is fairly simple ...
But from now I need to restrict data entry if the change in format happens in the csv
say if it is like
column2;column1;column3,
12,13;12;
11;13;14;
or say the csv like
column1;column2;column3;column4;
11;13;14;15;
111;134;14;12;
in both cases sql loader should not run and throw the error saying the reason in the log.
how do i manage it in the control file `???
any ideas???
regards
Message was edited by:
SHUBHHello,
do you only need to check the first line of the file if it contains a line like
column1;column2;column3 ?
If yes, maybe a small script like this could be a starting point:
You have to replace "column1;column2;column3" with the header information that's valid and instead of file1 in the CURRENTSTRING=... Line write the name of your input file.
I hope this helps. (But maybe some of the experts here knows a way to do the verification checks with SQLLDR, so maybe its worth to wait a little bit :)
#!/bin/ksh
VALIDSTRING="column1;column2;column3"
CURRENTSTRING=`head -n 1 file1`
if [[ $VALIDSTRING == $CURRENTSTRING ]]
then
echo "They match."
else
echo "They dont match."
fi
-- -
WAAS Design Help Needed - URGENT!
Hi,
I am currently designing and implementing a WAAS solution for s client in their Data Center. It is deployment of a single Accelerator and one CM.
It has been decided that the WAAS accelerator (7341) will have its two NICs connected to two of their core switches (both 6500). The two core switches have a Layer 3 Etherchannel link between them and are running OSPF for network convergence (i.e. Layer 2 connectivity is not used).
I am facing a problem in the design, since I know that the Active/Standby configuration for the accelerator would require a redundant gateway via HSRP (at least) but this is not possible in a routed environment in the core switches. Furthermore, I am to run WCCPv2 for redirection.
Therefore, I am confused as to how to proceed in such a case considering that I can only configure one default gateway on the accelerator when I need high availability on two different subnets.
Please assist at your earliest.
Thanks.Amir,
Considering your question below
"I am facing a problem in the design, since I know that the Active/Standby configuration for the accelerator would require a redundant gateway via HSRP (at least) but this is not possible in a routed environment in the core switches. Furthermore, I am to run WCCPv2 for redirection."
Do WAE is configured for Standby interface and is this your Primary Interface as well? If answer is yes then see below
You will need a common VLAN for WAAS on both 65K swicthes in order for Active / Standby interface to work properly.
1: When using OSPF make sure your tcp flows has both ingress and egress flows transit from same switch
2: Use Generic GRE method for Egress under WAAS intercept configuration.
Since you are running WCCP each swicth will be able to redirect its TCP traffic via GRE Tunnel to WAAS and WAAS will send the packet back to the same swicth. This will ensure packet path is not modified when WAAS / WCCP is introduced.
Also make sure that you do not have any WCCP redirect on Layer 3 connection between 2 swicthes. Let me know if this helps.
Ahsan Khan -
Hi All, I hope you can help. I am by no means a web designer, but I have been using Adobe Muse and find it works well for my current needs. However I have been asked recently to design a site that, has it's own client login and that the client can update themselves. Any ideas? Thanks in advance.
ChevHi there!
Are you referring to In-Browser Editing feature?
http://tv.adobe.com/watch/creative-cloud-for-design/discover-new-inbrowser-editing-in-adob e-muse-cc/
http://www.adobe.com/inspire/2013/12/in-browser-editing-muse.html
What are you/your client using as the hosting provider for the site? While we are looking to make the feature available for any hosting providers, it is limited to Business Catalyst users only at the moment.
Let us know if you have any follow up questions.
Amy -
SQL problem - help needed ASAP!!
Hey guys,
Doing a college project... would really appreciate some help. I am trying to use a variable in the where clause of a select cursor in PL/SQL. The code is this:
procedure results(p_search_entry varchar2, p_search_field varchar2) is
cursor c_results is
select * from physics_b where p_search_field = p_search_entry;
begin
for cv_results in c_results
loop
-- loop through actions
end loop;
The problem is that I don't know how to get the where clause to accept the variable passed into the procedure as the field name. Does anyone know the syntax for this?
Thanks very much!
NiallThis isn't the correct forum for this kind of question. The SQL and PL/SQL forum PL/SQL is probably best.
That said, you can't do what you want that way.
You can do
procedure results (p_search_entry in varchar2)
cursor c_result is
select * fro physics_b where subject=p_search_entry;(assuming subject is a column in physics_b)
You can't use a variable to represent a column directly. You need to build the statement as a string and then use execute immediate.
statement:='select * fro physics_b where '||p_search_field||' = :1';
-- this bit is probably bad syntax.
execute immediate statement using p_search_entry;Look up execute immediate and bind variables -
Guys,
Help me understand the syntax please!! With PL/SQL I have achieved a task quite easily, with a branch of code to include or exclude some part of the query - no problem. But to use SQL ......
If i have a variable on a page, say :p10_open_or_closed
.. and I set the value of this to the text "Is Not Null"
How can I incorporate this into an SQL query, say
Select ID, Date1, Date2, Comment
From Table1
where Date1 Is Not Null
Is there a way of substituting the ":p10_open_or_closed" variable into this query?
ie
Select ID, Date1, Date2, Comment
From Table1
where Date1 ":p10_open_or_closed"
Thanks.Thanks for your help gents.
Originally, I had a PL/SQL Statement constructing the code as needed, as Rekha
suggested.
if :P1_OPEN_OR_CLOSED = 1 then
q:=q||' and ';
q:=q||' p.ACTUAL_INSTALL_DATE is null ';
end if;
if :P1_OPEN_OR_CLOSED = 2 then
q:=q||' and ';
q:=q||' p.ACTUAL_INSTALL_DATE is not null ';
end if;
But, to use a Tabular form, where users can update fields of multiple records on screen then submit for a MRU, the option of PL/SQL code is not allowed, only SQL. So Phil UK, no it's not an elegant way of doing things, but I'm forced to use SQL, yeah?
There are definitely ways that I can filter for the solution I am after, but they all involve more in depth solutions (that are not that great). Thus, I asked at this forum.
Andy, your solution works :~) which makes me very happy. I'm not sure how just now but I'll learn from it.
Thanks again. -
Hello,
I am in need of some SQL help as I am not sure how to do it. I want to only return rows of data that meet the following criteria:
1) in tableA columnA it could have a value shown as such: A,B,1,2,3,5,8
2) in tableA columnB it shows one of the following four variables (Test1, Test2, Test3, Test4)
3) in tableA columnC it will show a date.
4) in tableB there is a row for each day of the year.
5) in tableB there is a column that matches each of the four variables in #2 above.
First it should match the date in tableA ColumnC to the row in tableB that matches. Then it should then find the column in tableB that matches to the value in tableA columnB. in that cell it will have a single value from A-D or 1-9. If it is an A for example, it will need to check against tableA columnA. if it has an A in it, it will return it. If it does not, it will not.
Does anyone have any idea how to write this? Is this possible?
Thank you,
JeffCheck the query using hardcoded values first - values taken from your explication
select x.idfield
from tablea x,
(select datedefinefield,
'VARIABLE4' the_variable,
case 'VARIABLE4' when 'VARIABLE1'
then variable1
when 'VARIABLE2'
then variable2
when 'VARIABLE3'
then variable3
when 'VARIABLE4'
then variable4
end the_value
from tableb
where datedefinefield = date '2013-01-01'
) y
where x.datefield = y.datedefinefield
and x.variablefield = y.the_variable
and instr(','||x.codefield||',',','||y.the_value||',') > 0
then replace the hardcoded values with bind variables
select x.idfield
from tablea x,
(select datedefinefield,
:the_variable the_variable,
case :the_variable when 'VARIABLE1'
then variable1
when 'VARIABLE2'
then variable2
when 'VARIABLE3'
then variable3
when 'VARIABLE4'
then variable4
end the_value
from tableb
where datedefinefield = to_date(:the_date,'yyyymmdd')
) y
where x.datefield = y.datedefinefield
and x.variablefield = y.the_variable
and instr(','||x.codefield||',',','||y.the_value||',') > 0
type the values in the window SQL Developer displays before execution to prompt you for bind variable values
VARIABLE4 for the_variable
20130101 for the_date
no quotes this time then hit the Apply ( not very sure that's the caption) button to start execution and you should get the same result as with hardcoded values.
If that works, you can start playing with (submitting values of your choice)
Regards
Etbin -
Based on your inputs-I studied and created the below objects.I apologise for asking lengthy questions,but i
need your help very much now to proceed next.
There is a COMPANY WHICH has many divisions/departments in it.
These divisions has employees.
*{color:#0000ff}--Created employee table which employee_id and Salary.*
**employees (*empid,salary){color}*
*{color:#0000ff}***DO i need to put the DEPT_ID and Manager_id in the EMPLOYEES table? {color}*
*{color:#0000ff}--Presently,iCreated a relationship table to have EMPLOYEE"S MANAGER information.a manager is an employee itself.{color}*
*{color:#0000ff}--Created a table for EMPLOyee and department---RELATIONSHIP ---> empl_id and dept_id{color}*
The COMPANY has numerous Products(also we can say projects) and these project work is done by the various depts.
*{color:#0000ff}Projects /Job table*
*--job_id*
*--Project_name*
*--Budget Amount{color}*
*{color:#0000ff}--Created a table for Project and department---RELATIONSHIP ---> proj_id and dept_id*
*--Also,Created a table for Project and Employee---RELATIONSHIP ---> proj_id and employee_id{color}*
Also,here scenario (1)Employees can work or be a part of many or multiple departments and work for multiple projects/products at a time (2)As usual-each Department has a manager.**EVery dept can handle or work only on one project.
*{color:#0000ff}--Created a table for Project and department---RELATIONSHIP ---> proj_id and dept_id*
*--Also,Created a table for Project and Employee---RELATIONSHIP ---> proj_id and employee_id*
*{color}*
_*{color:#000000}***(1)Are the tables and the relationships defined above enough or have i created too much tables?Please advise me.{color}*_
Queries:-Need to write SQLs for below items.Please help me.Could you all have a look
bq. h5. {color:#0000ff} \\ _ (2)SQL for a person see all his manager?***A person can have 2,3 managers._ \\ _ (3)need a person--->manager-->and their manager's MANAGER_ \\ _ (4)How will managers to view all employees reporting to him._ \\ {color} \\ h5. \\ {color:#0000ff}_(5)feasibility (SQL) to support the increase of salaries of employees in a department by percentage or amount wise._ \\ _ (6)SQL to update or change manager of a department/employee._ \\ {color} \\ h5. \\ {color:#0000ff}_(7)If a employee is removed-then all related details should also be removed._ \\ _ (8)to remove person and department,terminate a person from organisation_ \\ _ SHIFTING a person to different department,assign a person to a department_{color} \\ h5. {color:#0000ff}_SQL to collect all info of a person, his managers , departments and project this employee works._ \\ _ find Department which dont have managers._{color} \\ h5. \\ {color:#0000ff}_****find expenditure all projects together in terms of salary_{color}Sorry for all the confusion with the questions.So let me clear myself,i am doing this not as assignment or homework,but something
which interests me and trying to leran.Earlier as I stated that its a part of my school(** well frnakly speaking, it was my plan if i could
put this as an item of the school as the scope is very huge.
*(1)one employee can be in many departments(1 TO MANY) and and each department has one manager.(1 to 1)*
Created a table for EMPLOyee and department-RELATIONSHIP ---> empl_id and dept_id*
(2)Also,an employee can work in multiple items/projects(1-MANY) at a time. And a project HAS only one department.(1 to 1)
**Projects table created has codes,the Project name ,Planned budget cost/amount, start_date and end_date AND DEPART_ID
Also,Created a table for Project and Employee-RELATIONSHIP ---> proj_id and employee_id*
This is the full scenario has put above.So,i needed help as I am very confused if i have done the correct relationships.
And,these below items are my plans to allow the schema nd tables support it.
(2)how will a person see all his manager?***A person can have 2,3 managers.(EMP->MANAGER relationship TABLE)
(3)SQL to be able to show a person--->manager-->and their manager's MANAGER
(4)How will managers to view all employees reporting to him.
(5)SQL to support the increase of salaries of employees in a department by percentage or amount wise.
(6)SQL to update or change manager of a department/employee.
(7)If a employee is removed-then all related details should also be removed.
(8)to remove person and department,terminate a person from organisation
SHIFTING a person to different department,assign a person to a department
Projects /Job table EMPLOYEES TABLE-> SALARY info
--job_id
--Project_name
--Budget Amount -
I'm having trouble with an SQL query. I've created a simple logon page wherein a user will enter their user name and password. The program will look in an Access database for the user name, sort it by Date/Time modified, and check to see if their password matches the most recent password. Unfortunately, the query returns no results. I'm absolutely certain that I'm doing the query correctly (I've imported it directly from my old VB6 code). Something simple is eluding me. Any help would be appreciated.
private void LogOn() {
//make sure that the user name/password is valid, then load the main menu
try {
//open the database connection
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:LawOffice2000", "", "");
Statement select = con.createStatement();
String strTemp = "Select * From EMPLOYEES Where INITIALS = '" + txtUserName.getText() + "' Order By DATE Desc, TIME Desc";
ResultSet result = select.executeQuery(strTemp);
while(result.next()) {
if (txtPassword.getPassword().toString() == result.getString("Password")) {
MenuMain.main();
else {
System.out.println("Password Bad");
System.out.println(txtUserName.getText());
System.out.println(result.getString("Password"));
break; //exit loop
//close the connection
con.close(); }
catch (Exception e) {
System.out.println("LawOfficeSuite_LogOn: " + e);
return; }
}The problem is here: "txtPassword.getPassword().toString() == result.getString("Password"))"
Don't confuse String's equals() method with the equality operator '=='. The == operator checks that two references refer to the same object. If you want to compare the contents of Strings (whether two strings contain the same characters), use equals(), e.g. if (str1.equals(str2))...
Example:String s1 = "foo";
String s2 = new String("foo");
System.out.println("s1 == s2: " + (s1 == s2)); // false
System.out.println("s1.equals(s2): " + (s1.equals(s2))); // trueFor more information, check out Comparison operators: equals() versus == -
Hi there.
First of all i'm extremely sorry if i'm posting in wrong section.
I'm using Windows XP x64 edition
Photoshop CS3 Extended.
I'm newbie in photoshop.
Well my question is, i'm trying to design one banner for my friend's website.
In that banner there is 1 effect around the logo... its kinda splash effect. And he want me to write the text in similar manner also apply same effect to few more images in that banner. So how do i write Projects Planet in splash effect?? please help.
you can see that banner on www.projectsplanet.com
or
http://www.projectsplanet.com/index.php
Or
http://www.projectsplanet.com
Thank you in advanceThese brushes from the Adobe Studio Exchange might get you there:
http://xrl.us/biypx (Link to www.adobe.com)
Maybe you are looking for
-
IPod Touch 4th gen will not charge, or sync to iTunes
Hello, I have a 2 year old iPod 4th gen 32 gb. About a week ago a realized that when a charged it the charging screen did not appear. I made no big deal about it since it still charged, but then I tried to connect it to my cpu to see if anything ch
-
How do I add a benchmark time to a scatter plot in Numbers
I am working with a data set that includes a group of people that arrive at a location in a time range. I have these plotted on a scatter chart but I want to show a benchmark line and then how far off we are on that benchmark. How d I do this?
-
When I ran an itunes update yesterday it downloaded a virus with it. Was able to remove the virus but itunes will not run now as it says certain files are misssing. What do I do now?
-
JPA/TopLink concurrency ?
ok, now I have concurrency problem in my persistence layer.. Internal Exception: com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Duplicate entry '455' for key 1 Error Code: 1062 Call: INSERT INTO FPCERTIFICATE (ID, PATH, VERSION
-
How to see what is downloading
I have istat installed and right now showing something is downloading but i dont know what or how to stop it without turning airport off. So I was wondering if there was a way I could see what was downloading so I could stop whatever it is. Its actua