Help with Decode/CASE function
Can anyone provide some help or insight how can this be done.
Senario:
I have two parameters in my report.
Paramerer_A and Parameter_B
If I enter a value (XYZ) in Parameter_A and value (XYZ) in Parameter_B, I want the report to display ERROR and do not run.
Hi
It is not possible to have a use defined message come up based on the values of parameters but we can stop the workbook from executing.
First of all, you will will need to make sure that both parameters are optional and then create your condition such that it will not run if both are populated, like this:
(Item1 = :Parameter_A OR Item2 = :Parameter_B)
AND NOT
:Parameter_A IS NOT NULL AND :Parameter_B IS NOT NULL
You can also put in a check parameter that controls whether A or B should be used, with a prompt like this: Use Parameter A or Parameter B? Enter A or B
:Check_Parameter = 'A' AND Item1 = :Parameter_A
OR
:Check_Parameter = 'B' AND Item2 = :Parameter_B
Best wishes
Michael
Similar Messages
-
Hello All,
Can I use decode/case function within a decode function?
{code}
SELECT TO_CHAR (
EDMS_STRAGG_WC (
DISTINCT DECODE (
eqs.attrib_code,
'PRODUCT_AUTHORIZATION', 'Authorization: '
|| CASE eqs.qual_value
WHEN 'LIST'
THEN
(SELECT lookup_desc
FROM edmsadm.edms_lookup
WHERE lookup_type =
'PARTNER_AUTHORIZATION'
AND lookup_code =
eqls.list_value)
ELSE
(SELECT lookup_desc
FROM edmsadm.edms_lookup
WHERE lookup_type =
'PARTNER_AUTHORIZATION'
AND lookup_code =
eqs.qual_value)
END,
'PRODUCT_CERTIFICATION', 'Certification: '
|| CASE eqs.qual_value
WHEN 'LIST'
THEN
eqls.list_value
ELSE
eqs.qual_value
END,
'PRODUCT_SPECIALIZATION', 'Specialization: '
|| (SELECT lookup_desc
FROM edmsadm.edms_lookup
WHERE lookup_type =
'PARTNER_SPECIALIZATION'
AND lookup_code =
CASE eqs.qual_value
WHEN 'LIST'
THEN
eqls.list_value
ELSE
eqs.qual_value
END))))
program_value
FROM edms_qual_stg eqs, edms_qual_list_stg eqls
WHERE 1 = 1
AND eqs.qual_id = eqls.qual_id(+)
AND eqs.req_id = 192647
AND eqs.disc_line_id = 598631
AND eqs.attrib_code IN
('PRODUCT_CERTIFICATION',
'PRODUCT_AUTHORIZATION',
'PRODUCT_SPECIALIZATION');
{code}
Edms_qual_stg:
AND_OR_CONDITION
ATTRIBUTE_SOURCE
ATTRIB_CODE
CREATED_BY
CREATED_DT
DISC_LINE_ID
END_DT
EXCLUDE_INCLUDE
GROUP_AND_OR_CONDITION
GROUP_CODE
MAX_VALUE
MIN_VALUE
MODIFIED_BY
MODIFIED_DT
QUAL_APPL_PRECEDENCE
QUAL_ID
QUAL_OPERATOR
QUAL_TYPE
QUAL_VALUE
REQ_ID
START_DT
Edms_qual_list_stg:
ATTRIBUTE_SOURCE
ATTRIB_CODE
CREATED_BY
CREATED_DT
END_DT
INCLUDE_AFFILIATES
INCLUDE_EXCLUDE
LIST_VALUE
MODIFIED_BY
MODIFIED_DT
PRIMARY_PARTY
QUAL_ID
QUAL_LIST_ID
REFERENCE_ID
START_DT
Edms_lookup:
CREATED_BY
CREATED_DT
DISPLAY_SEQ
EDMS_LOOKUP_ID
END_DATE
LOOKUP_CODE
LOOKUP_DESC
LOOKUP_REFERENCE
LOOKUP_TYPE
MODIFIED_BY
MODIFIED_DT
START_DATE
SELECT eqs.qual_id, eqs.disc_line_id, eqs.req_id, eqs.attrib_code, eqs.qual_value, eqls.list_value
FROM edms_qual_stg eqs, edms_qual_list_stg eqls
WHERE 1 = 1
AND eqs.qual_id = eqls.qual_id(+)
AND disc_line_id = 598631
AND req_id = 192647
AND eqs.attrib_code IN
('PRODUCT_CERTIFICATION',
'PRODUCT_AUTHORIZATION',
'PRODUCT_SPECIALIZATION');
7509575 598631 192647 PRODUCT_CERTIFICATION LIST GOLD
7509575 598631 192647 PRODUCT_CERTIFICATION LIST SILVER
7509576 598631 192647 PRODUCT_AUTHORIZATION LIST ATP - JOULEX PROVIDER ESCO
7509576 598631 192647 PRODUCT_AUTHORIZATION LIST ATP - JOULEX PROVIDER IDENTIFY
7509577 598631 192647 PRODUCT_SPECIALIZATION LIST ADVANCED SECURITY
7509577 598631 192647 PRODUCT_SPECIALIZATION LIST EXPRESS FOUNDATION
Required Output:
Certification: GOLD, SILVER, Authorization: ATP - JOULEX PROVIDER ESCO, ATP - JOULEX PROVIDER IDENTIFY, SPECIALIZATION: ADVANCED SECURITY, EXPRESS FOUNDATION.
Thx
Shank.Hi,
Sure; a DECODE or CASE expression that returns a NUMBER can be used any place a NUMBER is expected, including within another DECODE or CASE expression. A DECODE or CASE expression that returns a DATE can be used any place a DATE is expected, including within another DECODE or CASE expression. A DECODE or CASE expression that returns a VARCHAR2 can be used almost any place a VARCHAR2 is expected. (There a couple of special situations where a string literal is absolutely required.)
There are not many situations where you really need to do that, though. It's usually simpler and more efficient to use a single CASE expression; nesting is rarely needed.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Simplify the problem as much as possible, so that it contains only enough to show the part you don't already know how to do.
If you really need a user-defined function to show the problem, then include a CREATE FUNCTION statement, and explain what the function does. Again, simplify: if the function isn't what you don't understand, post a problem that doesn't use the function.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
What is the difference betwee decode & case function
Hi
What is the difference betwee decode & case function
1.decode can't used in pl/sql 1) case can be user
2.in decode we can't use (>,<,>=) 2) we can use
any other do u have....
thanks in advance....DECODE works with expressions which are scalar values.
CASE can work with predicates and subqueries in searchable form.
There is one more Important difference between CASE and DECODE
DECODE can be used Only inside SQL statement....
But CASE can be used any where even as a parameter of a function/procedure
Eg:-
SQL> create or replace procedure pro_01(n number) is
2 begin
3 dbms_output.put_line(' The number = '||n);
4 End;
5 /
Procedure created.
SQL> set serverout on
SQL> var a varchar2(5);
SQL> Begin
2 :a := 'ONE';
3 End;
4 /
PL/SQL procedure successfully completed.
SQL> Begin
2 pro_01(Decode(:a,'ONE',1,0));
3 End;
4 /
pro_01(Decode(:a,'ONE',1,0));
ERROR at line 2:
ORA-06550: line 2, column 9:
PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL
statement only
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored
SQL> Begin
2 pro_01(case :a when 'ONE' then 1 else 0 end);
3 End;
4 /
The number = 1
PL/SQL procedure successfully completed.Message was edited by:
Avi
Message was edited by:
Avi -
I'm stuck on my coding when I have to write a function to
detect upper cases has been used in a sentence
For example if my array element has this:
2345
SAINT PAUL
STREET
APT 5
PHILADELPHIA
I need to be able to write a code to let me know that the 2nd
OR 3rd OR 5th element is written in upper case letter
Or if I set the variable not as array, 2345 SAINT PAUL STREET
APT 5 PHILADELPHIA
I need to be able to detect that at least one of the section
on that street name is written with upper case
Can anyone help please?compare() cf function performs a case-sensitive comparison of
2 strings
and returns 0 is the strings are the same. so you can compare
an
uppercase version of the string to the original string, and
if the
comparison returns 0 then your string is in uppercase:
<cfif compare(ucase(myarray[2]), myarray[2]) is 0>
<!--- the string in myarray[2] IS in uppercase --->
<cfelse>
<!--- it is NOT in uppercase --->
</cfif>
the above code compares the value of the second array element
converted
to uppercase to the original value of the second array
element. if the
result is 0, i.e. the uppercase and original strings are the
same, then
you know the original string is in uppercase.
if you are dealing with a single string (which is equivalent
to a
space-delimited list), then use appropriate list function to
get
required list element, i.e. listfirst(), listlast(),
listgetat()...
<cfif compare(ucase(listlast(mylist, " ")),
listlast(mylist, " ")) is 0>
<!--- the last element in the list IS in uppercase --->
<cfelse>
<!--- it is NOT in uppercase --->
</cfif>
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
Need some help with the Table Function Operator
I'm on OWB 10gR2 for Sun/Solaris 10 going against some 10gR2 DB's...
I've been searching up and down trying to figure out how to make OWB use a Table Function (TF) which will JOIN with another table; allowing a column of the joined table to be a parameter in to the TF. I can't seem to get it to work. I'm able to get this to work in regular SQL, though. Here's the setup:
-- Source Table:
DROP TABLE "ZZZ_ROOM_MASTER_EX";
CREATE TABLE "ZZZ_ROOM_MASTER_EX"
( "ID" NUMBER(8,0),
"ROOM_NUMBER" VARCHAR2(200),
"FEATURES" VARCHAR2(4000)
-- Example Data:
Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (1,'Room 1',null);
Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (2,'Room 2',null);
Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (3,'Room 3','1,1;2,3;');
Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (4,'Room 4','5,2;5,4;');
Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (5,'Room 5',' ');
-- Destination Table:
DROP TABLE "ZZZ_ROOM_FEATURES_EX";
CREATE TABLE "ZZZ_ROOM_FEATURES_EX"
( "ROOM_NUMBER" VARCHAR2(200),
"FEATUREID" NUMBER(8,0),
"QUANTITY" NUMBER(8,0)
-- Types for output table:
CREATE OR REPLACE TYPE FK_Row_EX AS OBJECT
ID NUMBER(8,0),
QUANTITY NUMBER(8,0)
CREATE OR REPLACE TYPE FK_Table_EX AS TABLE OF FK_Row_EX;
-- Package Dec:
CREATE OR REPLACE
PACKAGE ZZZ_SANDBOX_EX IS
FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX;
END ZZZ_SANDBOX_EX;
-- Package Body:
CREATE OR REPLACE
PACKAGE BODY ZZZ_SANDBOX_EX IS
FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX
AS
RETURN_VALUE FK_Table_EX := FK_Table_EX();
i NUMBER(8,0) := 0;
BEGIN
-- TODO: Put some real code in here that will actually read the
-- input string, parse it out, and put data in to RETURN_VALUE
WHILE(i < 3) LOOP
RETURN_VALUE.EXTEND;
RETURN_VALUE(RETURN_VALUE.LAST) := FK_Row_EX(4, 5);
i := i + 1;
END LOOP;
RETURN RETURN_VALUE;
END UNFK;
END ZZZ_SANDBOX_EX;
I've got a source system built by lazy DBA's and app developers who decided to store foreign keys for many-to-many relationships as delimited structures in driving tables. I need to build a generic table function to parse this data and return it as an actual table. In my example code, I don't actually have the parsing part written yet (I need to see how many different formats the source system uses first) so I just threw in some stub code to generate a few rows of 4's and 5's to return.
I can get the data from my source table to my destination table using the following SQL statement:
-- from source table joined with table function
INSERT INTO ZZZ_ROOM_FEATURES_EX(
ROOM_NUMBER,
FEATUREID,
QUANTITY)
SELECT
ZZZ_ROOM_MASTER_EX.ROOM_NUMBER,
UNFK.ID,
UNFK.QUANTITY
FROM
ZZZ_ROOM_MASTER_EX,
TABLE(ZZZ_SANDBOX_EX.UNFK(ZZZ_ROOM_MASTER_EX.FEATURES)) UNFK
Now, the big question is--how do I do this from OWB? I've tried several different variations of my function and settings in OWB to see if I can build a single SELECT statement which joins a regular table with a table function--but none of them seem to work, I end up getting SQL generated that won't compile because it doesn't see the source table right:
INSERT
/*+ APPEND PARALLEL("ZZZ_ROOM_FEATURES_EX") */
INTO
"ZZZ_ROOM_FEATURES_EX"
("ROOM_NUMBER",
"FEATUREID",
"QUANTITY")
(SELECT
"ZZZ_ROOM_MASTER_EX"."ROOM_NUMBER" "ROOM_NUMBER",
"INGRP2"."ID" "ID_1",
"INGRP2"."QUANTITY" "QUANTITY"
FROM
(SELECT
"UNFK"."ID" "ID",
"UNFK"."QUANTITY" "QUANTITY"
FROM
TABLE ( "ZZZ_SANDBOX_EX"."UNFK2" ("ZZZ_ROOM_MASTER_EX"."FEATURES")) "UNFK") "INGRP2",
"ZZZ_ROOM_MASTER_EX" "ZZZ_ROOM_MASTER_EX"
As you can see, it's trying to create a sub-query in the FROM clause--causing it to just ask for "ZZZ_ROOM_MASTER_EX"."FEATURES" as an input--which isn't available because it's outside of the sub-query!
Is this some kind of bug with the code generator or am I doing something seriously wrong here? Any help will be greatly appreciated!Hello Everybody!
Thank you for all your response!
I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
I had created a Z table with the following fields :
ZADS :
MANDT
VKORG
ABGRU.
I had written a select query as below :
I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table
select vkorg abgru from ZADS into it_rej.
Earlier :
IT_REJ is a Work area:
DATA : BEGIN OF IT_REJ,
VKORG TYPE VBAK-VKORG,
ABGRU TYPE VBAP-ABGRU,
END OF IT_REJ.
Now :
DATA : BEGIN OF IT_REJ occurs 0,
VKORG TYPE VBAK-VKORG,
ABGRU TYPE VBAP-ABGRU,
END OF IT_REJ.
I guess this will fix the issue correct?
PLease suggest!
Regards,
Developer. -
Need some help with a counting function
Hello,
I use a simple sheet to organize the timetable of my patients. Now I'd like to count how many different patients I attend, without counting a patient twice if I attend him twice a week for example. My sheet looks like this:
Mon
Tue
Wed
Thu
John
Steve
John
Wesley
Mary
Harry
Deborah
Peter
Arnold
Carol
Chris
Mary
Sarah
Karen
Karen
Carol
Larry
Peter
So the answer would be 13, because I attend 13 different patients a week. Fields in blank should no be counted, the cell contend changes frequently.
A friend of mine tried to help me with a countif function but it didn't work out for me, it would count the fields left blank too.
Any idea?
Thanks, gabrielHi Gabriel,
Here's another, more generalized, approach that doesn't need adjusting for maximum number of visits/week at the cost of just a few more formulas. But only two tables!
Formula in A2 and copied down:
=ROUNDUP((ROW(cell)−1)÷$B$27,0)
Formula in B2 and copied down:
=IF(MOD(ROW(cell)−1,$B$27)=0,$B$27,MOD(ROW(cell)−1,$B$27))
The formula in C2 and copied down:
=OFFSET(Schedule::$A$1,0,B−1)
The formula in D2 and copied down:
=IFERROR(OFFSET(Schedule::$A$1,A2,B2−1,rows,columns),"")
The formula in E2 and copied down:
=IF(AND(D2≠0,LEN(D2)>0),COUNTIF($D$1:D2,D2),"")
The formula in F2 and copied down:
=IFERROR(IF(E=1,1,""),"")
The formula in F27: =SUM(F)
The value in B27 is 4, the number of day columns in the Schedule table. You would change that if you increase or decrease the number of days on which you see patients.
Column C is cosmetic, not needed in the calculation.
The error triangle means all of the cells in the Schedule table are already accounted for in the rows above.
Probably more compact ways to do this but it gets the job done.
SG -
Need some help with a remove function
Design and code a program that will maintain a list of product names. Use a String type to represent the product name and an array of strings to implement the list. Your program must implement the following methods:
Add a product to the list
Remove a product from the list
Display then entire list
Find out if a particular product is on the list.
You need to create a command command loop with a menu() function. The program must continue asking for input until the user stops.
This is the assignment and this is what I have so far. I need some help writing the remove function.
Thanks
* Title: SimpleSearchableList.java
* Description: this example will show a reasonably efficient and
* simple algorithm for rearranging the value in an array
* in ascending order.
public class SimpleSearchableList {
private static String[] List = new String[25]; //These variables (field variables)
private static int Size; //are common to the entire class, but unavailable
//except to the methods of the class...
public static void main(String[] args)
String Cmd;
for(;;) {
Menu();
System.out.print("Command: ");
Cmd = SimpleIO.inputString();
if(Cmd.equals("Quit"))
break;
else if(Cmd.equals("Fill"))
FillList();
else if(Cmd.equals("Search"))
SearchList();
else if(Cmd.equals("Show"))
ShowList();
else if(Cmd.equals("Remove"))
Remove();
//Tells you what you can do...
public static void Menu()
System.out.println("Choices..................................");
System.out.println("\tFill to Enter Product");
System.out.println("\tShow to Show Products");
System.out.println("\tSearch to Search for Product");
System.out.println("\tRemove a Product");
System.out.println("\tQuit");
System.out.println(".........................................");
//This method will allow the user to fill an array with values...
public static void FillList()
int Count;
System.out.println("Type Stop to Stop");
for(Count = 0 ; Count < List.length ; Count++)
System.out.print("Enter Product: ");
List[Count] = SimpleIO.inputString();
if(List[Count].equals("Stop"))
break;
Size = Count;
//This method will rearrange the values in the array so that
// go from smallest to largest (ascending) order...
public static void SearchList()
String KeyValue;
boolean NotFoundFlag;
int Z;
System.out.println("Enter Product Names Below, Stop To Quit");
while(true)
System.out.print("Enter: ");
KeyValue = SimpleIO.inputString();
if(KeyValue.equals("Stop")) //Note the use of a method for testing
break; // for equality...
NotFoundFlag = true; //We'll assume the negative
for(Z = 0 ; Z < Size ; Z++)
if(List[Z].equals(KeyValue)) {
NotFoundFlag = false; //If we fine the name, we'll reset the flag
System.out.println(List[Z] + " was found");
if(NotFoundFlag)
System.out.println(KeyValue + " was not found");
//This method will display the contents of the array...
public static void ShowList()
int Z;
for(Z = 0 ; Z < Size ; Z++)
System.out.println("Product " + (Z+1) + " = " + List[Z]);
public static void Remove()
}I need help removing a product from the arrayYes. So what's your problem?
"Doctor, I need help."
"What's wrong?"
"I need help!"
Great.
By the way, you can't remove anything from an array. You'll have to copy the remaining stuff into a new one, or maybe maintain a list of "empty" slots. Or null the slots and handle that. The first way will be the easiest though. -
Please help me with a CASE Statement:
- When ID = 15, 16, 17, 18 then "Bad"
- when ID = 19, then "Average"
- when ID = 21, then "Good"
- else "Null"
Thank you!!Well the 1st thing to do would be to correct my poor spelling... change Delault : to Default :
Don't know why you would get an error stating "The result of selection formula must be a boolean". It's working fine on my machine.
If your ID field is numbers stored text you have a couple different options...
1) Convert the ID to a number...
Select ToNumber({home.noone_ID})
2) Wrap the ID values in double quotes...
Case "15", "16", "17", "18" :
"BAD"
Even if this were your problem... the error should be something other than the boolean thing...
Jason -
Need help with user defined function
Hello SDN,
I need some help with a user-defined function. My source message contains multiple
generic records (1000 char string), and my target message is 1 header record,
then multiple generic records. See description of source and target messages below:
Source:
GenericRecordTable 1..unbounded
Row (1000 char string)
Target:
Field1 (char5)
Field2 (char5)
Field3 (char5)
IT_Data
GenericRecordTable 1..unbounded
Row (1000 char string)
Basically, what I need to do in my user defined funtion is to map the first record
in my source record to the 3 header fields, then map all of the rest of the records
(starting from line 2) into the GenericRecordTable.
Can someone please help me with the code for the user defined function(s) for this
mapping?
Thank you.hi,
Activities
1. To create a new user-defined function, in the data-flow editor, choose Create New Function (This
graphic is explained in the accompanying text), which is located on the lower left-hand side of the
screen. In the menu, choose Simple Function or Advanced Function.
2. In the window that appears, specify the attributes of the new function:
Name
Technical name of the function. The name is displayed in the function chooser and on the data-flow
object.
Description
Description of how the function is used.
Cache
Function type (see above)
Argument Count
In this table, you specify the number of input values the function can process, and name them. All
functions are of type String.
3. In the window that appears, you can create Java source code:
a. You can import Java packages to your methods from the Imports input field, by specifying them
separated by a comma or semi-colon:
You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since
all message mappings require these packages and therefore import them. You should be able to
access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the
package under Import. In other words, you do not have to import it as an archive into the Integration
Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the
SAP Logging Service (see also: Runtime Environment (Java-Mappings)).
In addition to the standard packages, you can also specify Java packages that you have imported as
archives and that are located in the same, or in an underlying software component version as the
message mapping.
b. Create your Java source text in the editor window or copy source text from another editor.
4. Confirm with Save and Close.
5. User-defined functions are limited to the message mapping in which you created the function. To
save the new function, save the message mapping.
6. To test the function, use the test environment.
The new function is now visible in the User-Defined function category. When you select this category,
a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the
function to the data-flow editor, choose the arrow next to the button and select from the list box
displayed.
http://help.sap.com/saphelp_nw04/helpdata/en/d9/718e40496f6f1de10000000a1550b0/content.htm
http://java.sun.com/j2se/1.5.0/docs/api/
/people/krishna.moorthyp/blog/2006/07/29/documentation-html-editor-in-xi
/people/sap.user72/blog/2006/02/06/xi-mapping-tool-exports
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
UDF -
http://help.sap.com/saphelp_nw04/helpdata/en/22/e127f28b572243b4324879c6bf05a0/content.htm
Regards -
Help with SMTP class function with authentication
My server is no longer supporting the php mail() functionality. I need to use SMTP class function with authentication in my php code and they suggested this to replace it: http://www.yrhostsupport.com/index.php?/Knowledgebase/Article/View/101/2/smtp-class-functi on-with-authentication-in-php-code
So I tried it, but can't get it to work. This is my test form:
<form method="post" action="forms/sendmail-test2.php" onsubmit="return checkEmail(this);">
<script type="text/javascript" language="JavaScript">
</script>
<fieldset><legend>Info</legend>
<label> Name </label>
<input type="text"
name="name" size="30" maxlength="40"/><br />
<label> <span class="redText">*</span> Email </label>
<input name="email" type="text" size="30" maxlength="40"/>
<br />
<label><span class="redText">*</span> Message </label>
<textarea cols="40" rows="5" name="message" type="text" /></textarea><br />
</fieldset>
<input type="reset" value="Reset" />
<input type=submit value="Submit Form" />
</fieldset>
</form>
This is sendmail-test2.php where the form goes. It won't send unless I comment out the first 10 lines.
<?php
include('Mail.php');
//$to = "[email protected]";
//$name = $_REQUEST['name'] ;
//$email = $_REQUEST['email'] ;
//$message = $_REQUEST['name'] ;
//$headers = "From: $email";
//$subject = " price quote";
//$fields = array();
//$fields{"name"} = "Name";
//$fields{"email"} = "Email";
//$fields{"message"} = "Message";
$recipients = '[email protected]'; //CHANGE
$headers['From'] = '[email protected]'; //CHANGE
$headers['To'] = '[email protected]'; //CHANGE
$headers['Subject'] = 'Test message';
$body = 'Test message';
// Define SMTP Parameters
$params['host'] = 'levy.dnsbox25.com';
$params['port'] = '25';
$params['auth'] = 'PLAIN';
$params['username'] = '[email protected]'; //CHANGE
$params['password'] = 'xxxxxx'; //CHANGE
/* The following option enables SMTP debugging and will print the SMTP
conversation to the page, it will only help with authentication issues. */
$params['debug'] = 'true';
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('smtp', $params);
// Print the parameters you are using to the page
foreach ($params as $p){
echo "$p<br />";
// Send the message
$mail_object->send($recipients, $headers, $body);
?>
It used to work fine when I used
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
But they said I can't use it any more. I'm good with HTML and CSS but I don't know much about php. Thanks for any help integrating a from into this new code!Thanks, bregent. I changed it to this and it sends, but nothing shows up in the body except "Test message". How would I "insert the form fields' 'email' and 'name' and 'message' in the body"?
<?php
include('Mail.php');
$to = "[email protected]";
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$message = $_REQUEST['name'] ;
//$headers = "From: $email";
$subject = " price quote";
$fields = array();
$fields{"name"} = "Name";
$fields{"email"} = "Email";
$fields{"message"} = "Message";
$recipients = '[email protected]'; //CHANGE
$headers['From'] = '[email protected]'; //CHANGE
$headers['To'] = '[email protected]'; //CHANGE
$headers['Subject'] = 'Test message';
$body = 'Test message';
$fields = array();
$fields{"name"} = "Name";
$fields{"email"} = "Email";
$fields{"message"} = "Message";
// Define SMTP Parameters
$params['host'] = 'levy.dnsbox25.com';
$params['port'] = '25';
$params['auth'] = 'PLAIN';
$params['username'] = '[email protected]'; //CHANGE
$params['password'] = xxx'; //CHANGE
/* The following option enables SMTP debugging and will print the SMTP
conversation to the page, it will only help with authentication issues. */
$params['debug'] = 'true';
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('smtp', $params);
// Print the parameters you are using to the page
foreach ($params as $p){
echo "$p<br />";
// Send the message
$mail_object->send($recipients, $headers, $body);
?> -
I am having problems with a SQL Function:
CREATE OR REPLACE FUNCTION GDRREPORTS.MONTHTOTALS
(BDate IN DATE)
RETURN INTEGER
AS
ShakeCount INTEGER
BEGIN
ShakeCount=(Select count (distinct b.patid),
to_char(gdrreports.To_Date_w_error (t.data), 'MON') BDay_month,
to_char(gdrreports.To_Date_w_error (t.data), 'YYYY') BDay_year
FROM CCI.a_patientlist p
Inner Join CCI.PATIENTEDUCATIONNOTE_SCN_216IL b on
b.patid=p.patid and b.tag=1789
Inner join CCI.BIRTHDATE_519 t on
t.patid=p.patid
where p.unit != 'TRAIN' and p.admtime>='01JAN2011'
and b.Data ='X'
and to_char(gdrreports.To_Date_w_error (t.data), 'YYYY')=to_char(Bdate, 'YYYY')
and to_char(gdrreports.To_Date_w_error (t.data), 'MON')=to_char(Bdate, 'MON'))
RETURN ShakeCount ;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END MONTHTOTALS;
Not exactly sure what's wrong with it.
Thank you.871359 wrote:
I am having problems with a SQL Function:
CREATE OR REPLACE FUNCTION GDRREPORTS.MONTHTOTALS
(BDate IN DATE)
RETURN INTEGER
AS
ShakeCount INTEGER
BEGIN
ShakeCount=(Select count (distinct b.patid),
to_char(gdrreports.To_Date_w_error (t.data), 'MON') BDay_month,
to_char(gdrreports.To_Date_w_error (t.data), 'YYYY') BDay_year
FROM CCI.a_patientlist p
Inner Join CCI.PATIENTEDUCATIONNOTE_SCN_216IL b on
b.patid=p.patid and b.tag=1789
Inner join CCI.BIRTHDATE_519 t on
t.patid=p.patid
where p.unit != 'TRAIN' and p.admtime>='01JAN2011'
and b.Data ='X'
and to_char(gdrreports.To_Date_w_error (t.data), 'YYYY')=to_char(Bdate, 'YYYY')
and to_char(gdrreports.To_Date_w_error (t.data), 'MON')=to_char(Bdate, 'MON'))
RETURN ShakeCount ;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END MONTHTOTALS;
Not exactly sure what's wrong with it.Without additional clues, we can't guess.
It would help if you used COPY & PASTE so we can see this reported problem too. -
Hi everyone, can someone please help me with a function to use here please. I have a nine digit number e,g (000046650 and 024063870). I would like to convert this to 4 digits before the comma and 5 digits after the comma. So it must be something like this (0000,46650 and 0240,63870). I thought I could easily do this with a ROUND function, but it doesn't work. Could somebody please help by telling me what I'm missing?
Thank you all for your help.Hi,
I must be missing something, but why don't you just divide by 10000 ?Scott@my11g SQL>with d as (
2 select 000046650 n from dual
3 union all
4 select 024063870 from dual
5 )
6 select n/10000 from d ;
N/10000
4.665
2406.387You can then use a to_char with fmt to format it with zero padding :Scott@my11g SQL>with d as (
2 select 000046650 n from dual
3 union all
4 select 024063870 from dual
5 )
6 select to_char(n/10000,'0000.00000') nn from d ;
NN
0004.66500
2406.38700 -
Help with multiple case statements
Hello,
I am new to BO. I am on XI 3.0. SQL 2005. In Designer, I am trying to create a measure in a financial universe that would end up being multiple case statements within one select. This is what I tried to do, but it doesn't work with the two case statements. Can I use an ELSE leading into the second CASE WHEN somehow? How can I accomplish this? Sorry for my ignorance!
CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 12 THEN dbo.ClientBudgetMonth.Stage1Sales END
CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month = 11 THEN dbo.ClientBudgetMonth.Stage1Sales END
Any Suggestions?
Thanks,
HollyHolly,
I don't know enough about your data or requirement to provide a solution, however, the construct that you post will not work because it causes you to build an object with multiple case statements when only one case statement per object is permitted. From what I see in your code I would be inclined to combine the two statements into one as such:
CASE WHEN dbo.ClientBudgetYear.DateStage1Approved > 01/01/1900 AND dbo.ClientBudgetMonth.Month in (11,12) THEN dbo.ClientBudgetMonth.Stage1Sales else null END
Thanks,
John -
Hello,
I am a novice with respect to spreadsheet functions and needed a a cashflow spreadsheet. I found this one (Download Cashflow Tracker for Numbers (iWork 09).) which is perfect but the author, I suspect, has not updated his website in years. I attempted contacting him and received no reply.
I receive an error with the following function:
=SUMIF(Table 1::$Month, COLUMN()−1, $Cost)
This occurs when I enter a date in the expense or income table. Entering the date is required to make the spreadsheet work but when I do I receive an error that a number is expected when a date is entered.
Can anyone give me some advice? I would really like to use this spreadsheet.
Thanks!
SteveWhat I have found the simplest approach has been:
1. Cut the Summary by Category table and paste it into the Transaction sheet, giving something like this (after rearranging renaming, etc, as desired):
2. Make sure the links between the two table are still working, make their appearance the way you like, then duplicate that sheet for the other months. Each sheet will then have its separate set of two interconnected tables.
3. Copy paste one of the Summary tables back to the Summary sheet, rename it as desired, and set it up with formulas referencing the tables in the monthly sheets you have set up, something like this:
If you want your summary by month you would set up 12 columns in the main 'Summary by Category' table, with each column referencing a different sheet. Your Budget could be a row above each Actual figure, if you like, with difference in a row below that.
This approach keeps the formulas simple and avoids having to set up fancy SUMIFS extracting data for each month from one big Transaction table.
SG -
Hello!!
Can anyone please help me with the decode statement
Table 1 Table2 Table3
Id Id Code
Volume Code
For each of the codes in Table3 I need to find the corresponding Volume. Can I use decode in the select statement to this,
Eg Code Volume
ABC 20
XYZ 10 etc etc.
Thankyou all in advance.Your table structure is a little unclear from your post. I am assuming that what you posted was:
Table 1
Id
Table2
Id
Code
Table3
Volume
Code You can use decode if there are only a few values for table3. For example,
SELECT table2.code,
DECODE(table2.code,'ABC',10,'XYZ',20,'UNKNOWN') volume
FROM table2
or even
SELECT code,DECODE(code,null,'NONE',
(SELECT volume FROM table3 where code=table2.code)) volume
FROM table2However, the first will break, or at least be incorrect, if anyone adds a new code/volume pair, and is tedious if you have more than a few values. The second will likely be pretty slow if there are a large number of records in table3. The best solution would be to use a simple join rather than decode. Something like:
SELECT table1.id, table2.code, table3.volume
FROM table1, table2, table3
WHERE table1.id = table2.id and
table2.code = table3.code
Maybe you are looking for
-
My MacBook air is hacked.
Hi ! I need some help. From someone with really great knowledge and connections. (but I'm going to write a bad question (maybe) because I'm fed up with idiotic know-how insides like "how to write a good question". a question is always good, mind you.
-
How do i re install the old iOS5 to my iphone 3g
I recently updated my iphone 3gs to the iOS6, since then I have had no signal what so ever, and the phone has been lagging and very slow and unresponsive to use, I took it into the vodaphone store and they told me to reinstall the old iOS5 as the ne
-
What's the best mac book to have for someone who is going to study for the next four years
Best mac book to use for study etc essays
-
-Bug?- IDv2 Track No. gets removed on m
Hi, I just updated my Zen Micro Software via AutoUpdate (Everything went through correctly afaik) and now I have the problem that when I convert mp3s on my computer, MediaSource Converter deletes the tracknumber of each file. Then, when I re-add it m
-
Dear all, I have material say ABC-1 in X Production Plant and extented this material in Y depot.In production plant this material has routing and bom and in depot it don't have.I have updated material master by CA97 in production plant.Now i want to