Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


The multi-part identifier error


The multi-part identifier error

Author
Message
israelthieme
israelthieme
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 10
[size="1"]I've being trying to figured out why this error is happening but no lucky yet.

The code:


SELECT
CONVERT(VARCHAR, S_OPERATION.DATE_OPER, 112) + ' ' + -- DATE OPER YYYYMMDD
CONVERT(VARCHAR, S_OPERATION.OPE_TIME, 102) + ' ' + -- OPE TIME HH:MI:SS
FNUMBER.FILE_SEQUENCY_REND + ' ' + -- BATCH NUMBER
RIGHT(REPLICATE('0',16) + CONVERT(VARCHAR(16),
DBO.F_EXTRACT_NBR_CHAR(RECEIVER.C_CPF)),16) + ' ' + -- RECEIVER CPF / CNPJ
DBO.FN_FORMAT_RIGHT_SPACES(RECEIVER.C_NAME, 40) + ' ' + -- RECEIVER NAME
RIGHT(REPLICATE('0',14) + CONVERT(VARCHAR(14),
DBO.F_EXTRACT_NBR_CHAR(RECEIVER.C_PHONE1)),14) + ' ' + -- RECEIVER PHONE NUMBER
DBO.FN_FORMAT_RIGHT_SPACES(RECEIVER.C_ADDRESS, 50) + ' ' + -- RECEIVER ADDRESS
DBO.FN_FORMAT_RIGHT_SPACES(RECEIVER.C_CITY, 20) + ' ' + -- RECEIVER CITY
DBO.FN_FORMAT_RIGHT_SPACES(S_ACCOUNT.ACCOUNT_STATE) + ' ' + -- RECEIVER STATE
RIGHT(REPLICATE('0',14) + CONVERT(VARCHAR(14), DBO.F_EXTRACT_NBR_CHAR(RECEIVER.C_ZIP)),14) + ' ' + -- RECEIVER ZIP
DBO.FN_FORMAT_RIGHT_SPACES(RECEIVERCOUNTRY.COUNTRY , 20) + ' ' + -- RECEIVER COUNTRY
RIGHT(REPLICATE('0',3) + CONVERT(VARCHAR(3), ISNULL(S_BANK.BANK_NUMBER, 0)),3) + ' ' + -- BANK NUMBER
DBO.FN_FORMAT_RIGHT_SPACES(S_ACCOUNT.AGENCY, 30) + ' ' + -- AGENCY
DBO.FN_FORMAT_RIGHT_SPACES(S_ACCOUNT.ACCOUNT, 16) + ' ' + -- ACCOUNT NUMBER (CHAR)
LEFT(ISNULL(S_ACCOUNT.ACCOUNT_TYPE, 'C/C'), 1) + ' ' + -- ACCOUNT TYPE
DBO.FN_FORMAT_RIGHT_SPACES(SENDER.C_NAME, 40) + ' ' + -- SENDER
DBO.FN_FORMAT_RIGHT_SPACES(SENDER.C_CUSTOMER_ID, 40) + ' ' + -- SENDER ID
DBO.FN_FORMAT_RIGHT_SPACES(SENDER.C_ADDRESS, 50) + ' ' + -- SENDER ADDRESS
DBO.FN_FORMAT_RIGHT_SPACES(SENDER.C_CITY, 20) + ' ' + -- SENDER CITY
DBO.FN_FORMAT_RIGHT_SPACES(S_ACCOUNT.ACCOUNT_STATE,2) + ' ' + -- SENDER STATE
RIGHT(REPLICATE('0',14) + CONVERT(VARCHAR(14), DBO.F_EXTRACT_NBR_CHAR(SENDER.C_ZIP)),14) + ' ' + -- RECEIVER ZIP
DBO.FN_FORMAT_RIGHT_SPACES(SENDERCOUNTRY.COUNTRY , 20) + ' ' + -- SENDER COUNTRY
RIGHT(REPLACE(REPLICATE('0', 15) + CAST(CAST(AMOUNT * RATE AS NUMERIC(15,2)) AS VARCHAR), '.', '') ,15) + ' ' + -- FOREING AMOUNT
'L' + ' ' + -- CURRENCY TYPE L = LOCAL / D = DOLLAR
'N' + ' ' + -- TRANS TYPE - N=NEW OR V=VOID
RIGHT(REPLICATE('0',10) + CONVERT(VARCHAR(10), S_OPERATION.OPE_NUMBER),10) + ' ' + -- OPERATIONS NUMBER
SPACE(20) + ';' + -- LIVRE
SPACE(80) -- LIVRE
AS LINE,
S_OPERATION.DATE_OPER,
S_OPERATION.OPE_TIME,
S_OPERATION.FOREING,
S_OPERATION.OPE_NUMBER,
S_OPERATION.OPE_SUBNUMBER,
S_OPERATION.MAKER,
S_OPERATION.AMOUNT,
S_OPERATION.FEE_AMOUNT,
ISNULL(S_OPERATION.COM_STAR,0) AS COM_STAR
FROM S_OPERATION, S_FILE_NUMBER FNUMBER
JOIN S_CUSTOMER SENDER
ON S_OPERATION.SENDER_ID = SENDER.C_CUSTOMER_ID
JOIN S_CUSTOMER RECEIVER
ON S_OPERATION.RECEIVER_ID = RECEIVER.C_CUSTOMER_ID
JOIN S_COUNTRY SENDERCOUNTRY
ON SENDER.C_COUNTRY_ID = SENDERCOUNTRY.COUNTRY_ID
JOIN S_ACCOUNT
ON S_OPERATION.ACC_ID = S_ACCOUNT.ACCOUNT_ID
JOIN S_BANK
ON S_ACCOUNT.BANK_ID = S_BANK.BANK_ID
JOIN S_S_OPERATIONATION_PAYERBATCH
ON S_OPERATION.OPE_NUMBER =
S_OPERATIONATION_PAYERBATCH.OPE_NUMBER
WHERE S_S_OPERATIONATION_PAYERBATCH.IDPAYERBATCH = @IDPAYERBATCH



And the error



Msg 4104, Level 16, State 1, Procedure sp_generate_payerbatch, Line 207
The multi-part identifier "S_OPERATION.SENDER_ID" could not be bound.
Msg 4104, Level 16, State 1, Procedure sp_generate_payerbatch, Line 209
The multi-part identifier "S_OPERATION.RECEIVER_ID" could not be bound.
Msg 4104, Level 16, State 1, Procedure sp_generate_payerbatch, Line 213
The multi-part identifier "S_OPERATION.ACC_ID" could not be bound.



Thanks for any help
[/size]
piotrka
piotrka
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1003 Visits: 680
Start with the first join and see how that goes

SELECT TOP 100 *
FROM S_OPERATION, S_FILE_NUMBER FNUMBER
JOIN S_CUSTOMER SENDER
ON S_OPERATION.SENDER_ID = SENDER.C_CUSTOMER_ID

Are you trying to join 2 tables S_OPERATION and SENDER?
Then this should work

SELECT TOP 100 *
FROM S_OPERATION AS O
INNER JOIN SENDER AS S
ON O.ENDER_ID = S._CUSTOMER_ID
David Webb-CDS
David Webb-CDS
SSC Eights!
SSC Eights! (916 reputation)SSC Eights! (916 reputation)SSC Eights! (916 reputation)SSC Eights! (916 reputation)SSC Eights! (916 reputation)SSC Eights! (916 reputation)SSC Eights! (916 reputation)SSC Eights! (916 reputation)

Group: General Forum Members
Points: 916 Visits: 8584
Not sure your join makes sense. You'll need to fill in the question marks below, but this removes the mixed join types:

FROM S_OPERATION
JOIN S_CUSTOMER SENDER
ON S_OPERATION.SENDER_ID = SENDER.C_CUSTOMER_ID
JOIN S_CUSTOMER RECEIVER
ON S_OPERATION.RECEIVER_ID = RECEIVER.C_CUSTOMER_ID
JOIN S_COUNTRY SENDERCOUNTRY
ON SENDER.C_COUNTRY_ID = SENDERCOUNTRY.COUNTRY_ID
JOIN S_ACCOUNT
ON S_OPERATION.ACC_ID = S_ACCOUNT.ACCOUNT_ID
JOIN S_BANK
ON S_ACCOUNT.BANK_ID = S_BANK.BANK_ID
JOIN S_S_OPERATIONATION_PAYERBATCH
ON S_OPERATION.OPE_NUMBER =
S_OPERATIONATION_PAYERBATCH.OPE_NUMBER
join S_FILE_NUMBER FNUMBER on ??????? = ???????
WHERE S_S_OPERATIONATION_PAYERBATCH.IDPAYERBATCH = @IDPAYERBATCH





And then again, I might be wrong ...
David Webb
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search