Need help on Executing this Script to update LyncDatabase remotely
Hi All,
I have some problem with executing the below script (to update the LyncDB post CU4 patched on Lync Servers) remotely, but it works fine Locally(from any Lync FE machine),
Script: Install-CsDatabase -Update -ConfiguredDatabases -SqlServerFqdn "LyncDB.Julie.local" -UseDefaultSqlPaths
When executing locally from any Lync FE Machine(LyncFE.julie.local), its working fine "Piece of Output for your reference"
Output:
PS C:\Users\julie>
Install-CsDatabase -Update -ConfiguredDatabases -SqlServerFqdn "LyncDB.Julie.local" -UseDefaultSqlPaths
****Creating DbSetupInstance for 'Microsoft.Rtc.Common.Data.BlobStore'****
Trying to connect to Sql Server LyncDB.Julie.local. using windows authentication...
Sql version: Major: 11, Minor: 0, Build 3128.
Sql version is acceptable.
Checking state for database rtcxds. it use to go like this for few pages to update all 06 database
Remote Script:
$sessionoption=new-pssessionoption -SkipRevocationCheck
$password=ConvertTo-SecureString -String "*******" -AsPlainText -Force
$credential=New-Object System.Management.Automation.PSCredential("******", $password)
$session=New-pssession -ComputerName "LyncFE.julie.local" -port 5985 -Credential $credential -Authentication
Negotiate -SessionOption $sessionoption
Try{
$cmd=invoke-command -session $session -scriptblock{
Install-CsDatabase -Update -ConfiguredDatabases -SqlServerFqdn "LyncDB.Julie.local" -UseDefaultSqlPaths
Write-Host $cmd
Remove-PSSession -Session $Session;
Catch
$RetVal = "Error23: " + $error[0].Exception.toString()
$cmd
Error:
Output:
WARNING: Install-CsDatabase failed.
WARNING: Detailed results can be found at "C:\Users\Julie\AppData\Local\Temp\Install-CsDatabase-52517af7-39ea-482e-8ba6-166a15cf8
4d2.html".
Command setup failed: Active Directory error "-2147016672" occurred while searching for domain
controllers in domain
"ad.*****.com": "An operations error occurred.
+ CategoryInfo : InvalidOperation: (:) [Install-CsDatabase],
ADTransientException
+ FullyQualifiedErrorId : BeginProcessingFailed,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet
+ PSComputerName : LyncDB.Julie.local.com
I tried both the Option, both still I'm getting the same error like the below,
Error:
Output:
WARNING: Install-CsDatabase failed.
WARNING: Detailed results can be found at
"C:\Users\Julie\AppData\Local\Temp\Install-CsDatabase-52517af7-39ea-482e-8ba6-166a15cf8
4d2.html".
Command setup failed: Active Directory error
"-2147016672" occurred while searching for domain controllers in domain
"ad.*****.com": "An operations error occurred.
+ CategoryInfo
: InvalidOperation: (:) [Install-CsDatabase], ADTransientException
+ FullyQualifiedErrorId : BeginProcessingFailed,Microsoft.Rtc.Management.Deployment.InstallDatabaseCmdlet
+ PSComputerName
: LyncDB.Julie.local.com
Similar Messages
-
Need Help on Executing Shell Scripts through PL-SLQ
Hi All,
I am trying to execute a shell script from PL-SQL but I am not getting it right .
the code i used is as follows
----JAVA CLASS ---
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
import java.io.*;
public class Host {
public static void executeCommand(String command) {
try {
String[] finalCommand;
if (isWindows()) {
finalCommand = new String[4];
// Use the appropriate path for your windows version.
finalCommand[0] = "C:\\windows\\system32\\cmd.exe"; // Windows XP/2003
//finalCommand[0] = "C:\\winnt\\system32\\cmd.exe"; // Windows NT/2000
finalCommand[1] = "/y";
finalCommand[2] = "/c";
finalCommand[3] = command;
else {
finalCommand = new String[3];
finalCommand[0] = "/bin/sh";
finalCommand[1] = "-c";
finalCommand[2] = command;
final Process pr = Runtime.getRuntime().exec(finalCommand);
pr.waitFor();
new Thread(new Runnable(){
public void run() {
BufferedReader br_in = null;
try {
br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
String buff = null;
while ((buff = br_in.readLine()) != null) {
System.out.println("Process out :" + buff);
try {Thread.sleep(100); } catch(Exception e) {}
br_in.close();
catch (IOException ioe) {
System.out.println("Exception caught printing process output.");
ioe.printStackTrace();
finally {
try {
br_in.close();
} catch (Exception ex) {}
}).start();
new Thread(new Runnable(){
public void run() {
BufferedReader br_err = null;
try {
br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
String buff = null;
while ((buff = br_err.readLine()) != null) {
System.out.println("Process err :" + buff);
try {Thread.sleep(100); } catch(Exception e) {}
br_err.close();
catch (IOException ioe) {
System.out.println("Exception caught printing process error.");
ioe.printStackTrace();
finally {
try {
br_err.close();
} catch (Exception ex) {}
}).start();
catch (Exception ex) {
System.out.println(ex.getLocalizedMessage());
public static boolean isWindows() {
if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
return true;
else
return false;
---PROCEDURE TO BE EXECUTED WHICH USES THE ABOVE JAVA CLASS IS ----
CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
AS LANGUAGE JAVA
NAME 'Host.executeCommand (java.lang.String)';
--- THE PERMISSIONS ---
call dbms_java.grant_permission('SYSTEM', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
call dbms_java.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
call dbms_java.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
--- THE SHELL SCRIPT IS -----
#!/bin/sh
# This script removes the carriage returns from the Files having .DAT1 extensions in the /test/ Directory
# and the sends the single line stream to the new file with the use of 'gawk' command
# so finaly the files with same primary name but different secondary name are created
# e.g. file 'test.DAT1' is onverted to 'test.DAT'
# LOOP on /test/ DIRECTORY FOR SEARCHING FILES HAVING EXTENSION *.DAT1
for file_name in `ls /test/*.DAT1`
do
new_file_name=`echo $file_name | sed 's/DAT1/DAT/'`
# SEND THE CONTAINTS OF SELECTED FILE IN LOOP AS A CONTINUOUS STREAM TO NEW FILE NAME USING 'gawk' COMMAND
gawk 'BEGIN { ORS = "''" } { print $0 }' $file_name >> $new_file_name
# ABOVE LINE WILL CREATE A NEW FILE WITH SAME PRIMARY NAME BUT .DAT AS SECONDARY NAME(EXTENSION)
# REMOVE THE PRIOR FILE(s) AFTER SUCCESSFUL CALL TO 'gawk'
# $? returns 0 if the call to gawk command is succesfull
if test 0 = "$?"
then
rm -f $file_name
fi
done
# END LOOP ON /test/ DIRECTORY
---THE CALL TO THE PROCEDURE --
SQL>CALL DBMS_JAVA.SET_OUTPUT(1000000);
SQL>SET SERVEROUTPUT ON SIZE 1000000
SQL>exec host('/root/sh ecs_script.sh'); -----------------------------------------------1
now, the statement 1 is the path of the Shell Script ecs_script.sh
which uses gawk command and does some operations on some file..
but when i give the call in Statement 1 its giving error like
/bin/sh is not a directory
so i am not getting wHat should I do so that my script "ecs_script.sh" gets executed..
Please Help.@ Bhagat & Michaels
Dear Friends,
I changed my shell name as per ur suggestions
and recompiled the Java class source with
finalCommand[0] = "/bin/bash"; instead of finalCommand[0] = "/bin/sh";
and then recompiled the host procedure
executed the host procedure as per ur suggestion as follows (with out put)
SQL> exec host('/bin/bash ecs_script.sh')
PL/SQL procedure successfully completed.
bt, bt, bt, it still did not do any operations defined in the "ecs_script.sh"
in fact the script did nt executed.......
pls help , I am loosing my time..
regards. -
i need help! i am trying to update iphoto on my macbook pro that i had bought from someone else. although i am signed into my account when trying to update it is asking me for the previous owners account details and it wont let me change it to my details how can i solve this problem please.
thank you
Jan RobinsonThat's because the Mac, OS X and the iLife apps that came preinstalled on the Mac all belong to the previous owner. The previous owner needs to call Apple care and have their Apple ID disassociated from the Mac. Then the hard drive needs to be totally erased and OS X and the iLife apps reinstalled using OS X Recovery.
-
I need help locating where and how to update Mac OS-X to Mountain Lion.....Thanx....Jay
First update your 10.6 version to 10.6.8 from the software update under the Apple Menu.
This will add direct access to the Mac App store via a new application.
Now launch the App Store from your Applications folder - Its the new icon a letter A formed from a ruler pencil and pen on a blue circle !
Once launched you need to add your iTunes account details or create an account add payment details etc...
Sign in purchase download and follow install processes to upgrade to 10.8 Mountain Lion.
OH and to be safe BEFORE you install backup your current system to an external drive ! -
I need help in making the programe which updates our code into client machi
I need help in making the programme which updates our code into client machine from the server.
As yahoo messanger does if there is any updated version of yahoo messanger.
It asks when we login into it do you want to update new version of yahoo messanger
It automatically updates it
Need Help??Sounds to me like you need Java Web Start.
-
My old iMac and OS 10.4 will not accept the New iTunes Version 10 application and I can't get past the screen offering to download iTunes 10. This is wrong and I need help getting past this situation. Help!
Sure, you can get around it if you don't need the newest version of iTunes. I still use version 7.5 because the newer versions didn't strike me as offering anything I needed.
If you do need a version 10-something then you will have to upgrade your operating system to Leopard (fi your computer will support it) at least. If you need 10.5 for some reason then there's no getting around it, you will have to buy a new computer. -
I need help instantly on this program please
import java.util.*;
public class D3
private static int[] z = new int[100000];
private static int first=z[0];
private static int last=z[n-1];
private static int n=100000;
public static void main(String args[])
Scanner input=new Scanner(System.in);
for(int i=0;i<z.length;i++)
z=2*i;
int seqSearch(z;50000;n); //method call 4 key where key=mid
int binSearch(z;first;last;50000);
int seqSearch(z;35467;n); //method call 4 key where key in the left half
int binSearch(z;first;last;35467);
int seqSearch(z;89703;n); //method call 4 key where key in the right half
int binSearch(z;first;last;89703);
public int seqSearch(int z[];int key;int n)
long start = System.currentTimeMillis();
int count=0;
int ans=-1;
for(int i=0;i<n;i++)
if z[i]=key
count++
{ans=i
break;}
return ans;
long elapsed = System.currentTimeMillis() - start;
System.out.print("Execution Time:" + elapsed);
System.out.print("# of Basic Operations:" + count);
public int binSearch(int z[];int first;int last;int key)
long start = System.currentTimeMillis();
int count=0;
if(last<first){
count++;
index=-1;
else
count++;
int mid=(first+last)/2
if(ket=z[mid]{
index=mid;
else
if(key<z[mid]){
index = binSearch(z[];first;mid-1;key);
else
index=binSearch(z[];mid+1;last;key);
return index;
long elapsed = System.currentTimeMillis() - start;
System.out.print("Execution Time:" + elapsed);
System.out.print("# of Basic Operations:" + count);
// if anyone could tell me whats wrong with my code i'd be greatful...the program is supposed to perform binary and sequential search on a sorted array of 100000 numbers.once on an item in the middle of the array once on the right side of it and once on the left side...i also need to count the number of basic operations for the same number in both sequential and binary to see whats better.and i need to check the time...plz i need help now,,,"Guide to a first-time poster"
you need to add exclamation marks to signify how urgent it is
e.g.
i need help instantly on this program please!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
capital letters is better
I NEED HELP INSTANTLY ON THIS PROGRAM PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
starting the italics on line 1, better again
import java.util.*;
public class D3
private static int[] z = new int[100000];
private static int first=z[0];
private static int last=z[n-1];
private static int n=100000;
public static void main(String args[])
Scanner input=new Scanner(System.in);
for(int i=0;i<z.length;i++)
z=2*i;
int seqSearch(z;50000;n); //method call 4 key where key=mid
int binSearch(z;first;last;50000);
int seqSearch(z;35467;n); //method call 4 key where key in the left half
int binSearch(z;first;last;35467);
int seqSearch(z;89703;n); //method call 4 key where key in the right half
int binSearch(z;first;last;89703);
public int seqSearch(int z[];int key;int n)
long start = System.currentTimeMillis();
int count=0;
int ans=-1;
for(int i=0;i<n;i++)
if z=key
count++
{ans=i
break;}
return ans;
long elapsed = System.currentTimeMillis() - start;
System.out.print("Execution Time:" + elapsed);
System.out.print("# of Basic Operations:" + count);
public int binSearch(int z[];int first;int last;int key)
long start = System.currentTimeMillis();
int count=0;
if(last><first){
count++;
index=-1;
else
count++;
int mid=(first+last)/2
if(ket=z[mid]{
index=mid;
else
if(key><z[mid]){
index = binSearch(z[];first;mid-1;key);
else
index=binSearch(z[];mid+1;last;key);
return index;
long elapsed = System.currentTimeMillis() - start;
System.out.print("Execution Time:" + elapsed);
System.out.print("# of Basic Operations:" + count);
and what about the dukes, offer 10 (never to be awarded, of course)
do this, then sit back and watch the replies roll in. -
i need help i believe i did an update for facebook on a iphone 4.3.1, and now facebook will not open?
You have updated the app to a version that is not compatible with your iphone.
The iphone 3g can only go to 4.2.1
You should check compatibiity before updating your apps.
Sorry -
I can't log into the Itunes store. I type in my Apple ID and my password and the message "This Apple ID cannot be used for the iTunes Store." "Enter another Apple ID." I need help on fixing this.
Yeah I'm starting to see a ton of forums posts right now about the same thing :/ I wonder what's going on
-
How to execute vb script with out using Remote manager in oim 11g r2
Hi Currently,
i have a requirement to execute vb script (present on a remote machine in which connector server is installed) from oim machine while using Exchange connector (11.1.1.6).
This can be achieved by using remote manager,but i dont want to use remote manager.
Hence decided to use Action scripts.
As per connector configuration,
i have configured Action scripts in Lookup.Exchange.UM.Configuration lookup definition, by means of three entries
After Create Action Language Shell
After Create Action Target Resource
After Create Action File /home/scripts/Disable.bat
Disable.bat has the following ,
Powershell.exe -File C:\scripts\Setup.vbs
-%Log on Name%
Exit
As Setup.vbs is expecting a parameter of log on name, i was providing the same.
But while creating the user,as this script gets called, getting the following error and hence 'create User' is getting failed.
Problem while PowerShell execution System.Management.Automation.RemoteException: This task does not support recipients of this type. The specified recipient XXXXXXXXXXX...XXXXX is of type UserMailbox. Please make sure that this recipient matches the required recipient type for this task.
While provisioning the user to Exchange , i have selected 'Recepient type' as 'User Mail box' explicitly, but still getting the error.
Please provide any pointers to resolve the issue.
Thanks in advance
KumarAs far as I know Oracle and MySQL are two different products.
Why do you clutter an Oracle forum with MySQL questions?
If MySQL is such a tremendous RDBMS, like many people state (as 'free' means per definition better),
why don't you visit a MySQL forum where fellow MySQL aficionados can answer you MySQL questions?
In short, why don't you stop abusing Oracle forums?
Sybrand Bakker
Senior Oracle DBA -
Need help with PHP mail script [was: Can someone please help me?]
I'm trying to collect data from a form and email it. I'm using form2mail.php and the problem is that the email is not collecting the form info and it has the same email address in the From: and To: lines. I'm really stuck and would appreciate any help.
Here is the HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Us</title>
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {
font-size: 14px;
color: #000000;
body {
background-color: #FFFFFF;
body,td,th {
color: #CC3300;
.style3 {font-size: 14px; font-weight: bold; }
.style6 {font-size: 18px}
.style7 {font-size: 16px}
.style8 {font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style9 {font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style10 {color: #000000}
-->
</style>
</head>
<body>
<div align="center"><img src="nav2.jpg" alt="nav bar" width="698" height="91" border="0" usemap="#Map2" />
<map name="Map2" id="Map2">
<area shape="rect" coords="560,9,684,38" href="accessories.html" />
<area shape="rect" coords="456,8,548,38" href="contact.html" />
<area shape="rect" coords="305,8,435,40" href="photog.html" />
<area shape="rect" coords="187,9,283,39" href="services.html" />
<area shape="rect" coords="81,10,167,39" href="aboutus.html" />
<area shape="rect" coords="5,10,68,39" href="index.html" />
</map>
<map name="Map" id="Map">
<area shape="rect" coords="9,9,69,39" href="index.html" />
<area shape="rect" coords="83,11,165,39" href="aboutus.html" />
<area shape="rect" coords="182,9,285,38" href="services.html" />
<area shape="rect" coords="436,14,560,37" href="contact.html" />
<area shape="rect" coords="563,14,682,38" href="accessories.html" />
</map>
</div>
<p> </p>
<form id="TheForm" name="TheForm" action="form2mail.php" method="post">
<p align="center" class="style2">P<span class="style1">lease fill out form below for a "free no obligation quote" then click submit.</span></p>
<p align="center" class="style3">(*Required Information)</p>
<div align="center">
<pre><strong><span class="style8">*Contact Name</span> </strong><input name="name" type="text" id="name" />
<span class="style8"><strong>
Business Name </strong></span><input name="bn" type="text" id="bn" />
<span class="style8"><strong>*Phone Number <input type="text" name="first" size="3" onFocus="this.value='';"
onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.second);" maxlength="3" value="###" /> - <input type="text" name="second" size="3" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.third);" maxlength="3" value="###" /> - <input type="text" name="third" size="4" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.fourth);" maxlength="4" value="####"/> </strong></span>
<strong><span class="style1">*</span><span class="style8">Email Address</span> <input name="email" type="text" id="email" /> </strong> </pre>
<label><span class="style9">*Re-enter to confirm</span>
<input name="emx" type="text" id="emx" /></label><br /><br /><span class="style9">
<label></label>
</span>
<p><span class="style9">*Best time to call </span>
<select name="name1[]" multiple size="1" >
<option>8am-9am</option>
<option>9am-10am</option>
<option>10am-11am</option>
<option>11am-12pm</option>
<option>12pm-1pm</option>
<option>1pm-2pm</option>
<option>2pm-3pm</option>
<option>3pm-4pm</option>
<option>4pm-5pm</option>
<option>5pm-6pm</option>
<option>6pm-7pm</option>
<option>7pm-8pm</option>
</select>
<br />
<br />
<span class="style9">Type of Location</span>
<select name="name2[]" multiple size="1" >
<option>Residential</option>
<option>Commercial</option>
</select>
<br />
<br />
<span class="style1"><br />
<strong><br />
<span class="style6">*Type of Services Requested:</span></strong><br />
</span><strong><span class="style10">(check all that apply)</span><br />
</strong><br />
<span class="style7"><span class="style1"><strong>Janitorial cleaning</strong></span>
<input type="checkbox" name="checkbox[]" value="checkbox" multiple/>
<br />
</span><strong><br />
<span class="style8">Mobile Auto Detailing</span>
<input type="checkbox" name="checkbox2[]" value="checkbox" multiple/>
<br />
<br />
</strong><span class="style9">Moving/Hauling</span>
<input type="checkbox" name="checkbox3[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Pressure washing</span>
<input type="checkbox" name="checkbox4[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Window washing</span>
<input type="checkbox" name="checkbox5[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Window Tinting</span>
<input type="checkbox" name="checkbox6[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Boat cleaning</span>
<input type="checkbox" name="checkbox7[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">RV cleaning</span>
<input type="checkbox" name="checkbox8[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Motorcycle cleaning</span>
<input type="checkbox" name="checkbox9[]" value="checkbox" multiple/>
<br />
<br />
<br />
<br />
<input name="SB" type="button" class="style9" value="Submit" onClick="sendOff();">
</p>
</div></label>
<script language="JavaScript1.2">
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
var good;
function checkEmailAddress(field) {
// Note: The next expression must be all on one line...
// allow no spaces, linefeeds, or carriage returns!
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org) |(\..{2,2}))$)\b/gi);
if (goodEmail){
good = true
} else {
alert('Please enter a valid e-mail address.')
field.focus()
field.select()
good = false
function autoTab(startPoint,endPoint){
if (startPoint.getAttribute&&startPoint.value.length==startPoint.getAttribute("max length"))
endPoint.focus();
function checkNumber(phoneNumber){
var x=phoneNumber;
var phoneNumber=/(^\d+$)|(^\d+\.\d+$)/
if (phoneNumber.test(x))
testResult=true
else{
alert("Please enter a valid number.")
phoneNumber.focus();
phoneNumber.value="";
testResult=false
return (testResult)
function sendOff(){
namecheck = document.TheForm.name.value
if (namecheck.length <1) {
alert('Please enter your name.')
return
good = false
checkEmailAddress(document.TheForm.email)
if ((document.TheForm.email.value ==
document.TheForm.emx.value)&&(good)){
// This is where you put your action
// if name and email addresses are good.
// We show an alert box, here; but you can
// use a window.location= 'http://address'
// to call a subsequent html page,
// or a Perl script, etc.
window.location= 'form2mail.php';
if ((document.TheForm.email.value !=
document.TheForm.emx.value)&&(good)){
alert('Both e-mail address entries must match.')
</script>
</form>
<p> </p>
</body>
</html>
and here is the form2mail.php:
<?php
# You can use this script to submit your forms or to receive orders by email.
$MailToAddress = "[email protected]"; // your email address
$redirectURL = "http://www.chucksmobile.com/thankyou.html"; // the URL of the thank you page.
$MailSubject = "[Customer Contact Info]"; // the subject of the email
$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
$serverCheck = FALSE; // if, for some reason you can't send e-mails, set this to "false"
# copyright 2006 Web4Future.com =================== READ THIS ===================================================
# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
# To block an IP, simply add it to the blockip.txt text file.
# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
# This is needed because the script tries to block the IP that tried to hack it
# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
# you have to do the same with checkboxes
Web4Future Easiest Form2Mail (GPL).
Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
http://www.Web4Future.com/
This script was written by George L. & Calin S. from Web4Future.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
$w4fver = "2.2";
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
//function blockIP
function blockip($ip) {
$handle = @fopen("blockip.txt", 'a');
@fwrite($handle, $ip."\n");
@fclose($handle);
$w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
if ($serverCheck) {
if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
} else { $w4fy = TRUE; }
if (($w4fy === TRUE) && ($w4fx === FALSE)) {
$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";
if (count($_GET) >0) {
reset($_GET);
while(list($key, $val) = each($_GET)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
$w4fMessage .= "<br>\n";
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
} // end while
}//end if
else {
reset($_POST);
while(list($key, $val) = each($_POST)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
$w4fMessage .= "<br>\n";
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
} // end while
}//end else
$w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
$w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
$name = preg_replace($w4f_what, "", $name);
$email = preg_replace($w4f_what, "", $email);
if (!$email) {$email = $MailToAddress;}
$mailHeader = "From: $name <$email>\r\n";
$mailHeader .= "Reply-To: $name <$email>\r\n";
$mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
$mailHeader .= "MIME-Version: 1.0\r\n";
if ($sendHTML) {
$mailHeader .= "Content-Type: multipart/alternative;";
$mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";
$mailHeader .= "X-Priority: 3\r\n";
$mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
$mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
if ($sendHTML) {
$mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/html; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= "$w4fMessage\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";
if ($sendHTML === FALSE) {
$mailHeader .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
else { header("Location: ".$redirectURL); }
} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
?>
Thanks in advance,
Glenn
[Subject line edited by moderator to indicate nature of request]Using PHP to process an online form and send the input by email is very simple. The mail() function takes a minimum of three arguments, namely: the address the mail is being sent to, the subject line, and the body of the email as a single string. The reason some people use scripts like form2mail.php is because they don't have the knowledge or patience to validate the user input to make sure it's safe to send.
Rather than attempt to trawl through your complex form looking for the problems, I would suggest starting with a couple of simple tests.
First of all, create a PHP page called mailtest.php containing the following script:
<?php
$to = '[email protected]'; // use your own email address
$subject = 'PHP mail test';
$message = 'This is a test of the mail() function.';
$sent = mail($to, $subject, $message);
if ($sent) {
echo 'Mail was sent';
} else {
echo 'Problem sending mail';
?>
Save the script, upload it to your server, and load it into a browser. If you see "Mail is sent", you're in business. If not, it probably means that the hosting company insists on the fifth argument being supplied to mail(). This is your email address preceded by -f. Change the line of code that sends the mail to this:
$sent = mail($to, $subject, $message, null, '[email protected]');
Obviously, replace "[email protected]" with your own email address.
If this results in the mail being sent successfully, you will need to adapt the code in form2mail.php to accept the fifth parameter. You need to change the following line, which is a few lines from the end of the script:
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader))
Change it to this:
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader, '[email protected]'))
Again, use your own email address instead of "[email protected]".
Once you have determined whether you need the fifth argument, test form2mail.php with a very simple form like this:
<form id="form1" name="form1" method="post" action="form2mail.php">
<p>
<label for="name">Name:</label>
<input type="text" name="name" id="name" />
</p>
<p>
<label for="email">Email:</label>
<input type="text" name="email" id="email" />
</p>
<p>
<label>
<input type="checkbox" name="options[]" value="boat cleaning" id="options_0" />
Boat cleaning</label>
<br />
<label>
<input type="checkbox" name="options[]" value="RV cleaning" id="options_1" />
RV cleaning</label>
<br />
<label>
<input type="checkbox" name="options[]" value="motorcycle cleaning" id="options_2" />
Motorcycle cleaning</label>
</p>
<p>
<input type="submit" name="send" id="send" value="Submit" />
</p>
</form>
If that works, you can start to make the form more complex and add back your JavaScript validation. -
I need help to run this package and i got some error
create or replace
PACKAGE BODY SUBS_INS_API_sun
AS
PROCEDURE SUBSCRIBER_INS_sun
(SOURCE_SYS_ID IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_NO IN VARCHAR2,
prepaidActDevDetails_tab IN prepaidactdvcdetailsobj_sun,
ERROR_CODE OUT VARCHAR2)
IS
Input_Parameter_Is_Null EXCEPTION;
pragma exception_init(Input_Parameter_Is_Null,-2000);
prepaidAccountDetails prepaidActDevDetails_tab:= prepaidActDevDetails_tab(NULL,NULL,NULL,NULL,NULL);
STATUS VARCHAR2(1):='1';
cust_no VARCHAR(10);
m_mac_id VARCHAR2(20);
subscriber_master_Rec subscriber_master%ROWTYPE :=NULL;
flg NUMBER(1);
BEGIN
IF(Source_Sys_Id IS NULL OR Tracking_Id IS NULL OR ACCOUNT_NO IS NULL OR prepaidAccountDetails.LAST=0) THEN
RAISE Input_Parameter_Is_Null;
END IF;
BEGIN
select cm_cust_no into cust_no from customer_master where cm_cust_id=ACCOUNT_NO and cm_status in('A','P','0');
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:='0';
END;
BEGIN
FOR i IN prepaidAccountDetails.FIRST .. (prepaidAccountDetails.LAST) LOOP
prepaidAccountDetails1:=prepaidActDevDetails_tab(i);
prepaidAccountDetails1.Status_of_device:='1';
IF (prepaidAccountDetails.Account_id is NULL OR prepaidAccountDetails.Mac_Id is NULL or prepaidAccountDetails.LOB_value is NULL) THEN
RAISE Input_Parameter_Is_Null;
END IF;
IF(prepaidAccountDetails.LOB_value = 'VDO') THEN
IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
Error_code :='SI002';
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
END IF;
END IF;
begin
select 1 into flg from subscriber_master where pm_phone_no=prepaidAccountDetails.Mac_Id and pm_status in('P','0','A','B');
EXCEPTION
WHEN NO_DATA_FOUND THEN
flg:=0;
END;
if(flg=1) then
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
END IF;
begin
select md_mac_id into m_mac_id from mac_details where md_mac_id=prepaidAccountDetails.Mac_Id and md_start_date<=sysdate
and md_status='A';
EXCEPTION when OTHERS then
Error_code :='SI004';
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
end;
if(STATUS= 1 and prepaidAccountDetails.Status_of_device='1') then
SELECT PM_SUBS_ACT_NO_SEQ.nextval
INTO subscriber_master_rec.PM_SUBS_ACT_NO
FROM dual;
subscriber_master_Rec.pm_phone_no :=prepaidAccountDetails.Mac_Id;
subscriber_master_Rec.pm_open_date :=sysdate;
subscriber_master_rec.pm_status :='P';
subscriber_master_rec.PM_CUST_LVL_YN:='S';
subscriber_master_rec.PM_EQUP_CODE:=prepaidAccountDetails.LOB_value;
subscriber_master_rec.PM_HOME_AREA:='HOM';
subscriber_master_rec.PM_USG_CODE:='USG';
subscriber_master_rec.PM_NO_TYPE:='S';
subscriber_master_rec.PM_TCG_CODE:='DEF';
subscriber_master_rec.PM_APLN_DATE:=sysdate;
subscriber_master_rec.PM_USER2:=prepaidAccountDetails.LOB_value;
subscriber_master_rec.PM_USER3:=prepaidAccountDetails.Channel_Line_Up;
subscriber_master_rec.pm_cust_no:=cust_no;
INSERT INTO subscriber_master VALUES subscriber_master_rec;
END IF;
END LOOP;
END;
END SUBSCRIBER_INS_sun;
END SUBS_INS_API_sun;
and
i got this error
Package Body PREPAID_TESTNEW.SUBS_INS_API@PREPAID_TESTNEW
Error(73,4): PL/SQL: Statement ignored
Error(73,99): PLS-00302: component 'LAST' must be declared
Error(87,6): PL/SQL: Statement ignored
Error(87,37): PLS-00302: component 'FIRST' must be declared
please help to run this package if anyone knowsnow i corrected my package. It working fine. But, how to run this package via procedure. my procedure check below. I give all the details about my package check below.
---pkg specification
create or replace
PACKAGE SUBS_INS_API_SS
IS
PROCEDURE SUBSCRIBER_INS_SS
(SOURCE_SYS_ID IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_NO IN VARCHAR2,
prepaidActDevDetails_tab IN prepaidActDeviceDetails_tabobj,
ERROR_CODE OUT VARCHAR2);
END SUBS_INS_API_SS;
-----pkg body
create or replace
PACKAGE BODY SUBS_INS_API_SS
AS
PROCEDURE log_error (ip_code IN VARCHAR2,
ip_message IN VARCHAR2,
ip_description IN VARCHAR2)
IS
BEGIN
INSERT INTO ERR_LOG (IEL_REF_ID,
IEL_DATE,
IEL_CODE,
IEL_MSG,
IEL_DESC)
VALUES (IVRS_ERR_LOG_SEQ.NEXTVAL,
SYSDATE,
ip_code,
ip_message,
ip_description);
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END log_error;
PROCEDURE INSERT_WS_LOG (SOURCE_SYS_ID IN VARCHAR2,
STATUS IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_ID IN VARCHAR2,
MAC_ID IN VARCHAR2)
IS
ws_log_rec WS_LOG%ROWTYPE := NULL;
BEGIN
SELECT WS_LOG#REC#ID.NEXTVAL INTO ws_log_rec.rec#id FROM DUAL;
ws_log_rec.VER#ID := 1;
ws_log_rec.CRE#TS := SYSDATE;
ws_log_rec.wl_source := SOURCE_SYS_ID;
ws_log_rec.wl_status := Status;
ws_log_rec.wl_tracking_id := tracking_id;
ws_log_rec.wl_account_id := account_id;
ws_log_rec.wl_mac_id := mac_id;
INSERT INTO ws_log
VALUES ws_log_rec;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END INSERT_WS_LOG;
PROCEDURE REPLICO_DEV_INFO( Acc_id IN VARCHAR2, Mc_Id IN VARCHAR2,channel IN VARCHAR2,
LOB_VAL IN VARCHAR2, outlet1 IN VARCHAR2, kit_cod IN VARCHAR2,
serial_No IN VARCHAR2, shipperr IN VARCHAR2, estm_recived_date IN date)
IS
Replico_device_info_det_Rec Replico_device_info_det%ROWTYPE := NULL;
REC_ID NUMBER;
BEGIN
SELECT REPLICO_DEVICE_INFO_DET#RECID.nextval INTO REC_ID FROM dual;
Replico_device_info_det_Rec.REC#ID := REC_ID;
Replico_device_info_det_Rec.ACCOUNT_ID := Acc_id;
Replico_device_info_det_Rec.MAC_ID := Mc_Id;
Replico_device_info_det_Rec.CHANNEL_LINE_UP := channel;
Replico_device_info_det_Rec.LOB_VALUE := LOB_VAL;
Replico_device_info_det_Rec.OUTLET := outlet1;
Replico_device_info_det_Rec.KIT_CODE := kit_cod;
Replico_device_info_det_Rec.SERIAL_NUMBER := serial_No;
Replico_device_info_det_Rec.SHIPPER := shipperr;
Replico_device_info_det_Rec.ESTIMATED_RECIVED_DATE := estm_recived_date;
INSERT INTO replico_device_info_det
VALUES Replico_device_info_det_Rec;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END REPLICO_DEV_INFO;
PROCEDURE SUBSCRIBER_INS_SS (
SOURCE_SYS_ID IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_NO IN VARCHAR2,
prepaidActDevDetails_tab IN prepaidActDeviceDetails_tabobj,
ERROR_CODE OUT VARCHAR2)
IS
Input_Parameter_Is_Null EXCEPTION;
PRAGMA EXCEPTION_INIT (Input_Parameter_Is_Null, -2000);
prepaidAccountDetails prepaid_act_dvc_details_obj
:= prepaid_act_dvc_details_obj (NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
STATUS VARCHAR2 (1) := '1';
cust_no VARCHAR (10);
m_mac_id VARCHAR2 (20);
channel_lineup VARCHAR2 (25);
LOB_VALUE VARCHAR2 (25);
subscriber_master_Rec subscriber_master%ROWTYPE := NULL;
Replico_device_info_det_Rec Replico_device_info_det%ROWTYPE := NULL;
flg NUMBER (1);
plan_code VARCHAR2(10);
subs_aact_no NUMBER(20);
m_plan_code1 payment_transaction_history.TH_PLAN_CODE%type;
m_payment_mode1 payment_transaction_history.TH_PAYMENT_MODE%type;
pm_phone_no_cur subscriber_master.pm_phone_no%type;
pm_status_cur subscriber_master.pm_status%type;
pm_user2_cur subscriber_master.pm_user2%type;
pm_user9_cur subscriber_master.pm_user9%type;
pm_cust_no_cur subscriber_master.pm_cust_no%type;
pm_cust_1 subscriber_master.pm_cust_no%type;
cm_i customer_master.cm_status%type;
CURSOR subs_rec is select pm_cust_no, pm_phone_no, pm_status, pm_user2, pm_user9 from subscriber_master
where pm_cust_no = cust_no and pm_status= 'S';
BEGIN
IF ( Source_Sys_Id IS NULL
OR Tracking_Id IS NULL
OR ACCOUNT_NO IS NULL
OR prepaidActDevDetails_tab.LAST = 0)
THEN
RAISE Input_Parameter_Is_Null;
END IF;
BEGIN
SELECT cm_cust_no
INTO cust_no
FROM customer_master
WHERE cm_cust_id = ACCOUNT_NO AND cm_status IN ('A', 'P', '0');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
ERROR_CODE := 'SI001';
log_error ('SI001',
SQLERRM,
'No Customer exist with Active or Pre Actiavted');
INSERT_WS_LOG (Source_Sys_Id,
'F',
Tracking_Id,
Account_No,
prepaidAccountDetails.Mac_Id);
STATUS := '0';
END;
BEGIN
FOR i IN prepaidActDevDetails_tab.FIRST ..
(prepaidActDevDetails_tab.LAST)
LOOP
prepaidAccountDetails := prepaidActDevDetails_tab (i);
prepaidAccountDetails.Status_of_device := '1';
IF ( prepaidAccountDetails.Account_id IS NULL
OR prepaidAccountDetails.Mac_Id IS NULL
OR prepaidAccountDetails.LOB_value IS NULL)
THEN
RAISE Input_Parameter_Is_Null;
END IF;
IF (prepaidAccountDetails.LOB_value = 'VIDEO')
THEN
/* Commented as channel lineup is not coming from the input request */
/*IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
Error_code :='SI002';
log_error ('SI002', SQLERRM, 'Channel line up is mandatory for Video');
INSERT_WS_LOG(Source_Sys_Id,'F',Tracking_Id,Account_No,prepaidAccountDetails.Mac_Id);
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
END IF;*/
SELECT EC_CHANNEL_LINEUP
INTO channel_lineup
FROM ELIGIBLE_CUSTOMER
WHERE EC_CUSTOMER_NO = cust_no;
END IF;
BEGIN
SELECT 1
INTO flg
FROM subscriber_master
WHERE pm_phone_no = prepaidAccountDetails.Mac_Id
AND pm_status IN ('P', '0', 'A', 'B');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
flg := 0;
END;
IF (flg = 1)
THEN
ERROR_CODE := 'SI003';
log_error ('SI003',
SQLERRM,
'Customer Already Exist with given Mac Id');
INSERT_WS_LOG (Source_Sys_Id,
'F',
Tracking_Id,
Account_No,
prepaidAccountDetails.Mac_Id);
STATUS := 0;
prepaidAccountDetails.Status_of_device := '0';
END IF;
BEGIN
SELECT md_mac_id
INTO m_mac_id
FROM mac_details
WHERE md_mac_id = prepaidAccountDetails.Mac_Id
AND md_start_date <= SYSDATE
AND md_status = 'A';
EXCEPTION
WHEN OTHERS
THEN
ERROR_CODE := 'SI004';
log_error ('SI004', SQLERRM, 'Invalid Mac Id');
INSERT_WS_LOG (Source_Sys_Id,
'F',
Tracking_Id,
Account_No,
prepaidAccountDetails.Mac_Id);
STATUS := 0;
prepaidAccountDetails.Status_of_device := '0';
END;
select pm_cust_no into pm_cust_1 from subscriber_master where pm_cust_no = cust_no;
IF (STATUS = 1 AND prepaidAccountDetails.Status_of_device = '1')
THEN
SELECT DECODE (prepaidAccountDetails.LOB_value,
'HSD', 'HSD',
'VIDEO', 'VDO')
INTO LOB_VALUE
FROM DUAL;
OPEN subs_rec;
LOOP
FETCH subs_rec into pm_cust_no_cur, pm_phone_no_cur, pm_status_cur, pm_user2_cur, pm_user9_cur;
IF subs_rec%FOUND THEN
IF
( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = prepaidAccountDetails.outlet and pm_status_cur = 'S')
THEN
update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id
where pm_cust_no = pm_cust_no_cur and pm_user9 = prepaidAccountDetails.outlet;
select cm_status into cm_i from customer_master where cm_cust_no = pm_cust_no_cur;
IF( cm_i = '0')
THEN
update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
END IF;
REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
ELSIF
( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = null and pm_status_cur = 'S')
THEN
update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id, pm_user9 = prepaidAccountDetails.outlet
where pm_cust_no = pm_cust_no_cur and pm_user9 = NULL;
update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
END IF;
ELSIF subs_rec%NOTFOUND THEN
SELECT PM_SUBS_ACT_NO_SEQ.NEXTVAL
INTO subs_aact_no
FROM DUAL;
subscriber_master_rec.PM_SUBS_ACT_NO := subs_aact_no;
subscriber_master_Rec.pm_phone_no :=
prepaidAccountDetails.Mac_Id;
subscriber_master_Rec.pm_open_date := SYSDATE;
subscriber_master_rec.pm_status := 'P';
subscriber_master_rec.PM_CUST_LVL_YN := 'S';
subscriber_master_rec.PM_EQUP_CODE := LOB_VALUE;
subscriber_master_rec.PM_HOME_AREA := 'HOM';
subscriber_master_rec.PM_USG_CODE := 'USG';
subscriber_master_rec.PM_NO_TYPE := 'S';
subscriber_master_rec.PM_TCG_CODE := 'DEF';
subscriber_master_rec.PM_APLN_DATE := SYSDATE;
subscriber_master_Rec.PM_NAME := prepaidAccountDetails.Mac_Id;
subscriber_master_Rec.PM_STAFF_id := '16';
subscriber_master_rec.PM_USER2 := LOB_VALUE;
subscriber_master_rec.PM_USER3 := channel_lineup;
subscriber_master_rec.pm_cust_no := cust_no;
subscriber_master_rec.PM_USER8 := 'Y';
INSERT INTO subscriber_master
VALUES subscriber_master_rec;
REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
END IF;
END LOOP;
CLOSE subs_rec;
SELECT TH_PLAN_CODE,TH_PAYMENT_MODE
INTO m_plan_code1,m_payment_mode1
FROM PAYMENT_TRANSACTION_HISTORY
WHERE TH_CUSTOMER_NO = cust_no
AND TH_LOB = LOB_VALUE
AND TH_SUBSCRIBER_NO IS NULL;
IF(LOB_VALUE = 'HSD') THEN
IF(m_plan_code1 = 'SIKI') THEN
plan_code := 'SIKI';
ELSE
plan_code := 'KIT';
END IF;
ELSE
IF(m_plan_code1 = 'SIKT') THEN
plan_code := 'SIKT';
ELSE
plan_code := 'TV';
END IF;
END IF;
UPDATE PAYMENT_TRANSACTION_HISTORY SET TH_SUBSCRIBER_NO = subs_aact_no, th_writeback_status = 'Y' WHERE TH_CUSTOMER_NO = cust_no AND TH_PLAN_CODE = plan_code;
COMMIT;
END IF;
END LOOP;
END;
END SUBSCRIBER_INS_SS;
END SUBS_INS_API_SS;
--- type object
create or replace
TYPE prepaid_act_dvc_details_obj--prepaidAccountDeviceDetailsObj
AS OBJECT ( Account_id VARCHAR2 ( 25 )
, Mac_Id VARCHAR2 ( 25 )
, Channel_Line_Up VARCHAR2 ( 25 )
, LOB_value VARCHAR2 ( 25 )
, Status_of_device VARCHAR2 ( 25 )
, outlet VARCHAR2(25)
, kit_code VARCHAR2(25)
, serial_Number VARCHAR2(25)
, shipper VARCHAR2(25)
, estimated_recived_date date )
type---
create or replace
TYPE prepaidActDeviceDetails_tabobj as table of prepaid_act_dvc_details_obj
---- i need to run this package via separate procedure. but i don't know how to pass the variable. because the passing argument contain object tab variable. please help me.. give me suggestion or procedure to run this pkg. -
Need help in executing the plsql code
hi guys,
below is the structure of the procedure i have created.
CREATE OR REPLACE PROCEDURE sp_R_TrgComparisonReport
DataDate IN DATE DEFAULT NULL,
Business IN OUT VARCHAR2,
Sector IN VARCHAR2 DEFAULT NULL,
SubSector IN VARCHAR2 DEFAULT NULL,
CUSIP IN OUT VARCHAR2,
DEALTICKER IN OUT VARCHAR2,
sFloatInd IN VARCHAR2 DEFAULT NULL,
RCT1 IN OUT GLOBALPKG.RCT1
AS
tmpBusCount INT;
tmpStartCount INT;
tmpEndCount INT;
tmpBusName VARCHAR2(30);
tmpAlterTable VARCHAR2(500);
tmpUpdateStr VARCHAR2(2000);
tmpFinalStr1 VARCHAR2(1000);
tmpFinalStr2 VARCHAR2(1000);
Days INT;
tmpFinalStrCMBS VARCHAR2(2000);
tmpCusip VARCHAR2(100);
tmpColName VARCHAR2(30);
tmpFinalStr4 VARCHAR2(1000);
tmpCMBSTable VARCHAR2(500);
tmpEndCount_CMBS INT;
tmpRating3str VARCHAR2(1000);
Deletestr VARCHAR2(1000);
ipos INT;
CALLINGPROCASSIGNTEMP1 VARCHAR2(31);
strSector VARCHAR2(2000);
CALLINGPROCASSIGNTEMP2 VARCHAR2(29);
strSubSector VARCHAR2(2000);
CALLINGPROCASSIGNTEMP3 VARCHAR2(32);
CALLINGPROCASSIGNTEMP4 VARCHAR2(28);
CALLINGPROCASSIGNTEMP5 VARCHAR2(40);
CALLINGPROCASSIGNTEMP6 VARCHAR2(34);
CALLINGPROCASSIGNTEMP7 VARCHAR2(36);
SCOPE_IDENTITY_VARIABLE INT;
G1_COL1 TMPHOLDINGTRIGGER.DEALTICKER%TYPE;
G1_ROWID ROWID;
G2_COL1 TMPHOLDINGTRIGGER.CURRENT_CE%TYPE;
G2_ROWID ROWID;
G3_COL1 TMPHOLDINGTRIGGER.SP_RATING%TYPE;
G3_ROWID ROWID;
G4_COL1 TMPHOLDINGTRIGGER.MOODY_RATING%TYPE;
G4_ROWID ROWID;
G5_COL1 TMPHOLDINGTRIGGER.FITCH_RATING%TYPE;
G5_ROWID ROWID;
G6_COL1 TMPHOLDINGTRIGGER.DEAL_DESC%TYPE;
G6_ROWID ROWID;
G7_COL1 TMPHOLDINGTRIGGER.CUSIP_COMMENTARY%TYPE;
G7_ROWID ROWID;
G8_COL1 TMPHOLDINGTRIGGER.CUSIP_RANKING_DESC%TYPE;
G8_ROWID ROWID;
G9_COL1 TMPHOLDINGTRIGGER.BB_DEALTICKER%TYPE;
G9_ROWID ROWID;
G10_COL1 TMPHOLDINGTRIGGER.CLASS%TYPE;
G10_ROWID ROWID;
G11_COL1 TMPHOLDINGTRIGGER.RANKING%TYPE;
G11_ROWID ROWID;
CALLINGPROCASSIGNTEMP8 VARCHAR2(34);
CALLINGPROCASSIGNTEMP9 VARCHAR2(39);
CALLINGPROCASSIGNTEMP10 VARCHAR2(43);
G12_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
G12_ROWID ROWID;
G13_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G13_ROWID ROWID;
G14_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
G14_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G14_ROWID ROWID;
G15_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
G15_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G15_ROWID ROWID;
G16_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G16_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G16_ROWID ROWID;
G17_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G17_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G17_ROWID ROWID;
G18_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G18_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G18_ROWID ROWID;
G19_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G19_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G19_ROWID ROWID;
G20_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G20_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G20_ROWID ROWID;
G21_COL1 TMPHOLDINGTRIGGER.INTEX_STATUSCODE%TYPE;
G21_COL2 TMPHOLDINGTRIGGER.COMMENT_%TYPE;
G21_ROWID ROWID;
G22_COL1 TMPHOLDINGTRIGGER.USER_STATUSCODE%TYPE;
G22_ROWID ROWID;
the procedure got compiled successfully.
and i am trying to execute this procedure in this way.
1 declare x refcursor;
2 exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','','ALL');
3* print x
L> /
i am facing errors.
ERROR at line 3:
ORA-06550: line 3, column 7:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
:= . ( @ % ; not null range default character
basically i am appsdba so dont have much exposure on this
can some one please help me out
thanks in advance.
let me know if you need the complete code
thanks,
Vamshi.Dand i am trying to execute this procedure in this way.
declare x refcursor;
2 exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','','ALL');
3* print xIn SQL*plus you would run it like this:
SQL> var x refcursor
SQL> exec exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','','ALL')
SQL> print xOf course that last command is going to hurl an invalid handle exception because you don't appear to have a ref cursor as an argument in your procedure's signature.
Unless that is what is meant by RCT1 IN OUT GLOBALPKG.RCT1. In which case you need to reference your variable there:
SQL> exec exec sp_R_TrgComparisonReport ('31-DEC-2003','','ABS','ALL','ALL','',:x) If that last argument is not the ref cursor then your call is going to fail because we can't use literals as OUT parameters.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
Need help in execution of script
Dear experts,
We have a central database 10g installed on windows server 2008. We have 47 sites and each site has its own database. We created Materialized views in central DB which collect data from all 47 sites. We have a script to refresh these Materialized views. The problem is this when one/ some sites down, the script halts/stop working at that specific point. We want a script which skip that specific (down) site. following is some part of the script.
start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_AFLAGDB.SQL"
start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password@rrdb @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_SLAYELDB.SQL"
start "" /wait /min cmd.exe /c "echo.|sqlplus.exe -S system/password@rrdb @E:\scripts\CMM\CMM_DIRECTION\CMM_DIRECTION_DWASERDB.SQL"
(note: AFLAG, SLAYEL & DWASER specifying the site name). Please experts help me in this concern.Probably the wrong forum for this question.
My guess would be that you need to add some sort of check to see if the site is up before running the refresh.
What is meant by having the site down?
What kind of script is this?
If it's a batch script:
Batch script to test if Oracle instance is up on windows 2003
Use that and loop through a text files of entries to try to connect to.
Or you could probably do everything in a PL/SQL stored procedure if links are setup. Having little idea what is in those SQL scripts I can't say whether or not this would be a good idea.
There it would be a matter of testing the link by querying dual through the link and handling the particular exception(s) of a bad link properly.
It would also reduce dependency on several script files.
Looping through the instances would also probably be easier through a procedure. -
Need help making a simple script for my webcam
Hey everyone, fairly new to applescript programming. I just bought a usb camera for my macbook because I use it for video conferencing/playing around, and it is better quality than the built in isight. However, in order to use this camera I need to use drivers from a program called camTwist. This being said camTwist needs to be opened first and the usb camera must be selected from camTwist Step 1 list in order for any other application to use the camera. I just want to make a simple program that would open camTwist first, then select "webcam" from the list (double click it like I always have to in order to select it) in order to activate the driver, and then open photo booth which would then be using the camTwist driver in order to take pictures.
I made a crude program but it does not automatically select "webcam" from the Step 1 list in camTwist:
tell application "CamTwist" to activate
delay 10
tell application "Photo Booth" to activate
that’s basically it. I set the delay to 10 seconds so that when camTwists boots up first I can manually select my webcam. HOWEVER, I would like to make a script that would boot up CamTwist first, select my webcam from the list automatically, and then open Photo Booth with the CamTwist webcam driver already selected.
Don't know much about applescript so any help to make a working script to solve my problem would be greatly appreciated! Thanks!Solved my problem but now I need help with something else! First I used CamTwist user options to create user defined hot keys with the specific purpose to load the webcam. I chose Command+B. I tested it out in CamTwist and it worked. The program follows a logical order from there. First it loads CamTwist, then after a short delay it presses the hot keys in order to load the webcam from the video source list, then another short delay and Photo Booth is opened with the driver loaded from camTwist. Everything works Perfect! Here's the code:
tell application "System Events"
tell application "CamTwist" to activate
delay 0.5
--Press command+b which is a user defined hot key to load webcam
key code 11 using command down
end tell
delay 0.5
tell application "Photo Booth" to activate
My Next question is, would it be possible with this same script to have both applications quit together. For example I always quit Photo Booth first, so when I quit photo booth is there a way to make CamTwist also quit and keep everything within the same script? Please let me know. This forum has been very helpful and lead me to a solution to my problem! Hoping I can solve this next problem as well! Thanks everyone.
Maybe you are looking for
-
Strange markings on screen...
A few things before I get to the point... -got my MacBook Pro in late August -I don't touch my screen at all, unless I am cleaning it. -Nobody else uses my laptop except me. About 2 months after I got my laptop I noticed some strange marks on my scre
-
How to access session in javabean?
I want to access session in javabean,how can I do?
-
Calling a Stored Procedure with a result set and returned parms
I am calling a stored procedure from a Brio report. The stored procedure returns a result set, but also passes back some parameters. I am getting a message that states that the DBMS cannot find the SP with the same footprint. Besides the result set,
-
HELP - I deleted an adobe file that I saved to a memory stick and I need it back really badly
-
hi friends, i have a requirement in which, when i post goods in migo, a pop up should come where i have to enter a form(form-31) details and this should get reflected in an ztable along with the vendor details. i have found that a BAdi(MB_DOCUMENT_BA