×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Sending a NULL Value as a PARAMETER in a SQL Pass Thru

Sending a NULL Value as a PARAMETER in a SQL Pass Thru

Sending a NULL Value as a PARAMETER in a SQL Pass Thru

(OP)
I have SEVERAL parameters in a FEX which calls a Microsoft SQL Stored Procedure.

Some of these parameters may need to be NULL.
I have tried pass NULL to a DATE type of receiving parameter, but I get an error.

How can I assign a NULL VALUE to a DEFAULT PARAMETER(S)?

Thanks,

Leo   

RE: Sending a NULL Value as a PARAMETER in a SQL Pass Thru

Try using HEXBYTE. See the User Written Subroutines.

RE: Sending a NULL Value as a PARAMETER in a SQL Pass Thru

(OP)
What is HEXBYTE?

Where are the User Written Subroutines?

Thanks,

Leo   

RE: Sending a NULL Value as a PARAMETER in a SQL Pass Thru

Sorry, its HEXBYT. Its definition depends somewhat on your platform. The following is from the Webfocus Online Language Reference for the desktop Developer's Studio.

HEXBYT translates an integer between 0 and 255 (base 10) into the corresponding ASCII character. You can use HEXBYT to produce characters that are not on your keyboard. The syntax is

HEXBYT (number, outfield)

where:

Argument     Format     Description
number     Numeric     A number between 0 and 255. The number is truncated to an integer. If the integer is greater than 255, the subroutine divides the integer by 256 and uses the remainder for this argument.
outfield     A1     The name of the output field, or the format of the output value. If you supply the format, enclose it in single quotation marks (’).
The following request displays the names and salaries of employees and uses HEXBYT to enclose the names of employees earning less than $12,000 a year in brackets. Note that the ASCII codes for the left and right bracket are 91 and 93, respectively.

DEFINE FILE EMPLOYEE
BRACK/A17 = HEXBYT (91, 'A1')||LAST_NAME||HEXBYT (93, 'A1');
BNAME/A17 = IF CURR_SAL LT 12000 THEN BRACK ELSE LAST_NAME;

END
TABLE FILE EMPLOYEE
PRINT BNAME CURR_SAL BY EMP_ID
END

The user written subroutines are included with every version of Focus I know about, but the manual may be sold separately.

RE: Sending a NULL Value as a PARAMETER in a SQL Pass Thru

(OP)
This won't work since the tables I am accessing via the Stored Procedure exist in a MS SQL environment.

Thanks,

Leo   

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close