getting error in UNIX [message #298435] |
Wed, 06 February 2008 02:01  |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
Hi All,
I have two table as follows.
table_name=PORD1
item units
1234 1
1234 10
2345 1
3245 1
3245 6
table_name=PROD2
item desc
1234 chairs
1234 chairs
2345 books
3245 pens
3245 pens
Now required O/P is:
Item decsrip
1234 1234 chairs_1
1234 1234 chairs_10
2345 2345 books_1
3245 3245 pens_1
3245 pens_6
I wrote a query in TOAD as follows
select p1.item,SUBSTR(p1.item, 1, 7)||' '||SUBSTR(p2.ITEM_DESC,1,52)||'_'|| p1.units DESCRIP
from prod1 p1,prod2 p2
where p1.item=p2.item
I got O/P as per requirement.
same thing when I am running the script in UNIX I am getting the O/P as follows.
Item Descrip
1234 1234 chairs_1
1234 1234 chairs_1
2345 2345 books_1
3245 3245 pens_1
3245 3245 pens_1
I am not getting the O/P as per requirement. I am getting the O/P in TOAD. Why I am not getting the O/P in UNIX.Please help me in this issue.
Please give me the solution for this.
Thank you.
[Updated on: Wed, 06 February 2008 02:11] Report message to a moderator
|
|
|
|
Re: getting error in UNIX [message #298444 is a reply to message #298442] |
Wed, 06 February 2008 02:13   |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
Hi Michel,
I have created the script with the same query with extention ".KSh" and execute the script. But I am not getting the required O/P.Can you please look into this.
I am getting the O/P as follows from UNIX.
1234 1234 BATTERIES_1
1234 1234 BATTERIES_1
Thank you.
[Updated on: Wed, 06 February 2008 02:16] Report message to a moderator
|
|
|
|
Re: getting error in UNIX [message #298453 is a reply to message #298450] |
Wed, 06 February 2008 02:30   |
user71408
Messages: 585 Registered: November 2007 Location: NE
|
Senior Member |
|
|
<FLOW name = "${PROGRAM_NAME}.flw">
${DBREAD}
<PROPERTY name = "query">
SELECT p1.ITEM,
SUBSTR(p1.item, 1, 7)||' '||SUBSTR(p2.DESC,1,52)||'_'|| p1.units DESCRIP
from PROD1 p1,PROD2 p2
where p1.item=p2.item
</PROPERTY>
This is the script I have...
Thank you
|
|
|
Re: getting error in UNIX [message #298454 is a reply to message #298453] |
Wed, 06 February 2008 02:32   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
That is not a Unix script. What is is? How is it executed? Post the actual execution like Michel already asked two times.
|
|
|
|
Re: getting error in UNIX [message #298459 is a reply to message #298455] |
Wed, 06 February 2008 02:45  |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
What you tell us you do does definetely not work :
$ cat item.ksh
<FLOW name = "${PROGRAM_NAME}.flw">
${DBREAD}
<PROPERTY name = "query">
SELECT p1.ITEM,
SUBSTR(p1.item, 1, 7)||' '||SUBSTR(p2.DESC,1,52)||'_'|| p1.units DESCRIP
from PROD1 p1,PROD2 p2
where p1.item=p2.item
</PROPERTY>
$ ./item.ksh
./item.ksh: line 1: syntax error near unexpected token `newline'
./item.ksh: line 1: `<FLOW name = "${PROGRAM_NAME}.flw">'
$
So you either tell us the truth about what you are doing, and post the actual execution or you are on your own.
|
|
|