?
Solved

Insert date in MS SQL

Posted on 2007-12-01
5
Medium Priority
?
1,789 Views
Last Modified: 2010-08-05
Hallo Experts.
I try to have a date when i insert an artikel in a db table.
The table is t_artikel
One column is called hersteller_pkw_id and the other is the datein.
What changes must i do in the following code which is made with  webassist-dataassist extension?
<cfif (isDefined("Form.Insert.x")) >
  <cfset WA_connection = "carfree24" />
  <cfset WA_insTable = "dbo.t_artikel" />
  <cfset WA_sessionName = "WADA_Insert_dbot_artikel" />
  <cfset WA_redirectURL = "t_artikel_Detail.cfm" />
  <cfset WA_keepQueryString = false>
  <cfset WA_indexField = "art_id" />
  <cfset WA_fieldNamesStr = "hersteller_pkw_id|Datein" />
  <cfset WA_fieldValuesStr = "" & ToString(IIf(isDefined("Form.hersteller_pkw_id"),"Form.hersteller_pkw_id",DE(""))) & "" & "|" & "" & ToString(IIf(isDefined("Form.Datein"),"Form.Datein",DE(""))) & "" />
  <cfset WA_columnTypesStr = "none,none,NULL|',none,NULL" />
  <cfset WA_comparisonStr = " = | = " />
  <cfset WA_fieldNames = WA_ListToArray(WA_fieldNamesStr,"|") />
  <cfset WA_fieldValues = WA_ListToArray(WA_fieldValuesStr,"|") />
  <cfset WA_columns = WA_ListToArray(WA_columnTypesStr,"|") />
  <cfset WA_comparisions = WA_ListtoArray(WA_comparisonStr, "|") />
  <cfset insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1) />.........
0
Comment
Question by:Panos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 17

Expert Comment

by:Barry Cunney
ID: 20389079
Hi panosms,
What is the problem and what is your question?
Are you having problems inserting the date from the Form - Please give us some more details
0
 
LVL 2

Author Comment

by:Panos
ID: 20390671
Hallo BCUNNEY.
The problem is that i cannot get the date Now() in my db using this form.
When i use The INSERT INTO ...... VALUES........ Now() i have no problems but with this generated code from the extension i can't get it.I hope you did understand me now.
0
 
LVL 2

Accepted Solution

by:
Panos earned 0 total points
ID: 20390737
Hallo again.
I have fixed the code.The working code is
<cfif (isDefined("Form.Insert.x")) >
  <cfset WA_connection = "carfree24" />
  <cfset WA_insTable = "dbo.t_artikel" />
  <cfset WA_sessionName = "WADA_Insert_dbot_artikel" />
  <cfset WA_redirectURL = "t_artikel_Detail.cfm" />
  <cfset WA_keepQueryString = false>
  <cfset WA_indexField = "art_id" />
  <cfset WA_fieldNamesStr = "hersteller_pkw_id|Datein" />
  <cfset WA_fieldValuesStr = "" & ToString(IIf(isDefined("Form.hersteller_pkw_id"),"Form.hersteller_pkw_id",DE(""))) & "" & "|" & "" & ToString(DateFormat(Now() ,"dd/mm/yyyy")) & "" />
  <cfset WA_columnTypesStr = "none,none,NULL|',none,NULL" />
  <cfset WA_comparisonStr = " = | = " />
  <cfset WA_fieldNames = WA_ListToArray(WA_fieldNamesStr,"|") />
  <cfset WA_fieldValues = WA_ListToArray(WA_fieldValuesStr,"|") />
  <cfset WA_columns = WA_ListToArray(WA_columnTypesStr,"|") />
  <cfset WA_comparisions = WA_ListtoArray(WA_comparisonStr, "|") />
  <cfset insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1) />

Thank You.
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20631847
Closed, 125 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question