View previous topic :: View next topic
|
Author |
Message |
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
pshongal wrote: |
Hi Gnana Sekaran.
I infact removed that condition itself.
Code:
QUERYSQL = "DELETE FROM table_name WHERE"||,
"ac_num = '"||AC1||"';"
Still same result. |
So, what you're passing to DSNREXX is
Code: |
DELETE FROM table_name WHEREac_num = 'AC1'; |
and you're puzzled as to why it doesn't work? |
|
Back to top |
|
|
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Hi Akatsukami,
Thats right. |
|
Back to top |
|
|
Stefan
Active User
Joined: 12 Jan 2006 Posts: 110 Location: Germany
|
|
|
|
Code: |
QUERYSQL = "DELETE FROM table_name WHERE"||,
"ac_num = '"||AC1||"';"
|
I assume the -104 comes from the table name concatenated with the word "WHERE".
So put in a blank or remove the silly || as in
Code: |
QUERYSQL = "DELETE FROM table_name WHERE",
"ac_num = '"||AC1||"';"
|
|
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Long thread for such a simple problem. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
About your problem:- In addition to displaying the SQLCODE, you should as well display the SQLERRMC value.
It will tell you which token is erroneous. About your code:- The SUBCOM to CONNECT commands should be issued before displaying the panel.
If there is a problem connecting to DB2, why let the user loose time in filling the panel. - That will not work:
Quote: |
rexxvar="COMMIT"
ADDRESS DSNREXX "EXECSQL rexxvar" |
This is nice if you are paid by the line:
Quote: |
If RC ¬= 0 Then
Do
exit
End |
If not, you could just write "If RC ¬= 0 Then Exit"
About your post:- Use COPY/PASTE or double-check yourself!
"WHERE" is missing from these lines:
Quote: |
QUERYSQL = "DELETE FROM table_name"||,
"ac_num = '"||AC1||"'"||" AND abc = NULL" |
Learn to use BBCODE ! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
with any REXX script, use TRACE
before you annoy us with your Rookie BS. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Where is the WHERE in your code? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Whenever I write REXX + SQL programs I display the built query and copy that and try executing it in SPUFI
By doing that you could atleast ensure the syntax of SQL is correct
You have give the display but did you try to EXECUTE the displayed result in SPUFI |
|
Back to top |
|
|
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Hi Nic,
Its typo, I have missed. I have given it in my query.
Hi Pandora-Box,
I did exactly the same way as you said using QMF. It does work. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Is your rexx program working?
If yes , Moderators please lock it |
|
Back to top |
|
|
pshongal
New User
Joined: 14 Jun 2012 Posts: 96 Location: India
|
|
|
|
Hi Pandora-Box,
REXX pgm is not working. But anyways.. I will try to dig more and try to find solution. If I find something, I will post the solution.
Thanks to all for your responce. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Do not re-type your code - cut and paste it. That way you stop people looking at rubbish introduced by your re-typing. Instead they can look at what you actually run. And you were asked some time ago to run with a trace and pst the results and you have shown no evidence of having done that. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I will try to dig more and try to find solution. If I find something, I will post the solution. |
The problem was clearly identified already by other posters. And a recommended solution was also already posted. Re-read Akatsukami and Stefan's posts again. |
|
Back to top |
|
|
|