How to execute a pl/sql conditional
Hello
I have the following situation:
before the user clicks on a button to run a pl/sql code, I need to ask the user on the confirmation. But the confirmation message may appear according to with the return of a pl/sql function. How can I do?
Thank you
One solution might be:
Put the submission as defined by the dynamic action button.
Create a dynamic action on click of a button
Define a JavaScript expression parseInt ($v (ITEM)) > 15
(I expect you'd know how to get the value of the total used in the above expression)
For real action
1: confirm action
2: submit
Action false
1 submit
Tags: Database
Similar Questions
-
How to execute the pl/sql block from a file
Hi all
can someone tell me how to execute a pl/sql block to a file.it does contain no procedures.it is of the form
-Start
-says
-end;
ThanxOk.. If the time points? :)
See you soon!
Bobin -
Interactive report: how to execute a PL/SQL on a button click each folder
Hello
I've created an interactive report. I would like to run a PL/SQL based on a click of button available by registration type. For example, the report includes ADDRESS and CLIENT_ID columns. When the user clicks on the button in the document, using PL/SQL, I want to update/insert into another table with the details available in the present recording as above 2 mentioned columns. How can I achieve this? Help, please.
Thank you and best regards,
-Anand
Hi Anand,
Change your dynamic action
Topic Page to submit-> P12_ACODE
Check the screenshot of apex.oracle.com
Kind regards
Jitendra
-
How to execute the pl/sql shell script
Hi Experts
I need to be able to call a pl/sql procedure shell script
Linux and 11g
I am new to java and followed the solution below
The appeal of OS in Plsql commands
After following the solution on top of link
Declare
x Varchar2 (2000);
Begin
x: = OSCommand_Run ('ls - the);
-print x;
DBMS_OUTPUT. Put_line (x);
End;
/
give me output of 0 but the command is not executed.
What must be changed or is there another solution?
Thank you
ArchanaSee if that helps...
[http://www.oracle-base.com/articles/8i/ShellCommandsFromPLSQL.php]
-
How to execute a pl/sql stored procedure as a concurrent program
Hi all
I created a PURGE_DEAL_REQUESTS package. It contains a QPR_DELETE_CANCELLED_REQUESTS procedure. I want to execute this stored procedure as simultaneous program in suite ebs...
Can someone tell me how to perform this procedure as a simultaneous program (in the suite of BSE)...?
Thank you
Swathi.Switch to the responsibility at the request of the group to which you assigned the request of Conurrent.
Navigate to view > query > submit a new request to the toolbar.Kind regards
Ousseni -
How to execute a stored procedure on Sybase with SQL Developer
We have accessed Sybase 15 with SQL developer.
We can see the data in the table, if we do not, run the stored procedure (for instance sp_who) developed on Sybase.
Could you tell me how we execute the stored procedure on Sybase with SQL Developer Sybase?
Thank you
Shige
We will not intended to be a Sybase ASE customer.
But
-
do not execute bulk pl/sql
Hi all, under the sql statement runs successfully in normal block, but it is not executed in the pl/sql block
CURSOR final_cursor IS SELECT ECONTACT. EMPLID, ECONTACT. CONTACT_NAME, DECODE (ECONTACT. COUNTRIES, 'USA', '+ 1', 'POSSIBLE', '+ 1', 'CHN', '+' 86) | ECONTACT. PHONE PHONE_NUMBER, (SELECT PHONE FROM PS_PERSONAL_PHONE WHERE EMPLID = ECONTACT. EMPLID AND PHONE_TYPE = "HOME") ALT_NUMBER, DECODE (ECONTACT. PRIMARY_CONTACT, 'Y', 'Yes', ' n 'No') PRIMARY_CONTACT, "Yes", EMERGENCY_CNT, NULL EMAIL, ECONTACT, SF_EMPL_DRIVER_TBL SF WHERE SF PS_EMERGENCY_CNTCT NULL OPERATION. EMPLID = ECONTACT. EMPLID AND SF. EMPLID = v_sf_econtact_cursor. EMPLID ORDER BY SF. EMPLID;
giving below error, then you need otherwise.
Please suggest me.
Sorry, I forgot. PLS-00103: encountered the symbol "SELECT" when expecting one of the following numbers: (- + mod not null not others avg County normal c means: How do we execute a query sql in Toad, means block sql. )
Thank you
Music
excellent, I did exactly as per your suggestion, it works. Thank you.
SELECT ECONTACT. EMPLID,
ECONTACT. CONTACT_NAME,
DECODE (SF. COUNTRIES, 'USA', '+ 1', 'POSSIBLE', '+ 1', 'CHN', '+ 86', "). ECONTACT. PHONE PHONE_NUMBER,
PF. PHONE ALT_NUMBER,
DECODE (ECONTACT. PRIMARY_CONTACT, 'Y', 'Yes', ' n 'No') PRIMARY_CONTACT,.
'Yes' EMERGENCY_CNT,
SEND NULL,
OPERATION ZERO
OF PS_EMERGENCY_CNTCT ECONTACT,.
SF SF_EMPL_DRIVER_TBL,
PS_PERSONAL_PHONE PF
WHERE SF. EMPLID = ECONTACT. EMPLID
AND SF. EMPLID = '1917026'
AND PF. EMPLID (+) IS ECONTACT. EMPLID
AND PF. PHONE_TYPE (+) = 'HOME'
ORDER OF SF. EMPLID
-
How do we improve the SQL Loader for EBS?
Hi all
We would like to use some of the new features like the FILLING and the EXPRESSION in the 10g version of SQL * Loader with the concurrent Manager.
EBS 11i version SQL Loader is 8i.
How do we improve the SQL Loader for EBS?
Thanks in advance!If you are referring to executable files under ORACLE_HOME 8.0.6, then it cannot be migrated to 10 g / 11 g - upgrade developer 6i with Oracle Applications 11i [125767.1 ID]
For executable files of database, please visit:
Interoperability Notes Oracle EBS 11i with Oracle Database 11 g 2 (11.2.0).) [ID 881505.1]
Oracle Applications Release 11i with Oracle 10 g Release 2 (10.2.0) [ID 362203.1]Thank you
Hussein -
How to execute a stored procedure that returns a cursor?
How to execute a stored procedure that returns a cursor?
Follow the code:
CREATE OR REPLACE PROCEDURE stp_cashin_grupo
(p_func in VARCHAR
p_cod_grup in full
p_des_grup in VARCHAR
p_logi in VARCHAR
p_curs_rset ON infoc.pck_cashin_grupo.curs_rset
)
IS
BEGIN
If p_func = "1" then
OPEN FOR P_curs_rset
Select
cod_grup
des_grup
dat_manu_grup
des_logi_manu
of infoc.tbl_cashin_grupo
order of des_grup;
end if;
END stp_cashin_grupo;
and packaging:
CREATE or REPLACE PACKAGE pck_cashin_grupo
AS
TYPE curs_rset IS REF CURSOR;
END pck_cashin_grupo;
My question is how to execute in sql plus?
Stp_cashin_grupo EXEC ('1', 0, ", '465990', my doubt is how to move the cursor as return)
Thank youIt is described in the manual
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14357/CH5.htm#sthref1122
-
How to install utilities PL/SQL Developer SQL v1.6.0 in the database
in fact I'm looking
HTTP_UTIL_PKG
CSV_UTIL_PKG
to download excel file in Oracle 11 g r2 11.2.0.1.0 feature
Downloaded from https://code.google.com/p/plsql-utils/downloads/detail?name=plsql-utils-v160.zip & can = 2 & q =
How to install utilities PL/SQL Developer SQL v1.6.0 in the database
If we install in sys or particular schema in which I need to use
and how to run the script
ReemaPuri wrote:
in fact I'm looking
HTTP_UTIL_PKG
CSV_UTIL_PKG
to download excel file in Oracle 11 g r2 11.2.0.1.0 feature
Downloaded from https://code.google.com/p/plsql-utils/downloads/detail?name=plsql-utils-v160.zip&can=2&q=
then download the zip file and then extract the contents
Both are contained in it.
Then add them to the schema of your choice.
-
execute the dynamic sql statement
Hi all
CREATE TABLE XX_OFFICE_USER_IMP ( ID NUMBER, OFFICE VARCHAR2(10 BYTE), USER_NAME VARCHAR2(10 BYTE), BANK_ACCOUNT_ID NUMBER, TRANSFERED NUMBER )
Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (421,'0000','F0000',10029,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (422,'0000','F0000',10031,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (423,'0000','F0000',10033,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (424,'0000','F0000',10036,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (425,'0000','F0000',10037,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (426,'0000','F0000',10039,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (427,'0000','F0000',10041,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (428,'0000','F0000',10046,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (429,'0000','F0000',10048,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (430,'0000','F0000',10067,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (431,'0000','F0000',10072,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (432,'0000','F0000',10087,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (433,'0000','F0000',10092,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (434,'0000','F0000',10008,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (435,'0000','F0000',10012,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (436,'0000','F0000',10013,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (437,'0000','F0000',10014,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (438,'0000','F0000',10017,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (439,'0000','F0000',10019,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (440,'0000','F0000',10024,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (441,'0000','F0000',10025,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (442,'0000','F0000',10001,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (443,'0000','F0000',10002,null);
CREATE TABLE XXBG_CASIER_CASH ( CASHIER VARCHAR2(32 BYTE), BANK_ACCOUNT_ID NUMBER(38,0) )
After execute the PL/SQL block I get the message:declare v_exe_grant varchar2(32767 char); begin for i in (select * from xx_office_user_imp where office = '0000') loop insert into XXBG_CASIER_CASH values (i.user_name, i.bank_account_id); v_exe_grant := 'create user ' || i.user_name || ' identified by ' || i.user_name || ';' || 'GRANT create session to ' || i.user_name || ';' || 'GRANT select on apps.XXBG_CE_STATEMENT_HEADERS_CASH to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.FND_USER TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.dFND_DESCR_FLEX_COL_USAGE_TL TO ' || i.user_name || ';' || 'GRANT select on apps.fnd_descr_flex_column_usages to ' || i.user_name || ';' || 'GRANT select on apps.fnd_descriptive_flexs to ' || i.user_name || ';' || 'GRANT select on apps.fnd_descriptive_flexs_tl to ' || i.user_name || ';' || 'GRANT select on ce.ce_statement_headers to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.fnd_doc_sequence_assignments TO ' || i.user_name || ';' || 'GRANT SELECT ON CE.CE_STATEMENT_HEADERS_S TO ' || i.user_name || ';' || 'GRANT EXECUTE ON APPS.XXBG_GET_NEXTVAL TO ' || i.user_name || ';' || 'GRANT SELECT ON CE.CE_STATEMENT_LINES TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_CE_STATEMENT_LINES TO ' || i.user_name || ';' || 'GRANT select on apps.CE_BANK_ACCOUNTS to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.CE_BANK_BRANCHES_V TO ' || i.user_name || ';' || 'GRANT SELECT ON CE.XXBG_CASIER_CASH TO ' || i.user_name || ';' || 'GRANT EXECUTE ON APPS.XXBG_ST TO ' || i.user_name || ';' || 'GRANT select on ce.xxbg_ce_statement_lines_detail to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.ce_transaction_codes TO ' || i.user_name || ';' || 'GRANT select on ce.ce_statement_lines_s to ' || i.user_name || ';' || 'GRANT SELECT ON CE.XXBG_CE_STATEMENT_LINES_DET_SQ TO ' || i.user_name || ';' || 'GRANT select on apps.xx_pko_lines to ' || i.user_name || ';' || 'GRANT SELECT ON apps.xx_rko_lines TO ' || i.user_name || ';' || 'GRANT select on apps.XX_INVOICE_RELATIONS_CASH to ' || i.user_name || ';' || 'GRANT select on APPS.PO_VENDOR_SITES_ALL to ' || i.user_name || ';' || 'GRANT select on ap.AP_INVOICE_LINES_INTERFACE_S to ' || i.user_name || ';' || 'GRANT select on ap.AP_INVOICE_LINES_INTERFACE to ' || i.user_name || ';' || 'GRANT select on APPS.ap_distribution_set_lines_all to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_INVOICES_INTERFACE_S TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_INVOICES_INTERFACE TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_DISTRIBUTION_SETS_ALL TO ' || i.user_name || ';' || 'GRANT select on apps.ce_lookups to ' || i.user_name || ';' || 'GRANT select on ar.HZ_CUST_SITE_USES_ALL to ' || i.user_name || ';' || 'GRANT select on ar.HZ_LOCATIONS to ' || i.user_name || ';' || 'GRANT select on ar.HZ_PARTIES to ' || i.user_name || ';' || 'GRANT select on ar.HZ_PARTY_SITES to ' || i.user_name || ';' || 'GRANT SELECT ON AR.HZ_CUST_ACCT_SITES_ALL TO ' || i.user_name || ';' || 'GRANT SELECT ON AR.HZ_CUST_ACCOUNTS TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_CLAIMS_V TO ' || i.user_name || ';' || 'GRANT select on apps.xxbg_insis_agents_v to ' || i.user_name || ';' || 'GRANT select on ce.xxbg_cash_doc_types to ' || i.user_name || ';' || 'GRANT select on AP.AP_BANK_ACCOUNTS_ALL to ' || i.user_name || ';' || 'GRANT SELECT ON AP.AP_BANK_BRANCHES TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.FND_DESCR_FLEX_CONTEXTS TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.FND_DESCR_FLEX_CONTEXTS_TL TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_SUPPLIERS to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.per_employees_x TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.fnd_doc_seq_categories_ap_v TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_LC_INVOICE_TYPES_V to ' || i.user_name || ';' || 'GRANT SELECT ON ce.xxbg_ce_statement_lines_sq to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_STATEMENT_HEADERS_CASH to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_INSIS_POLICY_V TO ' || i.user_name || ';' || 'GRANT insert ON ce.ce_statement_lines to ' || i.user_name || ';' || 'GRANT INSERT ON CE.XXBG_CE_STATEMENT_LINES_DETAIL TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.AP_INVOICES_INTERFACE TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.AP_INVOICE_LINES_INTERFACE TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.XX_RKO_LINES TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.XX_PKO_LINES TO ' || i.user_name || ';' || 'GRANT delete on ce.xxbg_ce_statement_lines_detail to ' || i.user_name || ';' || 'GRANT update on ce.XXBG_CE_STATEMENT_LINES_DETAIL to ' || i.user_name || ';' || 'GRANT DELETE ON CE.CE_STATEMENT_LINES TO ' || i.user_name || ';' || 'GRANT INSERT ON CE.CE_STATEMENT_HEADERS TO ' || i.user_name || ';' || 'GRANT update on CE.CE_STATEMENT_HEADERS to ' || i.user_name || ';' || 'GRANT update on ce.CE_STATEMENT_LINES to ' || i.user_name || ';' || 'GRANT select on apps.XX_AGENTS_NO_V to ' || i.user_name || ';' ; execute immediate v_exe_grant; update xx_office_user_imp set transfered = 1 where id = i.id ; v_exe_grant := ''; end loop; end; /
Any ideas? I think I call correct immediate execution.Error report: ORA-00911: invalid character ORA-06512: at line 79 00911. 00000 - "invalid character" *Cause: identifiers may not start with any ASCII character other than letters and numbers. $#_ are also allowed after the first character. Identifiers enclosed by doublequotes may contain any character other than a doublequote. Alternative quotes (q'#...#') cannot use spaces, tabs, or carriage returns as delimiters. For all other contexts, consult the SQL Language Reference Manual. *Action:
DB version: 11g
Unfortunately I can't provide you the sql code of the other tables to create their... Maybe you should try without all budgets... :)
Thanks in advance,
Bahchevanov.
Edited by: bahchevanov on 11 October 2012 06:14Bahchevanov wrote:
Any ideas?Sure. EXECUTE IMMEDIATE executes a unique statement when you try to run the job. So use:
execute immediate 'create user ' || i.user_name || ' identified by ' || i.user_name; execute immediate 'GRANT create session to ' || i.user_name; execute immediate 'GRANT select on apps.XXBG_CE_STATEMENT_HEADERS_CASH to ' || i.user_name; . . .
SY.
-
How can I write a sql with a Union.
How can I write a sql with a Union.
Select emp_name, emp_no, emp_sal of the emp
If show_Less_100000 = "Yes" then emp_sal < 100000 (all values less than 100000)
otherwise the full list.
Thank you
Harsha
Published by: taty on July 31, 2012 11:28SQL> variable show_Less_100000 varchar2(3) SQL> exec :show_Less_100000 := 'Yes'; PL/SQL procedure successfully completed. SQL> select ename, 2 empno, 3 sal 4 from emp 5 where ( 6 :show_Less_100000 = 'Yes' 7 and 8 sal < 2000 9 ) 10 or nvl(:show_Less_100000,'No') != 'Yes' 11 / ENAME EMPNO SAL ---------- ---------- ---------- SMITH 7369 800 ALLEN 7499 1600 WARD 7521 1250 MARTIN 7654 1250 TURNER 7844 1500 ADAMS 7876 1100 JAMES 7900 950 MILLER 7934 1300 8 rows selected. SQL> exec :show_Less_100000 := 'All'; PL/SQL procedure successfully completed. SQL> select ename, 2 empno, 3 sal 4 from emp 5 where ( 6 :show_Less_100000 = 'Yes' 7 and 8 sal < 3000 9 ) 10 or nvl(:show_Less_100000,'No') != 'Yes' 11 / ENAME EMPNO SAL ---------- ---------- ---------- SMITH 7369 800 ALLEN 7499 1600 WARD 7521 1250 JONES 7566 2975 MARTIN 7654 1250 BLAKE 7698 2850 CLARK 7782 2450 SCOTT 7788 3000 KING 7839 5000 TURNER 7844 1500 ADAMS 7876 1100 ENAME EMPNO SAL ---------- ---------- ---------- JAMES 7900 950 FORD 7902 3000 MILLER 7934 1300 14 rows selected. SQL>
SY.
-
How to execute each block in a canvas close while that select the tab?
Hi all
How to execute each block in a close canvas by selecting a tab? I mean when I select a specific tab in a canvas tab that records should run. How can I configure this?
ArifArif,
Make sure that the correct block name is used in the GO_BLOCK statement. As directed by your post, you try to navigate to USERDELETION block when the tab page is USER_CREATION_LIST. Modify the code to
IF GET_CANVAS_PROPERTY('CAN_SUPERVISOR', TOPMOST_TAB_PAGE) = 'USER_CREATION_LIST' THEN go_block('USERCREATION'); execute_query; ELSIF GET_CANVAS_PROPERTY('CAN_SUPERVISOR', TOPMOST_TAB_PAGE) = 'USER_DELETION_LIST' THEN go_block('USERDELETION'); execute_query; END IF;
Kind regards
Manu.
-
How to execute the method of dialogue of the handler of a button?
I created my first dialog of the samples, but I can't find how to execute a method in my handler of a button dialog box. Can someone tell me please in the right direction?
function CreateDialog()
{
this.windowRef = null;
}
CreateDialog.prototype.run = function()
{
.. .floating a lot of vars
Create a palette type window.
var win = new window ('dialogue', 'Spray generator Element', [iTop ILeft then, iWidth, ILeft iTop then + iHauteur]); Bounds = [left, top, right, bottom]
this.windowRef = win;
Add a frame to the content.
win.btnPanel = win.add ("panel", [iPadding, iPadding, iWidth-iPadding, iHauteur-iPadding], "");
... Add a bunch of other things...
win.btnAdd = win.btnPanel.add ('button', [win.btnRemove.bounds.left - iPadding - iButtonWidth, win.lstImages.bounds.bottom, + iSmPadding, win.btnRemove.bounds.left - iPadding, win.lstImages.bounds.bottom + iSmPadding + iTextHeight], "add");
win.btnAdd.onClick = function() {}
TODO implement this
var f is File.openDialog ("open a file");.
win.lstImages.add ("item", f.displayName);
This. EnableControls(); <-problem is on this line here!
};
This. EnableControls(); <-this works
Display the window
Win.Show ();
Returns true;
}
CreateDialog.prototype.EnableControls = function () {}
var result = true;
result = result & & (this.windowRef.ddlPaths.selection! = "");
result = result & & (this.windowRef.lstImages.items.length > 0);
this.windowRef.btnOK.enabled = result;
}I posted a response to this here: http://ps-scripts.com/bb/viewtopic.php?t=2889
X
-
How to divide the resultset SQL based on the data in the form of scenarios?
Hello
I need to develop a query that should be divided into scenarios
Ex:
Scenario 1: If a product is sold to the United States and charged in the United Kingdom
Scenario 2: If a product is sold to the United Kingdom and charged in the United States
Scenario 3: If a product is sold and invoiced to the United States
Scenario 4: If a product is sold and invoiced to the United Kingdom
Based on 1 how to divide and provide SQL result to users based on the scenarios?
Ex: Result should show all the data, saying that the result set is in scenario 1, etc..,.
Please advice
Thank you
user12048986Hello
You can use an expression BOX to classify each line:
CASE sold_country || ' ' || billed_country WHEN 'US UK' THEN 1 WHEN 'UK US' THEN 2 WHEN 'US US' THEN 3 WHEN 'UK UK' THEN 4 END AS scenario_num
If sold_country or billed_country is anything except 'UK' or 'US', then the above expression returns null.
I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data.
Maybe you are looking for
-
I can't figure out what I need. My PSC 2200 has a version of Labview RT 8.5.1 and fieldpoint 6.0.1. I need to be at least RT 10.0 Labview and fieldpoint 6.0.7 because I do Ethernet IP. I don't know that anything more recent that it will work as well.
-
Original title: Dvd rom problem Am running windows XP. DVD - rom and DVD - rw read previously written DVDs and CDs but will not read a blank cd or dvd in the drive. Any help out there?
-
The desktop icons back to the generic icon of IE
I use Vista Home Premium on a new computer. When to create internet related shortcuts (e.g. Yahoo) I get a generic IE icon 'E '. After changing by another icon, so that they don't look alike, on reboot they come back to the generic 'E '. When I cl
-
removed false process in the Task Manager
I accidentally deleted the process explore on my computer so now I have no task bar and no icons on my desktop. How can I fix?
-
I would like Lettermail windows7 but ca don't function not I cest JHA of the error on the pc but I want to erase them sense forcing payer