Well, for a numeric field of any sort on the iseries,
INSERT INTO mylib.myfile (NumField) VALUES (123456)
will work, assuming other things are OK. Actually, at V5R4, you can pass a
character representation of a number and it will still work.
The ASP value held in NumField (not the field in the iseries PF) - what is a
typical value - is that field a character field or a numeric - does it contain
commas? Are you running into a locale problem, such as decimal point and
thousands separator stuff?
I finally suggest turning on the Database monitor, either at a green screen or
through iSeries Navigator. This way you can find out just what is happening on
the iSeries - what the statement is when it comes from your web page. STRDBMON
is the command, and you can make it run against all jobs.
STRDBMON OUTFILE(VERN/DBMON)
JOB(*ALL)
TYPE(*DETAIL)
Then run your web page
Then use
ENDDBMON JOB(*ALL)
Then you get to go to www.iseries.ibm.com/db2 and go to their tech pages there
to find an article on using the DB monitor. Or you can use iSeries Nav to
interpret what you collected.
HTH
Vern
-------------- Original message --------------
From: "Raby, Steve" <agnictsr@xxxxxxxxxxxxx>
Hi Vern
Nope we were already advised of that;
Steve,
Try getting rid of the single quotes around &NumField when you construct the
SQLINSERT statement. Enclosing the value in quotes indicates a character
literal.
Regards
Paul Tuohy
ComCon
Hi Paul,
Now we get SQL0104 Token was not valid, the value looks right and is coming
out
in the right place on the error message.
-----Oorspronkelijk bericht-----
Van: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]Namens Vernon Hamberg
Verzonden: donderdag 30 november 2006 15:01
Aan: Midrange Systems Technical Discussion
Onderwerp: RE: Dave Odom was RE: Mark Allen, were you the
onethat'strying to put numeric datato i5 via ASP???
Hi Steve
When I said it shows *SQL, I meant that your statement was using SQL
naming - lib.file instead of lib/file. There is an attribute of the
connection that you can use to set which naming convention to use - I
forget what the default is. Your code does explicitly set the naming
convention.
As to the statement, here is what it is after resolving variables and all
INSERT INTO mylib.myfile (NumField) VALUES ('123456')
If NumField in myfile is numeric, then this will not work, because
you are putting a character string into a numeric field. Get rid of
both apostrophes. In particular, change
SQLINSERT=SQLINSERT &"'" &NumField &"')"
to
SQLINSERT=SQLINSERT &NumField &")"
HTH
Vern
At 07:07 AM 11/30/2006, you wrote:
Hi Vern
It may or may not be rocket science, and in all probability it will
turn out to be something very simple but I do know it is frustrating
as hell. We drag the data from the iSeries fine but when we go to
send it back is when it goes wrong. The code I sent in my original
message is where the error occurs. Apparently there is nothing in
ASP where you can define what a field should be, or so I am told.
SQLINSERT="INSERT INTO mylib.myfile (NumField)"
SQLINSERT=SQLINSERT & " VALUES ("
SQLINSERT=SQLINSERT &"'" &NumField &"')"
set connupdate = server.createobject("ADODB.Connection")
connupdate.open "Provider=IBMDA400;Data Source=xxx.xxx.xxx.x;", "ABC", "ABC"
connupdate.execute(SQLINSERT)
connupdate.close
As far as the naming convention goes, if it shows *SQL should it not
be *SQL? Seems a little strange to me that you can set a value to
one thing but it displays something totally different.
I know next to nothing about ASP, my friend who does ASP is away
until Monday, so unfortunately I cannot get into the source. I will
get the details from him when he gets back.
Steve
-----Oorspronkelijk bericht-----
Van: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]Namens Vernon Hamberg
Verzonden: donderdag 30 november 2006 13:40
Aan: Midrange Systems Technical Discussion
Onderwerp: Re: Dave Odom was RE: Mark Allen, were you the one
that'strying to put numeric datato i5 via ASP???
Steve
This is not rocket science - there is something very simple that is
not right. Please leave details - what is the final ASP code that
gave you the SQL0104 message?
We do numerics all the time - ODBC and OLEDB have done it forever -
you are using the IBMDA400 provider - it works - no problems.
What naming convention are you using - it shows *SQL but maybe it is
set to *SYS.
Can you debug the ASP code - I know it is similar to VB, but I've
never worked in it myself. If so, verify what the full SELECT
statement looks like - something is wrong with it.
So help us help you.
Vern
At 01:34 AM 11/30/2006, you wrote:
C'mon Dave were you just teasing us? Getting our hopes up only to
have them dashed on the rocks of machine interface incompatability?? ;-)
How do you pass numerics to the iSeries via ASP? We have tried many
things and none work.
Steve
-----Oorspronkelijk bericht-----
Van: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]Namens Raby, Steve
Verzonden: woensdag 29 november 2006 10:36
Aan: Midrange Systems Technical Discussion
Onderwerp: RE: Mark Allen,were you the one that's trying to put numeric
datato i5 via ASP???
That would be me, how is it done then? Cos we have not got a clue
-----Oorspronkelijk bericht-----
Van: midrange-l-bounces+agnictsr=aeroground.nl@xxxxxxxxxxxx
[mailto:midrange-l-bounces+agnictsr=aeroground.nl@xxxxxxxxxxxx]Namens
Dave Odom
Verzonden: dinsdag 28 november 2006 19:59
Aan: midrange-l@xxxxxxxxxxxx
Onderwerp: Mark Allen, were you the one that's trying to put numeric
datato i5 via ASP???
If so, I do that with an ASP application and it's not a problem.
FWIW.
Take care,
Dave Odom
Arizona
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.