Sorry if this first post isn't enough information to go on, I'm a bit out of my element so please forgive my lack of protocol.

I'm trying to research a problem we have run into and as no one here has any sybase knowledge we just are unsure where to turn to in order to find a resolution. So the basic outline is we are trying to use an odbc connection that we setup using the sqlanywhere 16 driver, we can get the data we need via the tables, so the connection works. Now here is where we are lost, there is a need to use a function that is on the server, when we do so we get a syntax error near 'dba' on line 1.
"dba.fn_GetShpLbrCostPart(" & "'" & {company.company_code} & "'" & ", " & ToText({shp_line.pks_num},0,"") & ", " & ToText({shp_line_src.cust_po_line_num},0,"") & ", " & "'L');";

Regrettably we are in a jam over this and just hoping someone out there can throw us a preserver if you will.

asked 16 Aug, 10:27

rkbisme's gravatar image

rkbisme
112
accept rate: 0%

Have you tried:

select * from dba.fn_GetShpLbCostPart...

-or-

set var = dba.fn_GetShpLbCostPart

where var is declared as a valid return type for the function.

(16 Aug, 11:29) Chris Keating
Replies hidden

I have probably left out something here, the formula above returns dba.fn_GetShpLbrCostPart('1', 57398, 1, 'L'); so the returned data ('1', 57398, 1, 'L') is from the data and would need to be used by the function in order to do its job and return a cost number.

(16 Aug, 14:33) rkbisme

If this is a stored function, not a stored procedure, I would try to call

select dba.fn_GetShpLbCostPart...
(16 Aug, 14:33) Volker Barth

Then maybe you need something like this

select *
  from company
       join shp_line on ....
       join shp_line_src on ... ,
       lateral(select ... from dba.fn_GetShpLbrCostPart(" & "'" & {company.company_code} & "'" & ", " &     ToText({shp_line.pks_num},0,"") & ", " & ToText({shp_line_src.cust_po_line_num},0,"") & ", " & "'L'))
(17 Aug, 02:14) Christian Ha...
Replies hidden
1

What language is this? Crystal Reports?

Please show us the exact code, with the surrounding context, that is having the problem. Use copy and paste, do not re-type it.

Please show the entire exact error message, with the surrounding context. Use copy and paste, do not re-type it.

Thanks!

(20 Aug, 09:00) Breck Carter

What language is this select written in? ...because in SQL Anywhere syntax the & operator is bitwise AND :)

(20 Aug, 09:03) Breck Carter
showing 4 of 6 show all flat view
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×15

question asked: 16 Aug, 10:27

question was seen: 132 times

last updated: 20 Aug, 09:03