Need help to write PHP if statement by comparing date
With the help of PHP/mySQL
have records of article with timestamp to insert into the column items.item_listed
want to show an image that says 'Point has expired", if the timestamp is more than 60 days ago.
Thanks for your help,
Jim Balthrop
change to test 10 days?
Jim, did you even look at the code?
$sixty_days = 60 * 24 * 60 * 60;
The code gives to think that 60 days * 24 hours a day * 60 minutes in an hour * is 60 seconds in a minute compared to the time variable. To change in 10 days, you would obviously change the code like this:
$sixty_days = 10 * 24 * 60 * 60;
Tags: Dreamweaver
Similar Questions
-
I need help to write a script that detects the first instance of a paragraph style and then change
I need help to write a script that detects the first instance of a paragraph style and then he goes to a different paragraph style. I don't necessarily need someone to write all this, by the biggest problem is to find how to find just the first instance of the paragraph style. Any help would be greatly appreciated, thank you!
Hello
then try this with your active doc:
....................
myDoc var = app.activeDocument;
mStyle var = myDoc.paragraphStyles.item ("PS_NameToFind"); change the name to paraStyle
var mStyle_1 = myDoc.paragraphStyles.item ("PS_NameToChange"); change the name to paraStyle
var mFrames = myDoc.pages.everyItem ().textFrames.everyItem () .getElements ();
app.findTextPreferences = null;
app.findTextPreferences.appliedParagraphStyle = mStyle;
for (var k = 0; k)< mframes.length;="">
{
currFound = mFrames [k] .findText ();
If (currFound.length > 0)
currFound [0] .paragraphs [0] .appliedParagraphStyle = mStyle_1;
}
app.findTextPreferences = null;
................
Rgds
-
Need help to write a sub query
Our environment - Oracle 10 g
Hi all
Need help to write a sub query to reach him here are examples of data using which iam trying to replace the value column in the table based on two other columns in the same table
Examples of data
ClaimNo flag LineNo Procedurecode
100 01 N MN4567
100 02 Y 7863
100 03 N MN8976
100 04 Y 9000
101 01 Y 8954
101 02 N MN6754
101 03 N MN7654
101 04 Y 8976
102 01 Y 1234
102 02 Y 2345
102 03 Y 3456
102 03 Y 4567
Each column of ClaimNo has several rows of data. But if column procedurecode for a claimNo starts with MN then all values associated with the claimno for the flag column should replace N
If the data must become like below
ClaimNo flag LineNo Procedurecode
100 01 N MN4567
100 02 N 7863
100 03 N MN8976
100 04 N 9000
101 01 N 8954
101 02 N MN6754
101 03 N MN7654
101 04 N 8976
102 01 Y 1234
102 02 Y 2345
102 03 Y 3456
102 03 Y 4567
Thank youSee the example:
with t as ( select 100 ClaimNo, '01' LineNo, 'N' Flag, 'MN4567' Procedurecode from dual union all select 100, '02', 'Y', '7863' from dual union all select 100, '03', 'N', 'MN8976' from dual union all select 100, '04', 'Y', '9000' from dual union all select 101, '01', 'Y', '8954' from dual union all select 101, '02', 'N', 'MN6754' from dual union all select 101, '03', 'N', 'MN7654' from dual union all select 101, '04', 'Y', '8976' from dual union all select 102, '01', 'Y', '1234' from dual union all select 102, '02', 'Y', '2345' from dual union all select 102, '03', 'Y', '3456' from dual union all select 102, '03', 'Y', '4567' from dual ) select claimno, lineno, flag, case when count(decode(substr(procedurecode,1,2),'MN',1)) over(partition by claimno)>0 then 'N' else flag end new_flag, procedurecode from t
Kind regards
Sayan M. -
Need help to set a DELETE statement.
I have a table that contains the records of files. Files come in a bouquet each week. So, we need to delete records from a table to the corresponding fields and load the table with up-to-date data.
In doing so, the DELETE statement takes a long time. Need help with this setting.
Here are the details.
(1) total number of records in the table: 23 million records.
(2) approximate records deleted each time: 500 K to 1.5 million.
(3) table is partitioned on a PERIOD key. That is, each partition will have the data for a given period.
(4) table is not indexed
(5) removal occurs on a combination of 2 fields (PERIOD + BATCH).
Here is the query and the plan:
===========================================================
SQL > EXPLAIN PLAN SET STATEMENT_ID = 'TSH' FOR
2 REMOVE / * + PARALLEL(DETAIL_UNKNOWN,10) * / u DETAIL_UNKNOWN
3 WHERE u.FLBATCHID = 'PCAFRINTERMAR1105' AND u.N_PER6 = 201214
4;
He explained.
SQL > SET LINESIZE 130
SQL > SELECT * FROM TABLE (DBMS_XPLAN. DISPLAY ('PLAN_TABLE', 'TSH', 'ALL'));
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Hash value of plan: 2400300449
----------------------------------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |
----------------------------------------------------------------------------------------------------
| 0 | DELETE STATEMENT. 596K | 12 M | 838 (9) | 00:00:12 |
| 1. REMOVE | DETAIL_UNKNOWN |
| 2. SIMPLE HASH PARTITION | 596K | 12 M | 838 (9) | 00:00:12 | 6. 6.
|* 3 | TABLE ACCESS FULL | DETAIL_UNKNOWN | 596K | 12 M | 838 (9) | 00:00:12 |
----------------------------------------------------------------------------------------------------
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Name of the query block / Alias object (identified by the operation identity card):
-------------------------------------------------------------
1 LED$ 1
3 LED$ 1 / U@DEL$1
Information of predicates (identified by the operation identity card):
---------------------------------------------------
3 - filter("U".") FLBATCHID '= 'PCAFRINTERMAR1105' AND 'U'." N_PER6 "= 201214)
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Projection of the column information (identified by the operation identity card):
-----------------------------------------------------------
2 - (cmp = 2, 3) "U". ROWID [ROWID, 10], "U". "N_PER6" [NO.22], 'U' "." " FLBATCHID ' [VARCHAR2, 20].
3 - « U ». ROWID [ROWID, 10], "U". "N_PER6" [NO.22], 'U' "." " FLBATCHID ' [VARCHAR2, 20].
27 selected lines.
===========================================================
Need your suggestions on how the query / table can be tuned.Hi Anand,
I wanted to check why your tkprof Watch report two executions of the statement:
call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Execute 2 2315.71 2480.17 0 3351 624489 611765
In fact, it there was only a single execution of the DELETE statement. The trace file begins with a call EXEC of any statement without call analysis
*** TRACE DUMP CONTINUED FROM FILE XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX_ora_241708.trc *** EXEC #1:c=20000,e=13996,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=32472879711702 ===================== PARSING IN CURSOR #2 len=68 dep=0 uid=72 oct=42 lid=72 tim=32472883567994 hv=740818757 ad='0' ...
TKProf aggregates this EXEC call with call EXEC of the DELETE statement because they have the same location of cursor (#1), he thinks it was the same cursor.
PARSING IN CURSOR #1 len=93 dep=0 uid=72 oct=7 lid=72 tim=32472889974030 hv=1242910589 ad='e5979d80' DELETE from detail_unknown where n_per6 = 201214 and FLBATCHID = 'PCAFRINTERMAR1105' END OF STMT PARSE #1:c=0,e=11462,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,tim=32472889974024 ... EXEC #1:c=2315710000,e=2480213492,p=0,cr=3691,cu=624489,mis=0,r=611765,dep=0,og=1,tim=32475370187626
So, the question about two executions is closed - there was only a single run.
The performance - 2315,71 seconds of time processor is absolutely huge for such amount of work. It looks like a bug.
First, I propose to check the time without compression. If your environment allows this kind of testing try to decompress the partition and re - run on unpacking data DELETION.
10.2 find the name of the partitionselect partition_name from dba_tab_partitions where table_name = 'DETAIL_UNKNOWN' and partition_position = 6
After that
alter table DETAIL_UNKNOWN modify partition
nocompress; alter table DETAIL_UNKNOWN move partition ; and run again the button DELETE.
What is the operating system on the server?
-
need help to write a conditional query recordset
I have two fields or not in the database. VeteranMarker and VeteranNoMarker. Answering one can be Y or N.
I want to write a statement for my detail page where there is a label "veteran? If VeteranMarker or VeteranNoMarker has a Y in the database, then I want to display "YES" next to the label of "veteran? If neither has a Y, then I want to say 'NO '.
The recordset is called DetailRS1, the fields would be so (I think) DetailRS1.VeteranMarker and DetailRS1.VeteranNoMarker.
I have no idea how to write a conditional statement to achieve this.
Thanks in advance,
MiriamI think I have it solved. Here is the code, and it seems to work. If this is correct, I hope it can help someone else too.
-
Need help with Oracle SQL merge records according to date and term dates
Hi all
I need help to find this little challenge.
I have groups and flags and effective dashboards and dates of term against these indicators according to the following example:
GroupName Flag_A Flag_B Eff_date Term_date Group_A THERE THERE 20110101 99991231 Group_A N N 20100101 20101231 Group_A N N 20090101 20091231 Group_A N N 20060101 20081231 Group_A N THERE 20040101 20051231 Group_A THERE THERE 20030101 20031231 Group_B N THERE 20040101 99991231 Group_B N THERE 20030101 20031231 As you can see, group_A had the same combination of (N, N) flag for three successive periods. I want to merge all the time periods with the same indicators in one. Where entry into force will be the most early (underlined) time period and end date will be later (underlined)
So the final result should look like this:
GroupName Flag_A Flag_B Eff_date Term_date Group_A THERE THERE 20110101 99991231 Group_A N N 20060101 20101231 Group_A N THERE 20040101 20051231 Group_A THERE THERE 20030101 20031231 Group_B N THERE 20030101 99991231 Thanks for your help
Here's the DDL script
drop table TMP_group_test;
create table TMP_group_test (groupname varchar2 (8))
, flag_a varchar2 (1)
, flag_b varchar2 (1)
, eff_date varchar2 (8)
, term_date varchar2 (8)
);
insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20110101 ', ' 99991231');
insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20100101 ', ' 20101231');
insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20090101 ', ' 20091231');
insert into TMP_group_test values ('Group_A', 'n', ' n ', ' 20060101 ', ' 20081231');
insert into TMP_group_test values ('Group_A', 'n', 'Y', ' 20040101 ', ' 20051231');
insert into TMP_group_test values ('Group_A', 'Y', 'Y', ' 20030101 ', ' 20031231');
insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20040101 ', ' 99991231');
insert into TMP_group_test values ('Group_B', 'n', 'Y', ' 20030101 ', ' 20031231');
commit;
Post edited by: user13040446
It is the closest, I went to the solution
I create two rows;
Rnk1: partition by group name, order of eff_date / / desc: this grade will sort the records of the most recent and handed to zero for each group\
Rnk2: (dense) partition by group name, flag_A, flagb: this grade for each combination of group\flag gives a number so that they are classified as "families".
Then I use the function analytic min
Min (eff_date) more (partition of GroupName, rnk2): the idea is that, for each Member of the same family, the new date is the min of the family (and the max for the date of the term), at the end I just need separate so that the duplicates are gone
Now the problem. As you can see from the query below, records of 1 and 6 (as identified by rownum) are identified in the same family, because they have the same combination of flag, but they are not successive, so everyone must keep its own date of entry into force.
If only I can make the distinction between these two that would solve my problem
Query:
Select rowNum,GroupName, flag_a, flag_b, eff_date, term_date, rnk1, rnk2
, min (eff_date) more than (partition by GroupName rnk2( ) min_eff
Of
(
Select rowNum,
GroupName , flag_a , flag_b , eff_date , term_date
rank() more than (partition by GroupName stopped by eff_date desc) rnk1
DENSE_RANK() more than (partition by GroupName order by flag_A flag_B ( ) rnk2
de dsreports . tmp_group_test
) order by rowNum
Hello
user13040446 wrote:
Hi KSI.
Thanks for your comments, you were able to distinguish between these lines highlight, but lost lines 2,3,4 which are supposed to have the same date min = 20060101.
Please see the table wanted to see the final result I want to reach
Thanks again
This first answer is basically correct, but in the main query, you want to use the function MIN, not the analytical function aggregation and GROUP BY columns with common values, like this:
WITH got_output_group AS
(
SELECT GroupName, flag_a, flag_b, eff_date, term_date
ROW_NUMBER () OVER (PARTITION BY GroupName
ORDER BY eff_date
)
-ROW_NUMBER () OVER (PARTITION BY GroupName, flag_a, flag_b)
ORDER BY eff_date
) AS output_group
OF tmp_group_test
)
SELECT GroupName, flag_a, flag_b
MIN (eff_date) AS eff_date
MAX (term_date) AS term_date
OF got_output_group
GROUP BY GroupName, flag_a, flag_b
output_group
ORDER BY GroupName
eff_date DESC
;
The result I get is
GROUP_NA F F EFF_DATE TERM_DAT
-------- - - -------- --------
Group_A Y 20110101 99991231 Y
N Group_A 20101231 20060101 N
Group_A N 20051231 20040101 Y
Group_A Y Y 20031231-20030101
Group_B N Y 99991231 20030101
which is what you asked for.
-
Need help for query flat_file type clobdata oracle table data.
Hi Sir,
I need help to query oracle table flat file data having given clob type.
COLUMN FOR CHAR_DATA FLAT_FILEOracle Version: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product PL/SQL Release 10.2.0.1.0 - Production "CORE 10.2.0.1.0 Production" TNS for 32-bit Windows: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production Source table CREATE TABLE order_details ( QUEUE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, LINE_SEQNUM NUMBER(10,0) NOT NULL ENABLE, CHAR_DATA CLOB, OPTIMISTIC_LOCK_KEY NUMBER(20,0) )
EXPECTED RESULTS:EU,6067AT,AT10,000000402004,NexiumGERDManagementProject,Z435,,ZZ29,NIS-GOLD,AT EU,6067AT,AT10,000000402038,NIS-OEU-ARI-2007/1,Z450,,ZZ29,NIS-OEU-ARI-2007/1,AT EU,6067AT,AT10,000000402039,SymbicortNISinCOPD,Z450,,ZZ29,NIS-REU-DUM-2007/1,AT EU,6067AT,AT10,000000402040,D1443L00044SeroquelXRRuby,Z450,,ZZ29,D1443L00044,AT EU,6067AT,AT10,000000402041,NIS-GEU-DUM-2008/1,Z450,,ZZ29,NIS-GEU-DUM-2008/1,AT EU,6067AT,AT10,000000402042,SonstigeAktivitätenLCM,Z450,,ZZ29,.,AT EU,6067AT,AT10,000000402134,D1680L00002Saxagliptin,Z450,,ZZ29,D1680L00002,AT EU,6067AT,AT10,000000402199,SeroquelWaveNIS,Z450,,ZZ29,NIS-NEU-DUM-2009/1,AT EU,6067AT,AT10,000000402313,SeroquelExtra(D1443L00082),Z450,,ZZ29,D1443L00082,AT EU,6067AT,AT10,000000402517,AtlanticD5130L00006(AZD6140),Z450,,ZZ29,D5130L00006,AT EU,6067AT,AT10,000000554494,ArimidexSt.Gallen(13+2),Z142,,ZZ09,,AT EU,6067AT,AT10,000000554495,ArimidexASCO(5delegates),Z142,,ZZ09,,AT EU,6067AT,AT10,000000554496,ArimidexSanAntonio6delegates,Z142,,ZZ09,,AT EU,6067AT,AT10,000000554497,ArimidexBreastCancerSummit(13+2),Z130,,ZZ09,,AT EU,6067AT,AT10,000000554498,ArimidexEIH(15delegates),Z130,,ZZ09,,AT EU,6067AT,AT10,000000554499,ArimidexNIFA(200delegates),Z135,,ZZ09,,AT EU,6067AT,AT10,000000554500,ArimidexNIFAworkshops(8x25),Z135,,ZZ09,,AT EU,6067AT,AT10,000000554501,ArimidexPraktischeGyn.Fortbildung,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554502,ArimidexAGO,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554503,ArimidexHämato/OnkologieKongress,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554504,ARIMIDEXGYNäKOLOGENKONGRESS,Z147,,ZZ09,,AT EU,6067AT,AT10,000000554505,ArimidexChirurgenkongress,Z147,,ZZ09,,AT
AFFIRM_CODE COMPANY_CODE INTERNAL_ORDER_CODE INTERNAL_ORDER_DESC ENIGMA_ACTIVITY SUB_ACTIVITY_CODE IN_AFF_IND ORDER_TYPE EXTERNAL_ORDER COUNTRY EU 6067AT AT10 000000402004 NEXIUMGERDMANAGEMENTPROJECT Z435 NULL ZZ29 NIS-GOLD AT EU 6068AT AT11 000000402005 NEXIUMGERDMANAGEMENTPROJECT Z435 NULL ZZ29 NIS-GOLD AT
Sorry, my bad. Without database at hand, I'll try 'baby steps' (borrowed from Frank) so you don't confuse it with errors that I might add (happens far too often already, but at least you won't "swallow" as forum members think is one of the main goals of this fighter - help her learn - providing not only the proverbial fish.)
Search the Forum - your problem is one of its best sellers. Watching {message identifier: = 10694602} ("split string into" was the key word used in research) you can try something asselect table_row, level clob_row, regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) the_line from (select to_char(queue_seqnum)||':'||to_char(line_seqnum) table_row, char_data from order_details ) connect by regexp_substr(char_data,'[^' || chr(13) || chr(10) || ']+',1,level) is not null and prior char_data = char_data and prior table_row = table_row and prior sys_guid() is not null
to get all the s the_lineall CLOB and after that the use of the example even to get your columns of each the_line.
Concerning
Etbin
Edited by: Etbin on 3.2.2013 09:01
.. .but I m connected to do things according to the instructions, I can't do something.
Used to happen to me too and I did as told to the but only after explaining any disadvantages, I was aware of in time. The last sentence is usually: "O.K. now be just and Don't come back with that kind of thing when it turns out that this isn't the right thing."
rp0428 post - something to remember. -
Need help to write original Victorian SQL of a tricky requirement statement
Hello
I have a table with the following structure
ID Number (10)
Company Varchar2 (100)
Products Varchar2 (4000)
The area of the stored products the list separated by commas in the names of products, which the company deals in.
I want to know the number of companies for each product and organize the product list in descending order of their number
For example, the sample data as follows
The company produced ID
1 a readers of portable barcode of desktop computers, the readers of barcodes, computer laptop, system memory,
2B Handcrafted Wallets leather, holders of credit card in leather, handbag leather, ladies handbag, Designer handbag
C 3 laptops, desktops
4 d, leather wallet, handbag ladies
5 E ladies handbag, ladies, ladies Sandals boots
6 F designer handbag, handbag ladies
Now, here's the result I want
Nr. of companies article
Handbag ladies 4
Handbag designer 2
2 leather handbag
Laptop 2
Desktop computers 2
Memory system 1
1 barcode readers
1 portable barcode readers
1 hand-crafted leather wallets
1 leather credit card holders
Start ladies 1
1 ladies sandals
It would be great if I can achieve in a single SQL.
My database size is also great arround 1.5 million records and on an average about 10 produced by the company
Concerning
MaliceHello
[This thread | http://forums.oracle.com/forums/thread.jspa?threadID=717813&tstart=25] shows how to split a delimited (like your products column) parts list, one line per element.
There is a solution for Oracle 9. In Oracle 10 (and more) that the solution (using SUBSTR and INSTR) will still work, but I recommend to useREGEXP_SUBSTR ( products , '[^,]+' , 1 , n ) AS product
Instead, to get the item of the n - th from the products in the list separated by commas.
Once you have divided the column of the goods in parts, the main request is just
SELECT product , COUNT (*) AS no_of_companies FROM subquery GROUP BY product ORDER BY no_of_companies DESC , product;
-
need help to create the insert statement
I have customer_priv of table which has 4 columns (login, privilize_id, adate, added_by)
the stmt insert like "insert into customer_priv values('JDOE',951.sysdate,admin);
I have 100 users and for each user, I need to add to the 15 privilize_id
I have the list of connections and roles, what is the best way to create a massive insert for all those users statement and
any help is very appreciated
Thank youuser11984714 wrote:
Thanks FrankI get the below now.what Miss. Also is it possible to reel in a file insert rather directly the data.am I missing values?
Sorry, I don't understand what you want.
You say you want to write something in a HOLD file instead of insert? Of course, you can do it. Change the INSERT statement in a SELECT statement and add commands to the COIL.SQL > @c:\insert_many.sql
33 old: SELECT ' & 1' priv_id, 'admin', sysdate)
33 News: SELECT sysdate, "BNELSON", "admin", priv_id)Of all_priv_id
*
ERROR on line 34:
ORA-00923: THE KEYWORD not found where expected
Thank youPublished by: user11984714 on August 9, 2010 18:40
Sorry, there was a typing error in my previous post.
Remove the ')' the end of theSELECT '&1', privilze_id, SYSDATE, 'admin')
I hope that you have more problems, but if you do, post your code, even if you think that you just copied it from this site.
-
Need help working Oracle/PHP to ASP/Oracle conversion
I don't know if it's the right place, but I was pulling my hair out trying to convert a PHP page in VBScript (ASP) without a bit of luck to all. Hours of research on Google and trial and error and grrrr... I hope someone can help.
I am new to Oracle and PHP, but old in ASP/VBScript
Windows Server 2003 R2
IIS
PHP
I have an Oracle procedure on a remote computer on which I can NOT change. Out of my control. There is a PHP page on a web server that calls it and works very well. My boss wants me to convert the PHP ASP script (I know, but I have to work within those parameters. Sorry). On the one hand, I can't find many examples of the use of ASP with Oracle procedures. And those that I find are not complete examples or are displayed as questions. Everything I've tried so far either causes an error message I don't understand or not errors, but no data either. So, here is what I got:
CREATE OR REPLACE PROCEDURE X_Doc_Num_Query)
p_doc_num in VARCHAR2
)
AS
-variables
v_curr_sos_ric Pkg.curr_sos_ric%TYPE: = NULL;
v_data VARCHAR2 (1000): = NULL;
v_depot_ric Pkg.depot_ric%TYPE: = NULL;
v_doc_num Rqn.Doc_Num%TYPE: = NULL;
v_dodaac Rqn.cnsgne_dodaac%TYPE: = NULL; v_found_pkg BOOLEAN: = FALSE;
v_found_rqn BOOLEAN: = FALSE;
v_ic_cl_of_supply_cd Item_Control.cl_of_supply_cd%TYPE: = NULL;
v_index directory: = 0;
v_itcn Pkg.itcn%TYPE: = NULL;
v_lca_inst Cddb_Force.lca_inst%TYPE: = NULL;
v_pkg_niin Pkg.niin%TYPE: = NULL;
v_proj_cd Rqn.proj_cd%TYPE: = NULL;
v_rqn_niin Rqn.niin%TYPE: = NULL;
-variables defined by the procedures define_status and package pkg_procsusl v_errcd VARCHAR2 (10): = NULL;
v_errmsg VARCHAR2 (600): = NULL;
v_errproc VARCHAR2 (30): = NULL;
v_syserr BOOLEAN: = FALSE;
-the variables defined by the procedure define_status
v_status_cd VARCHAR2 (2): = NULL;
v_status_dt DATE: = NULL;
-package pkg_procsusl-defined variables
v_citcn Ship_Unit.citcn%TYPE: = NULL;
v_dep_ship_su Ship_Unit.dt_dep_ship%TYPE: = NULL;
v_dt_ccps Ship_Unit.dt_ccps%TYPE: = NULL;
v_dt_crpr Ship_Unit.dt_crpr%TYPE: = NULL;
v_dt_hubr Ship_Unit.dt_hubr%TYPE: = NULL;
v_dt_hubs Ship_Unit.dt_hubs%TYPE: = NULL;
v_dt_lift SL.dt_lift%TYPE: = NULL;
v_dt_ssar Ship_Unit.dt_ssar%TYPE: = NULL;
v_dt_umfps Ship_Unit.dt_umfps%TYPE: = NULL;
v_hub_tcn Ship_Unit.hub_tcn%TYPE: = NULL;
v_mfst_ref SL.mfst_ref%TYPE: = NULL;
v_mfst_sta SL.mfst_sta%TYPE: = NULL;
v_mod_shp Ship_Unit.mod_shp%TYPE: = NULL;
v_mode VARCHAR2 (10): = NULL;
v_msn_num Flt.msn_num%TYPE: = NULL;
v_save_erl_poel SL.dt_poel%TYPE: = NULL;
v_save_erl_poel_pair SL.dt_poel%TYPE: = NULL;
v_save_erl_poer SL.dt_poer%TYPE: = NULL;
v_save_erl_poer_pair SL.dt_poer%TYPE: = NULL;
v_save_lat_podf Ship_Unit.dt_podf%TYPE: = NULL;
v_save_lat_podf_pair Ship_Unit.dt_podf%TYPE: = NULL;
v_save_lat_podr Ship_Unit.dt_podr%TYPE: = NULL;
v_save_lat_podr_pair Ship_Unit.dt_podr%TYPE: = NULL; v_pod Ship_Unit.pod%TYPE: = NULL;
v_poe SL.poe%TYPE: = NULL;
v_voyage_no SL.voyage_no%TYPE: = NULL;
v_tdi Ship_Unit.tdi%TYPE: = NULL;
-cursors
CURSOR c_rqn (doc_num_in VARCHAR2) IS
SELECT *.
OF tangible
WHERE doc_num = doc_num_in;
CURSOR c_pkg (doc_num_in VARCHAR2) IS
SELECT *.
PKG
WHERE doc_num = doc_num_in
AND sup_pipe_cat <>'OB '.
AND sup_pipe_cat <>"IA";
-documents
r_pkg Pkg % ROWTYPE;
r_rqn tangible % ROWTYPE;
-- functions ---------------------------------------------------------
FUNCTION Find_Lca_Inst (dodaac_in VARCHAR2)
RETURN VARCHAR2
IS
v_lca_cd Cddb_Force.lca_inst%TYPE;
BEGIN
SELECT lca_inst from v_lca_cd
OF Cddb_Force
WHERE dodaac = dodaac_in;
RETURN v_lca_cd;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURNS A NULL VALUE.
WHILE OTHERS THEN
LIFT;
END Find_Lca_Inst;
----------------------------------------------------------------------
FUNCTION Find_Supply_Cd (niin_in VARCHAR2)
RETURN VARCHAR2
IS
v_supply_cd Item_Control.cl_of_supply_cd%TYPE;
BEGIN
SELECT cl_of_supply_cd from v_supply_cd
OF Item_Control
WHERE only = niin_in;
RETURN v_supply_cd;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURNS A NULL VALUE.
WHILE OTHERS THEN
LIFT;
END Find_Supply_Cd;
----------------------------------------------------------------------
BEGIN
DBMS_OUTPUT. ENABLE (2000000);
v_doc_num: = upper (p_doc_num);
OPEN c_rqn (v_doc_num);
LOOP
SEEK c_rqn INTO r_rqn;
EXIT WHEN c_rqn % NOTFOUND;
v_found_rqn: = TRUE;
v_dodaac: = NVL (r_rqn.cnsgne_dodaac, r_rqn.s_cnsgne_dodaac);
v_rqn_niin: = NVL (r_rqn.niin, r_rqn.s_niin);
v_proj_cd: = NVL (r_rqn.proj_cd, r_rqn.s_proj_cd);
IF v_dodaac IS NOT NULL THEN
v_lca_inst: = FIND_LCA_INST (v_dodaac);
ON THE OTHER
v_lca_inst: = NULL;
END IF;
-output of tangible column values
DBMS_OUTPUT. Put_LINE ('Tangible database');
v_data: = r_rqn.doc_num | '|' || r_rqn.req_geo_flag | '|' ||
r_rqn.estb_dic | '|' || r_rqn.niin | '|' ||
r_rqn.asg_cd | '|' || r_rqn. Qty | '|' ||
r_rqn.unit_price | '|' || r_rqn.dmd_cd | '|' ||
v_proj_cd | '|' || r_rqn. Priority | '|' ||
r_rqn. RDD | '|' || r_rqn.cl_of_supply_cd | '|' ||
To_char(r_rqn.dt_rqn_estb,'MM/dd/yyyy'). '|' ||
To_char (r_rqn.dt_first_bo, "MM/DD/YYYY '") | ' |' |
To_char (r_rqn.dt_first_can_req, "MM/DD/YYYY '") | ' |' |
r_rqn.supadd | '|' || r_rqn. UI | '|' ||
v_lca_inst | '|' || r_rqn.sig_cd | '|' ||
r_rqn.fd_cd | '|' || r_rqn.med_stat_cd | '|' ||
r_rqn.ssf_flag | '|' || To_char (r_rqn.lst_updt, "MM/DD/YYYY");
DBMS_OUTPUT. Put_line (v_data);
DBMS_OUTPUT. Put_line ('PKG database');
OPEN c_pkg (v_doc_num);
LOOP
SEEK c_pkg INTO r_pkg;
EXIT WHEN c_pkg % NOTFOUND;
v_found_pkg: = TRUE;
v_curr_sos_ric: = NVL (r_pkg.curr_sos_ric, r_pkg.s_curr_sos_ric);
v_depot_ric: = NVL (r_pkg.depot_ric, r_pkg.s_depot_ric);
v_pkg_niin: = NVL (r_pkg.niin, r_pkg.s_niin);
IF v_pkg_niin IS NOT NULL THEN
v_ic_cl_of_supply_cd: = Find_Supply_Cd (v_pkg_niin);
ON THE OTHER
v_ic_cl_of_supply_cd: = NULL;
END IF;
Define_Status (r_pkg,
v_status_cd,
v_status_dt,
v_syserr,
v_errcd,
v_errmsg,
v_errproc
);
IF v_syserr THEN
DBMS_OUTPUT. Put_line (' ERROR in Define_Status: ' | v_errmsg);
EXIT;
END IF;
v_itcn: = NULL;
Pkg_Procsusl.Process_Susl ('XT',
r_rqn.req_geo_flag,
r_pkg. STCN,
v_itcn,
v_dodaac,
v_dt_crpr,
v_dt_ccps,
v_dt_hubr,
v_dt_hubs,
v_dt_ssar,
v_dt_lift,
v_dt_umfps,
v_save_erl_poel,
v_save_erl_poel_pair,
v_save_erl_poer,
v_save_erl_poer_pair,
v_save_lat_podf,
v_save_lat_podf_pair,
v_save_lat_podr,
v_save_lat_podr_pair,
v_dep_ship_su,
v_mode,
v_mod_shp,
v_mfst_ref,
v_mfst_sta,
v_msn_num,
v_pod,
v_poe,
v_voyage_no,
v_tdi,
v_citcn,
v_hub_tcn,
v_errcd,
v_errmsg,
v_errproc,
v_syserr
);
IF v_syserr THEN
DBMS_OUTPUT. Put_line (' ERROR in Pkg_Procsusl: ' | v_errmsg);
EXIT;
END IF;
v_data: = r_pkg.doc_num | '|' || r_pkg.pkg_id | '|' ||
Trim (r_pkg.input_stk_num) | '|' || v_status_cd | '|' ||
To_char (v_status_dt, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_est_ship, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_rel, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_dep_ship, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_rcpt, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_maint_ret_rcpt, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_idt_rcpt, "MM/DD/YYYY '") | ' |' |
To_char (r_pkg.dt_mrd, "MM/DD/YYYY '") | ' |' |
v_curr_sos_ric | '|' || v_pkg_niin | '|' ||
r_pkg. Qty | '|' || v_depot_ric | '|' ||
r_pkg.ssf_flag | '|' || r_pkg. UI | '|' ||
r_pkg.sfx_cd | '|' || r_pkg.direct_fill | '|' ||
r_pkg. STCN | '|' || v_ic_cl_of_supply_cd | '|' ||
To_char (v_dt_ssar, "MM/DD/YYYY '") | ' |' |
To_char (v_dt_crpr, "MM/DD/YYYY '") | ' |' |
To_char (v_save_lat_podr, "MM/DD/YYYY");
DBMS_OUTPUT. Put_line (v_data); END LOOP;
CLOSE C_pkg;
EXIT;
END LOOP;
CLOSE C_rqn;
IF this is v_found_rqn THEN
DBMS_OUTPUT. Put_line (' NO data available for doc_num = ' | v_doc_num);
END IF;
EXCEPTION
WHILE OTHERS THEN
IF c_rqn % ISOPEN THEN
CLOSE C_rqn;
END IF;
IF c_pkg % ISOPEN THEN
CLOSE C_pkg;
END IF;
DBMS_OUTPUT. PUT_LINE (' ERROR: ' |) SQLERRM);
END X_Doc_Num_Query;
/
===================================
===================================
Here is the PHP page:
<? PHP
error_reporting (0);
PutEnv("TNS_ADMIN=e:/oracle/ora92/network/ADMIN");
PutEnv("LD_LIBRARY_PATH=E:/Oracle/ora92");
PutEnv ("NLS_LANG = English_America.WE8ISO8859P1");
$don = isset($_REQUEST["don"])? $_REQUEST ['gift']: "asdf1234"; If no value passed, use the value of test
Enable or DISABLE dbms_output.
function SetServerOutput ($con, $p)
{
If ($p)
$s = "BEGIN DBMS_OUTPUT. ENABLE (1000000); END; « ;
on the other
$s = "BEGIN DBMS_OUTPUT. DISABLE(); END; « ;
$r = false;
$stid = doParse ($con, $s);
If {($stid)
$r = doExecute ($stid);
@OCIFreeStatement ($stid);
}
Return $r;
}
Retrieve and display any dbms_output
function DisplayDbmsOutput ($con)
{
$r = GetDbmsOutput ($con);
$cnt = sizeof ($r);
If (! $r)
print ' < p > no dbms_output < /p > \n ";
on the other
$orders = $r;
$number_of_orders = count ($orders);
If ($number_of_orders == 0)
{echo "< p > < strong > no orders pending."}
Please try again later. < facilities > < / p > ';
}
echo "< body leftmargin = 0 topmargin = 0 > ';
for ($i = 0; $i < 1; $i ++)
{
$line2 = explode ("|", $orders [$i]);
echo "< BR > < b > $line2 [0] < /b >."
}
for ($i = 1; $i < 2; $i ++)
{
$line2 = explode ("|", $orders [$i]);
echo "< table border = 1 bordercolor = #000000 cellpadding = 2 cellspacing = 0 > \n < TR > < th bgcolor = Color #FFFFFF = #000000 > DON < table >.
< th bgcolor = Color #FFFFFF = #000000 > GEO FLAG < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > DIC
< th bgcolor = Color #FFFFFF = #000000 > < table > ONLY
< th bgcolor = Color #FFFFFF = #000000 > ASG CD < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > QTY
< th bgcolor = Color #FFFFFF = #000000 > PRICE UNIT < table >
< th bgcolor = Color #FFFFFF = #000000 > DMD CD < table >
< th bgcolor = Color #FFFFFF = #000000 > PROJ CD < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > PRIORITY
< th bgcolor = Color #FFFFFF = #000000 > < table > RDD
< th bgcolor = Color #FFFFFF = #000000 > CLS OF < table > SUPPLY
< th bgcolor = Color #FFFFFF = #000000 > ESTAB DTE < table >
< th bgcolor = Color #FFFFFF = #000000 > FIRST BO DTE < table >
< th bgcolor = Color #FFFFFF = #000000 > FIRST DTE CAN < table >
< th bgcolor = Color #FFFFFF = #000000 > SUPADD < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > UI
< th bgcolor = Color #FFFFFF = #000000 > LCA INST < table >
< th bgcolor = Color #FFFFFF = #000000 > GIS CD < table >
< th bgcolor = Color #FFFFFF = #000000 > FD CD < table >
< th bgcolor = Color #FFFFFF = #000000 > MED STAT CD < table >
< th bgcolor = Color #FFFFFF = #000000 > SSF FLAG < table >
< th bgcolor = Color #FFFFFF = #000000 > DTE UPDT < table >
< b >
< td align = "center" > $line2 [0] < table >
< td align = "center" > $line2 [1] < table >
< td align = "center" > $line2 [2] < table >
< td align = "center" > $line2 [3] < table >
< td align = "center" > $line2 [4] < table >
< td align = "center" > $line2 [5] < table >
< td align = "center" > $line2 [6] < table >
< td align = "center" > $line2 [7] < table >
< td align = "center" > $line2 [8] < table >
< td align = "center" > $line2 [9] < table >
< td align = "center" > $line2 [10] < table >
< td align = "center" > $line2 [11] < table >
< td align = "center" > $line2 [12] < table >
< td align = "center" > $line2 [13] < table >
< td align = "center" > $line2 [14] < table >
< td align = "center" > $line2 [15] < table >
< td align = "center" > $line2 [16] < table >
< td align = "center" > $line2 [17] < table >
< td align = "center" > $line2 [18] < table >
< td align = "center" > $line2 [19] < table >
< td align = "center" > $line2 [20] < table >
< td align = "center" > $line2 [21] < table >
< td align = "center" > $line2 [22] < table >
< /tr >
< /table > ';
}
for ($i = 2; $i < 3; $i ++)
{
$line2 = explode ("|", $orders [$i]);
echo "< BR > < BR > < b > $line2 [0] < /b >."
}
echo "< table border = 1 bordercolor = #000000 cellpadding = 2 cellspacing = 0 >
< TR > < th bgcolor = Color #FFFFFF = #000000 > < table > DON
< th bgcolor = Color #FFFFFF = #000000 > PKG ID < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > ONLY
< th bgcolor = Color #FFFFFF = #000000 > STATUS CD < table >
< th bgcolor = Color #FFFFFF = #000000 > STATUS DT < table >
< th bgcolor = Color #FFFFFF = #000000 > SHIP DTE IS < table >
< th bgcolor = Color #FFFFFF = #000000 > REL DT < table >
< th bgcolor = Color #FFFFFF = #000000 > DT DEP SHIP < table >
< th bgcolor = Color #FFFFFF = #000000 > RCPT DT < table >
< th bgcolor = Color #FFFFFF = #000000 > DT MAINT RET RCPT < table >
< th bgcolor = Color #FFFFFF = #000000 > DT IDT RCPT < table >
< th bgcolor = Color #FFFFFF = #000000 > DT MRD < table >
< th bgcolor = Color #FFFFFF = #000000 > SOS RIC < table >
< th bgcolor = Color #FFFFFF = #000000 > PKG ONLY < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > QTY
< th bgcolor = Color #FFFFFF = #000000 > DEPOSIT CIR < table >
< th bgcolor = Color #FFFFFF = #000000 > SSF FLAG < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > UI
< th bgcolor = Color #FFFFFF = #000000 > SFX CD < table >
< th bgcolor = Color #FFFFFF = #000000 > DIRECT FILL < table >
< th bgcolor = Color #FFFFFF = #000000 > < table > STCN
< th bgcolor = Color #FFFFFF = #000000 > POWER CL < table >
< th bgcolor = Color #FFFFFF = #000000 > DT SSAR < table >
< th bgcolor = Color #FFFFFF = #000000 > DT MCEA < table >
< th bgcolor = Color #FFFFFF = #000000 > DT LAT ME < table >
";
for ($i = 3; $i < $number_of_orders; $i ++)
{
$line2 = explode ("|", $orders [$i]);
ECHO '.
< b >
< td align = "center" > $line2 [0] < table >
< td align = "center" > $line2 [1] < table >
< td align = "center" > $line2 [2] < table >
< td align = "center" > $line2 [3] < table >
< td align = "center" > $line2 [4] < table >
< td align = "center" > $line2 [5] < table >
< td align = "center" > $line2 [6] < table >
< td align = "center" > $line2 [7] < table >
< td align = "center" > $line2 [8] < table >
< td align = "center" > $line2 [9] < table >
< td align = "center" > $line2 [10] < table >
< td align = "center" > $line2 [11] < table >
< td align = "center" > $line2 [12] < table >
< td align = "center" > $line2 [13] < table >
< td align = "center" > $line2 [14] < table >
< td align = "center" > $line2 [15] < table >
< td align = "center" > $line2 [16] < table >
< td align = "center" > $line2 [17] < table >
< td align = "center" > $line2 [18] < table >
< td align = "center" > $line2 [19] < table >
< td align = "center" > $line2 [20] < table >
< td align = "center" > $line2 [21] < table >
< td align = "center" > $line2 [22] < table >
< td align = "center" > $line2 [23] < table >
< td align = "center" > $line2 [24] < table >
< /tr > ";
}
echo "< / table >";
}
Returns an array of rows dbms_output or false.
function GetDbmsOutput ($con)
{
$res = false;
$stid = doParse ($con, "BEGIN DBMS_OUTPUT. GET_LINE (: LN,: ST); END; ») ;
If {($stid)
If (doBind ($stid, ': LN ', $ln, 255 "") & &)
doBind ($stid, ": ST", $st, "")) {}
$res = array();
While ($succ = {doExecute ($stid))}
If ($st)
break;
[] $res = $ln;
}
If (! $succ)
$res = false;
}
@OCIFreeStatement ($stid);
}
return ($res);
}
Parse
function doParse ($con, $stmt)
{
$stid = @OCIParse ($con, $stmt);
If (! $stid)
PrintOCIError (@OCIError ($con));
return ($stid);
}
Link
function doBind ($stid, $bn, & $bv, $ln)
{
$s = @OCIBindByName ($stid, $bn, $bv, $ln);
If (! $s)
PrintOCIError (@OCIError ($stid));
return ($s);
}
Run
function doExecute ($stid)
{
$s = @OCIExecute ($stid);
If (! $s)
PrintOCIError (@OCIError ($stid));
return ($s);
}
OIC display error
function PrintOCIError ($err)
{
echo "< p > < b > error < /b >: < /p > < pre > \n"..htmlentities($err['message'])"< / pre > \n";
}
$con = @OCILogon ("username", "password", "Server");
If (! $con) {}
PrintOCIError (@OCIError ());
Die();
}
Turn on serveroutput
SetServerOutput ($con, true);
Create the dbms_output
$s = doParse ($con, "begin data_pull_views.x_doc_num_query('$don'); end; ») ;
If ($s)
doExecute ($s);
OCILogoff ($con);
The output display
OCILogoff ($con);
DisplayDbmsOutput ($con);
PEOPLE WITH DISABILITIES END * /.
? >
< / body >
< / html >
===========================
===========================
What I've learned so far PHP code somehow seizes the dbmd_output buffer and load it in a table before you display it on the screen. Fine. I can even take a stab at some ODBC in VBScript with ASP commands, but it almost seems like it is not yet possible. Just a stab here's to it in ASP which is not error, but also returns no data.
< %
Van Goethem = request ("don")
If van Goethem = "" then
Van Goethem = "asdf1234".
End If
Set gv_con = Server.CreateObject ("ADODB. Connection")
gv_con. ConnectionString = "Data Source = dsource; User = username ID; Password = password; »
gv_con. Open
the value of cmd = Server.CreateObject ("ADODB.Command")
cmd ActiveConnection in the Group gv_con
cmd.CommandText = "begin data_pull_views.x_doc_num_query ('" & van goethem & "');" end; »
cmd.CommandType = 1
Set the param = cmd.createparameter ("OutPut" 200,4, 50)
cmd. Parameters.Append param
cmd. run
Response.Write "strText =" & cmd ("OutPut") & "< BR BR > > <" "»
% >
So I obviously have no idea what I'm doing. Any help getting this race would be appreciated greately.Hello
I don't know anything about PHP either, but a quick look at the code, it seems that the procedure is pretty much just "all wrong", and unfortunately now it is your task to continue the tradition rather than fix the stored procedure.
The thing that makes me say that it is "all wrong", it's that he uses dbms_output to communicate data. DBMS_OUTPUT is not intended to be used to return the results of a procedure, or be used as a reporting tool; It's supposed to be used to add debugging for troubleshooting instructions. The right thing to do is to return the results of a procedure stored via a parameter, refcursors, etc.
Anyway, as you can not change the procedure, the problem boils down to the buffer that was completed by telephone dbms_output.put_line obtaining using calls to dbms_outout.get_line and here is a simple example that shows how you can go about this using ADO and ODBC.
It will be useful,
Gregprocedure
=======create or replace procedure populate_dbms_buffer as begin dbms_output.put_line('foo'); dbms_output.put_line('bar'); dbms_output.put_line('baz'); end; /
VBScript
========Const adLongVarChar = 201 Const adInteger = 3 Const adParamOutput = &H0002 set con = createobject("adodb.connection") con.open "dsn=orcl;uid=scott;pwd=tiger" set cmd = CreateObject("adodb.command") set cmd.ActiveConnection = con cmd.commandtext = "begin dbms_output.enable(32000);end;" cmd.execute cmd.CommandText = "begin populate_dbms_buffer(); end;" cmd.execute cmd.CommandText = "begin dbms_output.get_line(?,?);end;" Set prmv2 = cmd.CreateParameter("",adLongVarChar, adParamOutput, 32767,"") Set prmnum = cmd.CreateParameter("", adInteger,adParamOutput,,1) cmd.Parameters.Append prmv2 cmd.Parameters.Append prmnum stillmore=0 while (stillmore<>1) cmd.execute stillmore = prmnum.value if (stillmore<>1) then wscript.echo prmv2.value end if wend 'cleanup ommitted wscript.echo "done"
output
=======C:\>odbcparams_dbmsgetline.vbs Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved. foo bar baz done
-
Need help to write a program for the acquisition of signals.
Hello
I need to write a program that will do the following:
1 acquire two signals simulated,
2. make 10 averages the signal,
3. filter the signal,
4. display the signal in its raw form and the power spectrum (fft),
5. save the data using writing to the file vi
I tried it for awhile, but there's always something does not... None of the experts LabVIEW here can help me?
Thank you 1 million.
-Deet
No one here is going to do your homework for you. Please join what you have written so far and explain the specific problem that you are experiencing.
-
Hi all
I need to write a sql that retrieves data from the status table and check for this time in the ESHIFT table if the flag was or not. If is there, then it will keep the record as it is Furthermore, there
did not understand at the time the flag was N suppose ESHIFT table has one record where you N 13:00:01-13:30 then the status register which is 13:00-13:59 min 59 s, we should get 13:00 - 13: records of 00:00 1 and 2 of 13:30:01-13:59 min 59 s
create table ESHIFT (From_date date, date, to_date, flag varchar2 (2));
insert into ESHIFT values (' 1 February 12 09:00 ", February 1, 12 13:20 ', 'Y');
insert into ESHIFT values (' 1 February 12 13:20:01 ", 1 February 12 13:30 ',' don't);
insert into ESHIFT values (' 1 February 12 13:30:01 ", February 1, 12 16:00 ', 'Y');
SELECT * from eshift;
create table status (date of From_date, to_date date, status number);
insert into values of status (1 February 12 11:00 ', February 1, 12 12:00 ', 1);
insert into values of status (1 February 12 12:00:01 ', February 1, 12 12:20 ', 2);
insert into status values ("1 February 12 12:20:01", 1 February 12 12:59:59 ', 1);
insert into status values ("1 February 12 13:00", February 1, 12 13:59:59 ', 1);
insert into status values ("1 February 12 14:00", February 1, 12 14:59:59 ', 2);
SELECT * STATUS;
In the case above should get sql
1 FEBRUARY 12 11:00 1ST FEBRUARY 12 12:00 1
FEBRUARY 1ST, 12 12:00 1ST FEBRUARY 12 12:20 2
FEBRUARY 1ST, 12 12:20:01, 1 FEBRUARY 12 12:59:59 1
FEBRUARY 1ST, 12 13:00 1ST FEBRUARY 12 13:20 1
FEBRUARY 1ST, 12 13:30 1 FEBRUARY 12 13:59:59 1
FEBRUARY 1ST, 12 14:00 1 FEBRUARY 12 14:59:59 2
It will be really great if someone can help me how I can get the desired result.
Thank you very much in advance.
Please provide instructions creating table and data. It makes it so much easier to answer.
I think you want:
Select (s.from_date, e.from_date) greatest from_date, less (s.to_date, e.to_date) to_date, s.status
s status e eshift join on s.from_date < e.to_date="" and="" s.to_date=""> e.from_date and e.flag = 'Y '.
order by 1
-
Need help to write a script that opens files, removes layers and sous-calques
Hey all,.
I'm a noob to the community of script, and what I try to do is file edit commands that share the same names of layers and sublayers. I have a few questions that would be incredibly useful if I could have answered.
I'm not sure how to define a script too call out of the layers that have been created without script. I need to create a variable for the existing layers and leave the script to know what their names are in the files?
For example, I have three files which have each layer named 'cutlayer', 'trimlayer', 'fold' and 'work '. I need to write a script that opens three files, deletes the layer 'fold' of each file, and then move the layer "trimlayer" in his own sublayer in 'work' (the base layer can be on the top so reorganization sublayers is not necessary to worry about something). I do not understand how to write the script because I couldn't find examples in the documentation for the script provided on the adobe website which has worked with existing files.
It's my shot at what I'm trying to do, with English fill in the blanks of what I do not know how to script. If anyone can help me understand this point, I would really appreciate it!
app.documents.openDlg (prompt, filter, MultiSelect); the user opens the associated files
If (documents.length > 0) //run the script through each document individually
{
sourceDoc = activeDocument;
delete the "fold" sourceDoc layer
move the "trimlayer" in the layer "work."
remove the underlayment 'path' of layer "work."
Run the script through each document
Save the new file name folder in the new parallel to the current folder on the hard disk
Go out and spend in each document until there is no more
}
create new document
Place documents published in different layers in the new document, with a distance between them, optimize the space on a 51 "x 51" work plan, using as little of the artboard as possible. "
All comments are things basically, I do not know how and am trying to figure out how to do, so if anyone has a second to explain some of these things, I would really appreciate it!
Thanks again!
I know it of very frustrating when his apprenticeship and things don't go as planned, but understand that it is quite confusing as it is and do not add more confusion to the mix by using other tools than those provided. I mean JSLint, it might be useful with GENERAL javascript syntax, but Adobe's Javascript implementation is another animal, or another language, always JavaScript, but intended to be run by its own engine. JSLint has no idea what "layers", or "pathItems" are, it will trigger errors when he sees the objects, it does not recognize.
.. .in learning... not to take baby, write a single line of code and run... If it works, write another line of code
Try this version (always in the ESTK),'re missing you a few "++", and you do not change "documents" with "docs" in a certain place
var docs = File.openDialog("Select Files to Open", "*.ai", true); var idx = 0; for (idx = 0; idx < docs.length; ++idx) { var doc = app.open(docs[idx]); var myCounter = 0; for (myCounter = 0; myCounter < doc.layers.length; myCounter++) { doc.layers[myCounter].locked = false; } doc.layers.getByName('Crease').remove(); doc.layers.getByName('Regmark').remove(); doc.layers.getByName('Artwork').pathItems[0].remove(); doc.layers.getByName('Through Cut').hasSelectedArtwork = true; doc.layers.getByName('Through Cut').pathItems[0].strokeColor = doc.swatches.getByName("Black").color; doc.layers.getByName('Through Cut').move(doc.layers.getByName('Artwork'), ElementPlacement.INSIDE); }
-
Need help to write a workflow rule
Hi all!
I want to write a workflow that will fill in the field "Region" when a new account is saved.
We use territories, but cannot effectively throw contact reports due to not having OnDemand is not the field of territory in the area of Contact of the registrant. (Statement in contact area you can only shoot in the 'Région')
When we originally put in place on request during the conversion of result data, we created our regions to be the same as the territories. However at the moment 'Région' is not a field we use, because of the need to create accounts to be a simple as possible. So what I want to do, is to bind the field 'region' in the field 'Territory', so that when a new account is saved this field is automatically filled in.
Also uses a workflow the only way to do it?
Thanks in advance!The expression of JoinFieldValue I put in my last message is exactly what you need. Just copy exactly as you see and passed in the default value box. You should not write 20 expressions. The name of the territory in my expression field is available in the territory, but you wouldn't see it in the drop-down list in the field into account when creating the default value of the message.
OK, so to test it, please copy the expression in the default exactly as I have above. Then check the default message indicator. Then save your changes. You must ensure that the drop-down lists of territory and the region are compatible. They must match exactly. You will have to finally, disconnect and reconnect you and create a new account and choose the territory.
Let me know how it goes.
Thom -
Satellite A300-1EG: need help to write module fan control ACPI NHC
Hello
I need assistance with writing module NHC allowing me to adjust the speed of the fan always at max level.
The reason why a desire to do this is high time on the CPU and the GPU.I find guide to do something like that, but it of for laptops asus and records of fans and time does not match.
http://help.notebookhardwarecontrol.NET/ACPI/HOWTO/nhcAsusM2N/index.htm
My laptop is Toshiba A300-1EG
Thanks for the help and sorry for my bad English
I think you're going in the wrong direction. As you probably all know it works automatically and Toshiba made laptop computers to function at an optimal level. If you have problems with this older model A300 you should take standard steps and clean it. It can be done on a career path.
Laptop can be disassembled, cleaned. CPU fat can also be renewed.After doing all this laptop will be clean, laptop can catch its breath and all hardware components can be properly cooled. There is therefore no need to change anything, especially values not original in the BIOS or anything related to the GPU.
I have the same machine. It works still fairly quiet, but one day, I want to do the same thing.
Maybe you are looking for
-
C4600: C4600 with Windows 7
Bought this C4600 all-in-1 used. Can be installed on a computer of Windows7. Get error messages when I click on install.
-
How to access files VOB of Clearcase with TestStand
I want to copy the VOB files on my local machine, so could you please tell me what the Clearcase property I need to use in the TestStand... or if there is any other way please let me know
-
Drivers for HP ENVY DV6 7206TX for Windows 7 64-bit
Hello I recently installed Windows 7 64 bit in my book. I need the drivers for USB 3.0 and wired to the same LAN. The other drivers are from the Windows 8. Gilles
-
Help, please
-
Mr PresidentMy worm Jdev is 12.2.1.I have master tables / details.I have 2 lines for each PRIMARY KEY = ("VID", "LINEITEM") as below in the Details table.Please help how to get a button on a jsf page to remove these two lines at a time.Concerning