How to insert a record with date format field
I tried to execute the query of the below but it showed error and hence i did research and found out i can add a date syntax in front to format it properly.
INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo)
VALUES ('E001', 'Alex', 'M', '2006-11-08', '1500', 'D001');
When i executed the following query under SQL plus environment, it hang and gave no response. May i know how to solve this problem? Thank you
INSERT INTO EMP (EmpNo, EmpName, Sex, DateOfBirth, Salary, DeptNo)
VALUES ('E001', 'Alex', 'M', DATE '2006-11-08', '1500', 'D001');
Normally when we execute a query, it will show the result or response whether it is fail or success or what the error message is. But my situation is that it showed nothing and no response, and cannot execute new query, i cant do anything under that environment and i can only off it by using end task.
Similar Messages
-
How can i records with date format using web services?
Hello
I can't record date records using web services. I get no message errors.
I can import string values but no dates (YYYY-MM-DD). Do you have any clue about that?
Regards
Arturohello,
That's the code I'm using to update an opportunity. In the date fields (e.g. dFecha_de_entrega_al_cliente) I've tried to put an specific date in the correct format (If i put it in another format i've got an error message due the wrong format). The CRM accepted the code but it didn't update the values that are different of string.
I don´t know if there is something missing in teh program or if the developer environment is not the adequate.
Regards for your comments
Arturo
Private Sub ActualizarOportunidad(ByVal fila As Data.DataRow, ByVal TipoPersona As String)
Dim oLog As New Log()
Dim IdLog As Integer
Dim NumSerie As String = ""
Try
oLog.Insert_Log("Activación Garantía - Crear Oportunidad", oLog.GetLastIdProceso())
IdLog = oLog.GetLastId()
Dim sr_input As Opportunity.OpportunityUpdate_Input
Dim sr_output As Opportunity.OpportunityUpdate_Output
sr_input = New Opportunity.OpportunityUpdate_Input
Dim sr(1) As Opportunity.OpportunityData
sr(0) = New Opportunity.OpportunityData
NumSerie = fila("NumeroSerie").ToString().Trim()
sr(0).ExternalSystemId = NumSerie
sr(0).OpportunityName = fila("NumeroSerie").ToString().Trim()
sr(0).SalesStage = "Deseo" '"Cerrada/Ganada"
sr(0).dFecha_de_entrega_al_cliente = fila("FechaEmision").ToString().Trim()
sr(0).dFecha_de_facturacin_al_cliente = fila("FechaCompra").ToString().Trim()
sr(0).stNro_Factura = fila("NumeroFactura").ToString().Trim()
sr(0).plActividad_Economica = fila("IdActividad").ToString().Trim()
sr(0).plTipo_de_Venta = fila("TipoCompra").ToString().Trim()
sr(0).CustomObject8ExternalSystemId = fila("ApellidoVendedor").ToString.Trim()
'sr(0).CustomObject8ExternalSystemId = IIf(TipoPersona = "J", fila("DocumentoE").ToString().Trim(), fila("Documento").ToString.Trim())
'sr(0).CustomObject7ExternalSystemId = fila("")
Dim lofsr As Opportunity.ListOfOpportunityData
lofsr = New Opportunity.ListOfOpportunityData
lofsr.Opportunity = sr
sr_input.ListOfOpportunity = lofsr
sr_output = oOpportunity.OpportunityUpdate(sr_input)
oLog.Update_Log(IdLog, "Si", NumSerie, "")
Catch ex As SoapException
Me.txtError.Text = ex.Detail.InnerText.ToString()
oLog.Update_Log(IdLog, "No", NumSerie, ex.Detail.InnerText.ToString())
End Try
End Sub
************************************************************************ -
How to insert multiple records with a single query?
Hi,
I've to save a huge number of installments with their other information such as due on blah blah. Now, I want to add the all of these information at once with a single insert query.
How can I do that?Hi
What is your source data?
If the source is external to the SQL Server (like a log file, Excel, CSV, JSON, XML, external application...) you can and should insert it all using Bulk Insert operation.
Pls clarify what is your source data, and if you need more help using Bulk Insert.
https://www.simple-talk.com/sql/learn-sql-server/bulk-inserts-via-tsql-in-sql-server/
http://msdn.microsoft.com/en-us/library/ms188365.aspx
[Personal Site] [Blog] [Facebook] -
Inserting multiple records with many repeating fields
I trying to get my form to accept default values from previous entries on insert.
For instance a user has 10 records to enter into a table lets say it contains 8 fields. In these batches 3 of the 8 fields are always the same and the users don't want to repeat these 3 field entries for all 10 records. After the 1st insert they want these 3 fields defaulted to the previous entry's values.
Any ideas?I'm using BC4J for development.
Also the records are going to be inserted one at a time.
So they will enter a record. Hit insert , add another...
and so on -
Insert record wizard date format
Hi,
How can i change the default insert from mm/dd/yyyy to uk format dd/mm/yyyy
currently if i insert 08/05/2010 which is the 8th may 2010 in uk it will put it into database as 2010/08/05 which when i retrieve is the 5th august 2010 in uk.
is there a config folder anywhere i can change this?
many thanksthanks bregent.
it is php/mysql
not sure what that other reply is about after yours but thanks for your advice.
is there no way in dreamweaver to change the preferences like in addt to a specific date format?
thanks
Date: Wed, 19 May 2010 12:25:47 -0600
From: [email protected]
To:
Subject: Dreamweaver Application Development Insert record wizard date format
You didn't mention what DBMS or scripting language you are using.
The best way to get dates from a user is to supply 3 fields for input; day, month, year - then assemble them into the string format that the DBMS is expecting.
> -
Hi,
I've a problem with an insert, I wont to insert a record with one date column that I extract from data_picker_item, like this:
insert into backup_adm.tmp_job_runs@REP920DC_LNK values
(:P3_OPCO,
16642,
to_char(to_date(:P3_TIMESTAMP,'DD/MM/YYYY hh24:mi')),
to_date('05/11/09 18:34','dd/mm/yy hh24:mi'),4,-1,2,1);
I.ve receive this error:
ORA-01461: can bind a LONG value only for insert into a LONG column ORA-02063: preceding line from REP920DC_LNKALWAYS use a column list of the columns being inserted in the INSERT statement.
insert into backup_adm.tmp_job_runs@REP920DC_LNK
(column1, column2, ...)
values
(value1, value2, ...)If doing this doesn't fix the problem, post a description of the table. -
How to insert dummy record as KF =0 when i dont get trx data from customer
Hi
In BI DSO, i wanted to insert a dummy record with its Key Fields values = 0 in case i don't get any data for a particular day from customer. Could you pls suggest me what to do.
Thanks...
Edited by: Harpal Singh on Aug 18, 2010 3:19 PMhello,
Well my first suggestion is it would be great if you could give us example with data for better understanding. Here is what i understood, at a given date and customer number you want key figure value zero if there is no transaction data for this customer on that date.
You can write this code at endroutine:
Step1: You need to select all the customer records from customer infoobject and store that in internal table
Step2: Now you will compare the internal table with all customer number with the result package ( this result package is nothing but a kind of internal table at end routine ).
Step3: On comparison with the result package append the result package with reocords of customer which is not found during comaprison..
If you can give the data i can write sample code.....
Hope this helps
thanks
syed -
How to retrieve unique records with more than one column
I have a table sps_prod as described below -
POGNAME VARCHAR2(1500)
INDEX#VERSION VARCHAR2(200)
POG_MODEL_STATUS VARCHAR2(100)
POG_LAYOUT_TYPE VARCHAR2(500)
POG_MARKET_SPECIFIC VARCHAR2(500)
POG_CONTACT_NUMBER VARCHAR2(100)
AREA_SUPPORTED VARCHAR2(500)
POG_COMMENTS VARCHAR2(1500)
POG_FOOTER_COMMENTS VARCHAR2(1500)
POG_ELECTRICAL_LIST_1 VARCHAR2(1500)
POG_ELECTRICAL_LIST_2 VARCHAR2(1500)
POG_CARPENTRY_1 VARCHAR2(1500)
POG_CARPENTRY_2 VARCHAR2(1500)
INSTALLATION_INSTRUCTION_1 VARCHAR2(1500)
INSTALLATION_INSTRUCTION_2 VARCHAR2(1500)
FIXTURE_REORDER_NUMBER VARCHAR2(200)
FIXTURE_ID VARCHAR2(200)
FIXTURE_NAME VARCHAR2(500)
FIXTURE_IMAGE VARCHAR2(500)
PART_REORDER_NUMBER_9 VARCHAR2(500)
PART_FIXTURE_ID_9 VARCHAR2(500)
PART_FIXTURE_NAME_9 VARCHAR2(500)
PART_FIXTURE_IMAGE_9 VARCHAR2(500)
UPC VARCHAR2(50)
ITEM_NUMBER VARCHAR2(50)
DESCRIPTION VARCHAR2(700)
MERCH_TYPE VARCHAR2(20)
HEIGHT VARCHAR2(100)
WIDTH VARCHAR2(100)
DEPTH VARCHAR2(100)
CREATE_TS DATE
There are 4 millions records in it and many with the same combination of POGName,Index#Version,POG_Model_Status,POG_Layout_Type,POG_Market_Specific, POG_Contact_Number and Fixture_Name. How do I retrive records with all the columns above but with unique fixture_name and reorder_number combination. There are no keys defined on the table.
I guess this is a simple problem but the fact that I am trying to retrieve all the columns is stumbling me.
Thanks in advance.Hi,
Sanders_2503 wrote:
... There are 4 millions records in it and many with the same combination of POGName,Index#Version,POG_Model_Status,POG_Layout_Type,POG_Market_Specific, POG_Contact_Number and Fixture_Name. How do I retrive records with all the columns above but with unique fixture_name and reorder_number combination. I don't see a column called reorder_number. Do you mean fixture_reorder_number or part_reorder_number_9?
So you want only one row for each distinct combination of fixture_name and some other column (I'll assume that's fixture_reorder_number). Does it matter which row? They won't necessarily have the same values for the other columns.
The query below returns the one with the first pogname (in sort order):
WITH got_r_num AS
SELECT pogname, index#version, pog_model_status, pog_layout_type
, pog_market_specific, pog_contact_number, fixture_name
, ROW_NUMBER () OVER ( PARTITION BY fixture_name
, fixture_reorder_number
ORDER BY pogname
) AS r_num
FROM sps_prod
SELECT pogname, index#version, pog_model_status, pog_layout_type
, pog_market_specific, pog_contact_number, fixture_name
FROM got_r_num
WHERE r_num = 1
;If there happens to be a tie (that is, two or more rows with the same fixture_name, fixture_number, and first pogname) then one of the will be chosen arbitrarily.
Instead of "ORDER BY pogname", you can ORDER BY any other columns or expressions, but you must have an analytic ORDER BY clause. You can make it "ORDER BY NULL" if you really want to pcik an arbitrary row.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data (or a couple of examples of acceptable results).
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using. -
SQL Loader with date formatting
Hi,
I'm trying to get sql loader to insert a date into a column. After much browsing, reading trial and error I still get an array of errors.
I'm using oracle XE
my control file looks like this
LOAD DATA
INFILE 'posmeters/meters.csv'
INTO TABLE position_meters
FIELDS terminated by ","
ID CONSTANT '0',
POSITION_ID,
DATETIME DATE "DD/MM/YYYY HH24:MI:SS",
CASH_IN,
CASH_OUT,
NOTES_IN,
CHANGE_OUT,
WINNINGS,
VTP,
REFILL,
TOKEN_IN,
TOKEN_OUT,
ELEC_PAY,
ELEC_CREDIT,
REMOTE_PAY,
REMOTE_CREDIT,
INSERT_TS EXPRESSION "TO_CHAR(SYSDATE, 'DD/MM/YYYY HH24:MI:SS')",
FIFTY_PND,
TWENTY_PND,
TEN_PND,
FIVE_PND,
TWO_PND,
ONE_PND,
FIFTY_P,
TWENTY_P,
TEN_P,
FIVE_P
It is the DATETIME field which gives me grief. I have a test data file that looks like this
0,1010,29/09/2011 10:23:24,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24
and my table is defined as follows
ID NUMBER NOT NULL,
POSITION_ID NUMBER,
DATETIME TIMESTAMP(6) DEFAULT localTIMESTAMP NOT NULL,
CASH_IN NUMBER,
CASH_OUT NUMBER,
NOTES_IN NUMBER,
CHANGE_OUT NUMBER,
WINNINGS NUMBER,
VTP NUMBER,
REFILL NUMBER,
TOKEN_IN NUMBER DEFAULT (0) NOT NULL,
TOKEN_OUT NUMBER DEFAULT (0) NOT NULL,
ELEC_PAY NUMBER DEFAULT (0) NOT NULL,
ELEC_CREDIT NUMBER DEFAULT (0) NOT NULL,
REMOTE_PAY NUMBER DEFAULT (0) NOT NULL,
REMOTE_CREDIT NUMBER DEFAULT (0) NOT NULL,
INSERT_TS TIMESTAMP(6) DEFAULT (localtimestamp) NOT NULL,
FIFTY_PND NUMBER DEFAULT 0,
TWENTY_PND NUMBER DEFAULT 0,
TEN_PND NUMBER DEFAULT 0,
FIVE_PND NUMBER DEFAULT 0,
TWO_PND NUMBER DEFAULT 0,
ONE_PND NUMBER DEFAULT 0,
FIFTY_P NUMBER DEFAULT 0,
TWENTY_P NUMBER DEFAULT 0,
TEN_P NUMBER DEFAULT 0,
FIVE_P NUMBER DEFAULT 0
I have tried defining the control file with
DATETIME DATE "DD/MM/YYYY HH24:MI:SS",
DATETIME EXPRESSION "TO_DATE(:DATETIME, 'DD/MM/YYYY HH24:MI:SS')",
DATETIME EXPRESSION "TO_TIMESTAMP(:DATETIME, 'DD/MM/YYYY HH24:MI:SS')",
I get errors such as
Record 1: Rejected - Error on table "SITE_MAIN"."POSITION_METERS", column DATETIME.
ORA-01861: literal does not match format string
SQL*Loader-291: Invalid bind variable DATETIME in SQL string for column DATETIME.
any help would greatfully appreciated.It seems that the problem was caused by the constant at the beginning of the record and had nothing to do with date formats.
My control file now looks like this
LOAD DATA
INFILE 'posmeters/meters.csv'
APPEND INTO TABLE position_meters
FIELDS terminated by ","
POSITION_ID ,
DATETIME date "DD/MM/YYYY HH24:MI:SS",
CASH_IN ,
CASH_OUT ,
NOTES_IN ,
CHANGE_OUT ,
WINNINGS ,
VTP ,
REFILL ,
TOKEN_IN ,
TOKEN_OUT ,
ELEC_PAY ,
ELEC_CREDIT ,
REMOTE_PAY ,
REMOTE_CREDIT ,
INSERT_TS "TO_TIMESTAMP(SYSDATE, 'DD/MM/YYYY HH24:MI:SS')",
FIFTY_PND ,
TWENTY_PND ,
TEN_PND ,
FIVE_PND ,
TWO_PND ,
ONE_PND ,
FIFTY_P ,
TWENTY_P ,
TEN_P ,
FIVE_P
all is good :o) -
Problem with date format dd/mm/yyyy. But I need to convert yyyy-mm-dd.
Dear friends,
I have the problem with date format. I receiving the date with the format dd/mm/yyyy. But I can upload to MySQL only in the format of yyyy-mm-dd.
how should I handle this situation, for this I've created these code lines.But I have some problem with these line. please help me to solve this problem.
String pattern = "yyyy-mm-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("2006-02-12");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I need the date format in yyyy-mm-dd.
regards,
maza
thanks in advance.Thanks Dear BalusC,
I tried with this,
rs.getString("DATA_SCAD1")// where the source from .xls files
String pattern = "yyyy-MM-dd";
SimpleDateFormat format = new SimpleDateFormat(pattern);
try {
Date date = format.parse("DATA_SCAD1");
System.out.println(date);
} catch (ParseException e) {
e.printStackTrace();
System.out.println(format.format(new Date()));
this out put gives me Tue Apr 03 00:00:00 IST 2007
But I want to display the date format in yyyy-mm-dd.
regards,
maza -
SSRS is weird with date format
hello everyone,
I've got the weirdest problem.
At first it was the calendar in internet exporer showing the dutch format (which i want). After choosing the date i try to view the report. It wil tell me the date isnt in the right format. So for example. 22-02-2015 is wrong and should be 02-22-2015.
For the normal user this is annoying enough and i dont understand why the datepicker acts different than the report wants.
But now even stanger. I wanted to put a default date in my variable so i can test a bit easier. So i fill in 31-12-2015 and its accepted. But when i run the report, it tells me that the format is wrong. Soooooo. I changed the default value to 12-31-2015
(the english format)..... BUT!!! now the variable default value isnt accepted because its not in the right format.
Can someone please tell me how i can avoid format changes between browsers/platforms/computers or what so ever.
there is 1 format i want and nothing else. dd-MM-yyyy thats the way and nothing else.Hi Fibre1980,
As per my understanding, when you preview the report, you hope that the date is displayed in the format dd-MM-yyyy in calendar, right?
In Reporting Services, the format of date in calendar control depends on your client machines language and regional settings. If you want to display date in the format dd-MM-yyyy, you can get parameter values from a query, so that values get populated in a
dropdown list and displayed in your required format.
Here is a relevant thread you can reference:
https://social.technet.microsoft.com/Forums/en-US/6e719c7b-cfd5-4f0d-a530-f9710704446c/trouble-searching-with-date-format-usuk-formatting?forum=sqlreportingservices
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
If you have any feedback on our support, please click
here.
Wendy Fu
TechNet Community Support -
How to copy Log text (with Date, Time stamp ) User IDfrom BP to Transaction
Hi Experts,
Can someone guide us how to copy Log text (with Date ,Time & User ID) fron Business partner (Prospect) to transactions by text detrmination procedure.
Regards,
Basavaraj Patilsave text
Fill out following parameters of SAVE_TEXT function module:
HEADER
TDOBJECT C 10 BUT000
TDNAME C 70 10 digit BP number
TDID C 4 Z001
TDSPRAS C 1 Language
INSERT = X
LINES
TDFORMAT TDLINE
|
|testtttttttttttttttttttttttt( Your text)
I would suggest you to use some other BAPI that would attach your text to BP than SAVE_TEXT.
If you still wanted to use SAVE_TEXT then first make sure how the TDNAME is generated. It depends on the text determination procedure. For examples, it can be guid of BP, GUID followed by date or time or else the BP number itself.
Just go to BP transaction, double click on the text pad, it will open you the SAP Script editor. Click on menu GOTO and select Header which will give you info about your TDID, TDOBJECT, TDNAME....
Hope this helps. -
How to Save Multiple Records In Data Block
Hi All,
I Have Two Blocks --> Control Block,Database Block
Please Any Idea How to Save Multiple Records In Data Block when User changed Data in Control Block.
Thanks For Your Help
SaNow i have to use each record of control block(ctl_blk) as where condition in data base block(dat_blk)and display 10 records from database table.>
Do you want this coordination to be automatic/synchronized or only when the user clicks a button or something else to signal the coordination? Your answer here will dicate which trigger to put your code in.
As to the coordination part, as the user selects a record in the Control Block (CB), you will need to take the Key information and modify the Data Block's (DB) "DEFAULT_WHER E" block property. The logical place to put this code is the CB When-New-Record-Instance (WNRI) trigger. You code will look something like the following:
/* Sample WNRI trigger */
/* This sample assumes you do not have a default value in the BLOCK WHER E property */
DECLARE
v_tmp_dw VARCHAR2(250);
BEGIN
v_tmp_dw := ' DB_Key_Column1 = '||:CONTROL.Key_Column1||' AND DB_Key_Column2 = '||:CONTROL.Key_Column_2;
Set_Block_Property('DATA_BLOCK', DEFAULT_WHER E, v_tmp_df);
/* If you want auto coordination to occur, do the following */
Go_Block('DATA_BLOCK');
Execute_Query;
/* Now, return to the Control Block */
Go_Block('CONTROL_BLOCK');
END;
The Control block items are assigned with values in Form level (Key_exeqry).If your CD is populated from a single table, it would be better to create a Master - Detail relationship (as Abdetu) describes.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
How to insert null record (some col) in table using loop
Hi,
How to insert null record (for some columns) in table using loop.
sample data of x_tab
order_id order_name
231 xxx
123
345
111 vvvv
Thanks,
Lakshman
Edited by: kolipaka on Jul 5, 2012 1:37 PMYou have a table
CREATE TABLE tab (
col1 NUMBER,
col2 NUMBER,
col3 NUMBER,
col4 NUMBER
col5 NUMBER)Now you insert:
INSERT INTO tab (col2, col4) VALUES (5, 7);col1, col3 and col5 are NULL by default (there is no DEFAULT clause for these columns so they are NULL). -
Problem with date format when ask prompt web-intelligence
Bo XIR2 with 5 SP. Instaled on Windows 2003 with support Russian.
Inside BO every labels, buttons - use russian. But when invoke web-report and Prompt appear there is problem with date format.
Looks like korean format of date 'jj.nn.aaa H:mm:ss'. I see system settings of date in Win .. everything right
What i have to do?
Where i can change format date for bo?GK, try this...
decode(instr(packagename.functionname(param1 ,param2),'2400'), 0, to_date(to_char(to_date(rtrim(packagename.functionname(param1 ,param2),'(PT)'), 'Month dd, yyyy "at" hh24mi'),'mm/dd/yyyy hh24mi'),'mm/dd/yyyy hh24mi'),
to_date(to_char(to_date(rtrim(packagename.functionname(param1 ,param2),'(PT)'), 'Month dd, yyyy "at" "2400"')+1,'mm/dd/yyyy "0000"'),'mm/dd/yyyy "0000"'))-Marilyn
Maybe you are looking for
-
Remote desktop connection in windows 7 pro
I have a problem accessing remote desktop connection using windows 7 64 bit. My remote desktop connection shell version 6.3.9600 shows the Network Level Authentication is not supported. My other computer also win 7 pro 64 bit has a different shell ve
-
Planning file entry for MRP Area
Hi, To create planning file entry in the background at plant level we use Transaction MDAB. I would like to know that if MRP area is active than whats the T-code for planning file entry in the background at mrp area level?? To create manualy in the T
-
Can't send Excel 2007 File via Send To Email Option after Acrobat Install
Normally, you can send an Excel 2007 file via email to someone by going to the Send option on the Excel file menu and choosing "Email." This will email an actual copy of the Excel 2007 file. However, since installing Adobe Acrobat 9 pro on my comput
-
XPJ file appears to be corrupt -- have exhausted all known fixes
Hello all, Before I forget, here's the rundown on our system: RoboHelp 8, version 8.0.2.208 (all patches up-to-date, to our knowledge); RoboHTML used exclusively Microsoft Visual SourceSafe 2005, version 8.0.50727.42 Windows XP Three help projects Tw
-
Problems while writing xml doc to a file
Hi all , in my project (of distributed xml databases) i need to write the xml files from the main server to the clients. These xml files i had formed by fragmenting one xml doc and i did the fragmentation using .... TransformerFactory tf = Transforme